
Tanstack Query Best Practices
This is a comprehensive reference for TanStack Query patterns organized into 38 rules across ten categories, from critical query key management to offline support. It covers the stuff that trips people up: query key factories, optimistic updates with rollback context, when to use placeholderData versus initialData, and proper SSR hydration patterns. Each rule follows a consistent format with bad and good examples. The priority system is helpful, putting query keys and caching at critical because those are where the hardest bugs come from. If you're building a data-heavy React app and tired of cache invalidation gotchas or wondering why your mutations aren't updating the UI correctly, this gives you the patterns to get it right.
- skills.sh installs
- 13.2K
- GitHub stars
- 230
- last updated
- Aug 21, 2026
Install
$ npx -y skills add deckardger/tanstack-agent-skills --skill tanstack-query-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
TanStack Query Best Practices
Comprehensive guidelines for implementing TanStack Query (React Query) patterns in React applications. These rules optimize data fetching, caching, mutations, and server state synchronization.
When to Apply
- Creating new data fetching logic
- Setting up query configurations
- Implementing mutations and optimistic updates
- Configuring caching strategies
- Integrating with SSR/SSG
- Refactoring existing data fetching code
Rule Categories by Priority
Sponsors
Details
- Repository
- github.com/deckardger/tanstack-agent-skills
- Categories
- Frontend Development, Backend & APIs, AI & Agent Building