TanStack Query best practices skill (deckardger) for Claude Code
Gives Claude 38 rules for TanStack Query (React Query): query keys, caching, mutations, prefetching and server rendering.
- Installs
- 13K
- on skills.sh
- Stars
- 228
- on GitHub
- Files
- 38
- besides SKILL.md
- Updated
- Sep 2026
- last repo commit
This skill makes Claude follow a set of TanStack Query (React Query) rules when you write or review data fetching code. SKILL.md lists 38 rules in 10 categories, from query keys and caching to mutations, prefetching, infinite queries, SSR and offline support. Each category has a priority from CRITICAL to LOW.
Every rule has its own file in rules/ with an explanation, a bad example, a good example and when to apply it. The folder is SKILL.md plus 38 Markdown rule files. The README still says 32+ rules across 8 categories; this page uses SKILL.md and the folder's 38 rule files.
Good for
- React developers fetching server data with useQuery and useMutation
- Teams reviewing data fetching code for cache bugs and slow renders
- Anyone setting up prefetching or server-side rendering with Query
Install tanstack-query-best-practices
Claude Code
- 1
Copy this prompt.
Install the tanstack-query-best-practices skill in Claude Code. Run this command: npx skills add https://github.com/deckardger/tanstack-agent-skills --skill tanstack-query-best-practices Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
TanStack Query (React Query) best practices for data fetching, caching, mutations, and server state management. Activate when building data-driven React applications with server state.
Sections in SKILL.md
- When to Apply
- Rule Categories by Priority
- Quick Reference
- Query Keys (Prefix: qk-)
- Caching (Prefix: cache-)
- Mutations (Prefix: mut-)
- Error Handling (Prefix: err-)
- Prefetching (Prefix: pf-)
- Infinite Queries (Prefix: inf-)
- SSR Integration (Prefix: ssr-)
- Parallel Queries (Prefix: parallel-)
- Performance (Prefix: perf-)
- Offline Support (Prefix: offline-)
- How to Use
- Full Reference
Key facts
- Author
- DeckardGer (deckardger)
- Repository
- deckardger/tanstack-agent-skills
- License
- MIT (crawl data)
- Installs on skills.sh
- 12,973 (Nov 2, 2026)
- GitHub stars (repo)
- 228 (Nov 2, 2026)
- Last repo commit
- Sep 9, 2026
What it includes
Array keys, dependencies, hierarchy, key factories and serializable parts.
Query Keys (5, CRITICAL)staleTime, gcTime, defaults, targeted invalidation, placeholder vs initial data.
Caching (5, CRITICAL)Invalidate after writes, optimistic updates, rollback context and loading states.
Mutations (6, HIGH)Error boundaries, retry settings and fallback data.
Error Handling (3, HIGH)Prefetch on intent or route change, set staleTime, use ensureQueryData.
Prefetching (4, MEDIUM)useQueries for dynamic lists, and query cancellation.
Parallel Queries (2, MEDIUM)getNextPageParam, loading guards and maxPages.
Infinite Queries (3, MEDIUM)Dehydrate and hydrate, a client per request, server staleTime, HydrationBoundary.
SSR Integration (4, MEDIUM)select transforms, structural sharing, notifyOnChangeProps, placeholderData.
Performance (4, LOW)Network mode and query persistence.
Offline Support (2, LOW)
From the official docs
Questions
How do I install the TanStack Query skill?
Use the install box above, which installs this one skill. The README's own command is npx skills add DeckardGer/tanstack-agent-skills, which installs all four skills in the repo.
What else is in the repo?
The README lists tanstack-query, tanstack-router, tanstack-start and tanstack-integration. It describes tanstack-integration as best practices for using Query with Router and Start together.
Does it run any code?
No. The folder is Markdown only, with SKILL.md and 38 rule files.
Is it official TanStack guidance?
The skill lives in deckardger/tanstack-agent-skills. The README does not say it comes from the TanStack team.
Is it safe to install?
The folder holds only Markdown files, so installing adds instructions only. Claude may change your data fetching code when you ask for a review or fix, so check the diff.
Which version of TanStack Query does it target?
SKILL.md does not state a version. Check a rule's good example against the version you use.
Information
updated Nov 2, 2026
- Repository
- deckardger/tanstack-agent-skills
- Folder
skills/tanstack-query
Sources
Docs, issue trackers and discussions this page is built from.
Show all 4Hide
- tanstack-query SKILL.md · github.com
- deckardger/tanstack-agent-skills README · github.com
- skills.sh listing · skills.sh
- Repository · github.com