What problem does it solve? React applications often suffer from cache inconsistencies, stale data, unnecessary network requests, and poorly handled mutations when server state is managed ad hoc. This Skill provides a structured rule set for TanStack Query that prevents common bugs in query keys, caching, mutations, and SSR hydration. ## Core Features & Use Cases - Query Key Standards: Enforces array-based, hierarchical, serializable query keys with factory patterns for type-safe invalidation. - Caching & Mutation Rules: Covers staleTime/gcTime tuning, targeted invalidation, optimistic updates with rollback, and cross-component mutation tracking via useMutationState. - Advanced Patterns: Includes guidance on infinite queries, parallel fetching with useQueries, SSR dehydration/hydration, prefetching on user intent, and offline persistence. - Use Case: When building a paginated product list with optimistic cart updates in a Next.js app, apply the rules to structure query keys hierarchically, prefetch on hover, and roll back cache changes on mutation errors. ## Quick Start Ask the AI to review your React data fetching code against TanStack Query best practices and fix any query key, caching, or mutation issues it finds.