tanstack-query
Skill15 starsChanged 15 days agoMITView on GitHub
Implement, debug, or review modern TanStack Query code using the installed @tanstack query package and adapter. Use for query keys/options, cache freshness, invalidation, cancellation, retries, network modes, mutations and optimism, offline persistence, infinite queries, tracked properties, selectors, adapter-specific APIs, SSR/hydration, or Router/Start integration. Inspect the resolved adapter, core, framework peers, and declarations before choosing syntax. Compose with react only for React-owned work and test when evidence is requested or affected. Do not use for general client state or generic fetch/MSW work without Query behavior.
19 other projects use a version of this.
Adopted by
Most recently taken up by
- yuan-alex/cedartheir own version, first seen Nov 8, 2026
- thongdn-it/react-agent-skillstheir own version, first seen Nov 1, 2026
- louisbrulenaudet/monorepo-templatetheir own version, first seen Oct 29, 2026
- Firzus/agent-skillstheir own version, first seen Oct 23, 2026
- LaoitdevOpen/laoitdev-skillstheir own version, first seen Oct 20, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
Used with
Projects with it also use tanstack-router, tanstack-form and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Aver005Skilltanstack-router
Build type-safe, file-based React routing with TanStack Router. Supports client-side navigation, route loaders, and TanStack Query integration. Prevents 20 documented errors including validation structure loss, param parsing bugs, and SSR streaming crashes.
Also in 10 projects that use this
heryTzSkilltanstack-form
Create or modify forms using TanStack Form's composition API. Uses formOptions() as the form shape primitive, withForm HOC for decomposing large forms into sections, withFieldGroup for reusable field groups across forms, Zod for validation, and i18n-prefixed error messages. Use when creating or modifying forms in the web app.
Also in 3 projects that use this
JasonPaffSkilltanstack-table
Build headless data tables with TanStack Table v8. Server-side pagination, filtering, sorting, and virtualization for Cloudflare Workers + D1. Prevents 12 documented errors.
Also in 3 projects that use this
SentrySkillreview
Fixture review skill.
Also in 3 projects that use this
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- Kiranism/next-shadcn-dashboard-starter★ 7.2ksame name
- modrinth/code★ 2.5ksame name
- operately/operately★ 618same name
- Mindrally/skills★ 275same name
- TangleML/tangle-ui★ 104same name
- PyModel/react-frontend-skills★ 23same name
- louisbrulenaudet/monorepo-template★ 19same name
- thongdn-it/react-agent-skills★ 5same name
- Firzus/agent-skills★ 4same name
- dvaJi/argos★ 3same name
9 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- analyze-repoSkill
- architectSkill
- codebase-designSkill
- code-reviewSkill
- commitSkill
- create-prSkill
- create-verification-skillSkill
- debugSkill
- frontendSkill
- implementSkill
- mswSkill
- playwrightSkill
- react-hook-form-auditSkill
- react-hook-formSkill
- reactSkill
- refactorSkill
- researchSkill
- resolving-merge-conflictsSkill
- specSkill
- tailwindSkill
- testSkill
- typescriptSkill
- zodSkill
- auditSkill
- neovimSkill
- shell-envSkill
- teachSkill
- tilSkill
- atomic-note-to-mocSkill
- close-daySkill
- create-noteSkill
- goalsSkill
- import-goodreadsSkill
- import-meetingsSkill
- ingestSkill
- memory-recallSkill
- process-inboxSkill
- projectSkill
- save-sessionSkill
- todays-focusSkill
- vault-auditSkill
- vaultSkill
- weekly-reviewSkill
- careerSkill
- check-communicationSkill
- deslopifySkill
- standupSkill
- blogSkill
- broSkill
- docsSkill
- talkSkill
- tweet-todaySkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Treat Query as a synchronization layer for remotely owned asynchronous state.
- Distinctive: line 33
Use Query for server-owned snapshots that can become stale.
- Distinctive: line 69
Use existing runtime validation in the transport/API layer before data enters the cache.
- Distinctive: line 78
Run the narrowest typecheck, lint, and tests that cover the changed behavior, then repository checks.
- Very specific: line 92
Freshness: use a known resource policy.
- Very specific: line 93
Use gcTime only for inactive retention.
- Distinctive: line 94
Reconciliation: update from an authoritative response or invalidate the resources made stale.
- Distinctive: line 96
Optimism: prefer a local pending preview.
- Distinctive: line 100
Observation: use tracked properties and structural sharing first.
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TanStack Query
Treat Query as a synchronization layer for remotely owned asynchronous state. Model the resource, its cache identity, and how truth is restored before choosing a hook or client method.
Workflow
1. Detect the installed boundary
Inspect manifests, lockfiles, imports, configuration, and resolved declarations. Record the adapter,
its exact version, the separately resolved @tanstack/query-core, framework peer version, and any
router, SSR, hydration, persistence, devtools, or lint integration. Current documentation describes
current releases; installed exports and types decide which capabilities this project can use.
Complete when: the adapter/core/peer boundary and nearby project conventions are known.
2. Name the state owner
Use Query for server-owned snapshots that can become stale. Keep ephemeral UI state, URL state, forms, and editable drafts with their existing owners. Derive UI validity from query data where possible; preserve a local draft when the user intentionally edits a snapshot.
Complete when: each changed value has one owner and Query has a reason to participate.
3. Define the resource contract
For every read, identify the resource, every result-changing input, canonical cached shape, cancellation path, error boundary, and known freshness requirement. When freshness is unspecified, preserve existing/project defaults and report the policy gap instead of inventing a duration. For every write, identify affected resources, authoritative response data, completion boundary, list membership/order effects, and concurrency behavior. Keep transport, runtime validation, domain transformation, Query policy, and UI projection as explicit seams.
Complete when: cache identity and the path back to server truth are unambiguous, while unknown policy is preserved and named for its owner.
4. Load the applicable reference
| Priority | Load when | Reference |
| 1 — High | Keys/options, reusable definitions, freshness, retries, network modes, invalidation, disabled/dependent reads, cancellation, transformations, Suspense queries | references/queries-and-cache.md |
| 1 — High | Mutations, callback/promise ownership, invalidation timing, optimistic UI/cache writes, overlapping writes, scopes, paused/offline persistence | references/mutations-and-optimism.md |
| 1 — High | Infinite queries, pagination cursors, tracked properties, select, structural sharing, non-React adapters | references/infinite-rendering-and-adapters.md |
| 1 — High | SSR, hydration, pending dehydration, RSC/cache layers, Router or Start integration | references/ssr-hydration-and-frameworks.md |
| 2 — High | Broken behavior, capability uncertainty, cache/performance review, or adapter/version mismatch | references/debugging-and-review.md |
| 2 — Medium | Tests or executable evidence requested or affected | references/testing.md |
Complete when: each relevant branch is loaded and its examples match installed declarations.
5. Compose at owner seams
- Load
reactfor component ownership, Effects, Suspense/error boundaries, transitions, Context, and rendering behavior. Keep the Query-facing seam here even when React owns the surrounding mechanic. - Load
testwhen tests or executable evidence are requested or affected; use the installed runner. - Use existing runtime validation in the transport/API layer before data enters the cache. Schema selection belongs to that owner; Query should receive typed data or a thrown failure.
- Let Router/Start/Next own route and server mechanics while Query owns its client, observers, keys, freshness, and cache reconciliation.
Complete when: each concern has one owner and the handoff between owners is visible in code.
6. Verify transitions
Run the narrowest typecheck, lint, and tests that cover the changed behavior, then repository checks. Assert outcomes: equal identities share work, changed inputs select another cache entry, cancellation reaches transport, writes restore the intended truth, optimistic overlap does not flash stale data, and hydration/integration uses the intended client and observer.
Report detected versions, cache identities, freshness/invalidation decisions, owner handoffs, checks, and remaining gaps.
Complete when: installed-version syntax passes and each changed transition has evidence.
Guardrails
- Identity: keys include every result-changing input; normal and infinite data use distinct keys.
- Repeatability:
queryFnreturns or throws repeatably; event effects stay with event/mutation owners. - Freshness: use a known resource policy; otherwise preserve defaults and report the unknown.
Use
gcTimeonly for inactive retention. - Reconciliation: update from an authoritative response or invalidate the resources made stale.
- Cancellation: pass
AbortSignalto transport and cancel conflicting reads before cache optimism. - Optimism: prefer a local pending preview; use cache optimism when multiple observers need it and provide overlap-safe rollback/reconciliation.
- Composition: share
queryOptionswhen loaders, hooks, or imperative callers need one identity; keep consumer overrides at the callsite and add hooks only when they own behavior. - Observation: use tracked properties and structural sharing first; select a narrower result when that subscription or transformation is valuable.
- Adapters: transfer core semantics, then verify the adapter's exports, reactive inputs, provider, return shape, peer range, and experimental status.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

