What problem does it solve? React applications often suffer from cache inconsistencies, unnecessary network requests, stale UI data, and poorly handled mutations when server state is managed ad hoc. This Skill provides a structured rule set for TanStack Query (React Query) that prevents these bugs and standardizes data fetching across a codebase. ## Core Features & Use Cases - Query Key and Caching Rules: Enforces array-based hierarchical query keys, staleTime/gcTime tuning, targeted invalidation, and QueryClient-level defaults. - Mutation Patterns: Covers optimistic updates with rollback context, error handling, loading states via isPending, and cross-component tracking with useMutationState. - Advanced Scenarios: Includes rules for infinite queries, parallel fetching with useQueries, SSR dehydration/hydration, prefetching on user intent, offline network modes, and cache persistence. - Use Case: When building a paginated product list with optimistic cart updates in a React app, apply the infinite query, placeholderData, and optimistic update rules to avoid pagination bugs and stale cart state. ## Quick Start Ask the AI to review your React data fetching code against the TanStack Query best practices rules and fix any caching or mutation issues it finds.