tanstack-query-best-practices
๐ฏSkillfrom deckardger/tanstack-agent-skills
Provides TanStack Query best practices for data fetching, caching, mutations, and server state management in React applications
Overview
TanStack Query Best Practices is a skill from the TanStack Agent Skills collection that provides comprehensive guidelines for data fetching, caching, mutations, and server state management using TanStack Query (React Query). It includes 32+ rules across 8 categories with priority-based organization from critical to low importance.
Key Features
- Query Key Best Practices - Provides critical-priority rules for proper key structure and organization to prevent cache collisions and ensure correct data invalidation
- Caching Strategy - Covers staleTime, gcTime, and invalidation patterns with critical-priority guidance for optimal data freshness and performance
- Mutation Patterns - Includes high-priority rules for optimistic updates, error handling, and mutation lifecycle management
- SSR Integration - Provides medium-priority guidance for hydration and dehydration patterns when using server-side rendering
- Companion Skills - Part of a 4-skill collection also covering TanStack Router, TanStack Start, and integration patterns between all three libraries
Who is this for?
This skill is designed for React developers building data-driven applications with TanStack Query who want AI-assisted guidance on caching strategies, query organization, and state management patterns. It is ideal for teams adopting TanStack Query who need consistent, priority-ranked best practices for data fetching, prefetching, infinite queries, and performance optimization.
Same repository
deckardger/tanstack-agent-skills(4 items)
Installation
npx vibeindex add deckardger/tanstack-agent-skills --skill tanstack-query-best-practicesnpx skills add deckardger/tanstack-agent-skills --skill tanstack-query-best-practices~/.claude/skills/tanstack-query-best-practices/SKILL.mdSKILL.md
More from this repository3
Best practices for building applications with TanStack Start, covering routing, data loading, server functions, and SSR patterns.
Provides TanStack Router best practices for building type-safe routing in React applications, covering route configuration, code splitting, and navigation patterns.
TanStack integration best practices covering TanStack Query, Router, and Start with structured guidelines across 32+ rules for data fetching, caching, and state management.