What problem does it solve? Managing asynchronous server state in React with raw useEffect and useState leads to duplicated requests, stale caches, and brittle loading logic. This Skill provides production-grade TanStack Query patterns for declarative data fetching, cache invalidation, and Next.js App Router integration. ## Core Features & Use Cases - Query Patterns: Custom hook abstractions, strictly typed array-based query keys, and query key factories for large applications. - Mutations & Optimistic Updates: useMutation implementations with cache invalidation, optimistic UI updates, and rollback on failure. - Next.js SSR Integration: QueryClient provider setup, server-side prefetching, and HydrationBoundary-based dehydration for App Router. - Use Case: When refactoring a Next.js page that fetches posts via useEffect, use this Skill to convert it into a prefetched server component with a hydrated client-side useQuery hook and proper staleTime configuration. ## Quick Start Refactor my Next.js page that fetches user data with useEffect into a TanStack Query custom hook with server-side prefetching and hydration.