Tanstack Query Best Practices
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.
Install
npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-query-best-practicesgit clone --depth 1 https://github.com/DeckardGer/tanstack-agent-skills.git /tmp/tanstack-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/tanstack-agent-skills/skills/tanstack-query ~/.claude/skills/tanstack-query-best-practicesPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# 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 | Priority | Category | Rules | Impact | |----------|----------|-------|--------| | CRITICAL | Query Keys | 5 rules | Prevents cache bugs and data inconsistencies | | CRITICAL | Caching | 5 rules | Optimizes performance and data freshness | | HIGH | Mutations | 6 rules | Ensures data integrity and UI consistency | | HIGH | Error Handling | 3 rules | Prevents poor user experiences | | MEDIUM | Prefetching | 4 rules | Improves perceived performance | | MEDIUM | Parallel Queries | 2 rules | Enables dynamic parallel fetching | | MEDIUM | Infinite Queries | 3 rules | Prevents pagination bugs | | MEDIUM | SSR Integration | 4 rules | Enables proper hydration | | LOW | Performance | 4 rules | Reduces unnecessary re-renders | | LOW | Offline Support | 2 rules | Enables offline-first patterns | ## Quick Reference ### Query Keys (Prefix: `qk-`) - `qk-array-structure` — Always use arrays for query keys - `qk-include-dependencies` — Include all variables the query depends on
Details
- Skill name
tanstack-query-best-practices- Repository
- DeckardGer/tanstack-agent-skills
- Path
skills/tanstack-query/SKILL.md- License
- MIT
- Repo updated
- 9 September 2026
FAQ
What does the Tanstack Query Best Practices skill do?
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.
How do I install the Tanstack Query Best Practices skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-query-best-practices. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Tanstack Query Best Practices popular?
It lives in DeckardGer/tanstack-agent-skills, which has 230 GitHub stars and 19 forks.
Related skills
Tanstack Integration Best Practices
230DeckardGer/tanstack-agent-skills
Best practices for integrating TanStack Query with TanStack Router and TanStack Start. Patterns for full-stack data flow, SSR, and caching coordination.
Tanstack Router Best Practices
230DeckardGer/tanstack-agent-skills
TanStack Router best practices for type-safe routing, data loading, search params, and navigation. Activate when building React applications with complex routing needs.
Tanstack Start Best Practices
230DeckardGer/tanstack-agent-skills
TanStack Start best practices for full-stack React applications. Server functions, middleware, SSR, authentication, and deployment patterns. Activate when building full-stack apps with TanStack Start.
Pinia
398JetBrains/skills
Pinia official Vue state management library, type-safe and extensible. Use when defining stores, working with state/getters/actions, or implementing store patterns in Vue apps.
Unocss
398JetBrains/skills
UnoCSS instant atomic CSS engine, superset of Tailwind CSS. Use when configuring UnoCSS, writing utility rules, shortcuts, or working with presets like Wind, Icons, Attributify.
Nuxt
398JetBrains/skills
Nuxt full-stack Vue framework with SSR, auto-imports, and file-based routing. Use when working with Nuxt apps, server routes, useFetch, middleware, or hybrid rendering.
Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.