Loading...
Loading...
Comprehensive guide for the TanStack ecosystem in React — Query (caching, mutations, prefetching, SSR), DB (collections, live queries, optimistic updates), Form (state, validation, fields), Router (file-based, type-safe navigation, search params, loaders), and Start (server functions, middleware, auth, SSR). Use when working with any TanStack library in a React/full-stack project. Don't use for non-TanStack data libraries (SWR, Apollo, RTK Query), non-React TanStack ports (Solid, Svelte), or backend-only work.
npx skill4agent add marcioaltoe/skills tanstackreferences/*.md| Task | MUST read |
|---|---|
| |
| Typed collections, live queries, optimistic collection mutations | |
| Forms, field components, validation, async checks | |
| Routes, search params, loaders, navigation, auth-protected layouts, router setup | |
| Server functions, middleware, sessions, SSR streaming, env, deploy adapters | |
| Anything that touches two or more layers (e.g. route loader + server fn + form) | Each file from the relevant rows — read all before designing |
| File | What you get |
|---|---|
| Vanilla Query: key factories + |
| DB collections: 5 critical rules, collection setup, live queries with joins, optimistic updates, shared collection instances, persistence handlers, common anti-patterns, advanced patterns (computed, aggregations, pagination) |
| Form: |
| Router: |
| Start: |
staleTime: 0cancelQueriesreferences/query-patterns.mduseQueryuseMutationreferences/db-patterns.mddefaultValuesasyncDebounceMs*.shared.tsreferences/form-patterns.mdcreateFormHookdeclare module '@tanstack/react-router' { interface Register { router: typeof router } }LinkuseNavigateuseParamsunknownawaitPromise.allnotFound()redirect()Errorreferences/router-patterns.mddefaultPreloadscrollRestorationcreateServerFnvalidator()fetchawaitprefetchQuerySuspensereferences/start-patterns.mdpnpm run typecheckpnpm run test