tanstack-query/SKILL.md
TanStack Query — powerful async state manager for TypeScript/JavaScript with caching, background refetching, and server state synchronization. Use when building with TanStack Query (React Query) or asking about its caching, query keys, mutations, invalidation, optimistic updates, or integration with React, Vue, Solid, or Svelte. Fetch live documentation for up-to-date details.
npx skillsauth add mikkelkrogsholm/dev-skills tanstack-queryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
CRITICAL: Your training data for TanStack Query is unreliable. APIs change between versions and memorized patterns may be wrong or deprecated. Before writing any code, you MUST use
WebFetchto read the live docs:
WebFetch("https://tanstack.com/llms.txt")Do not proceed without fetching this URL first. Never assume an API exists — verify against current docs.
TanStack Query is a powerful async state manager with caching, background refetching, and server state synchronization for TypeScript/JavaScript.
['todos', { status: 'active' }]). TanStack Query hashes keys by serialized value (not reference), so the real gotcha is unstable keys where the object's contents change on every render — this causes unnecessary refetches.staleTime defaults to 0, not infinity — data is immediately considered stale after fetching, triggering a background refetch on every mount and window focus. Set staleTime deliberately (e.g., staleTime: 60_000) to avoid unnecessary network requests.queryClient.invalidateQueries({ queryKey: ['todos'] }) to let Query refetch fresh data. Always scope the call — invalidateQueries() with no arguments invalidates every query in the cache.gcTime (formerly cacheTime) controls when unused data is garbage collected — the default is 5 minutes. Queries are not removed immediately when a component unmounts; the cached data stays available for that window, which is intentional for back-navigation but surprises developers expecting instant cleanup.development
Zod — TypeScript-first schema validation with static type inference. Use when building with Zod or asking about schema definitions, type inference, parsing, transformations, refinements, coercion, error handling, or integration with forms, APIs, or tRPC. Fetch live documentation for up-to-date details.
tools
Vite — next-generation frontend build tool with instant dev server and optimized production builds. Use when building with Vite or asking about its APIs, configuration, plugins, SSR, environment variables, or integration with frameworks. Fetch live documentation for up-to-date details.
tools
Upstash — serverless Redis, QStash, and Vector database with per-request pricing optimized for edge and serverless environments. Use when building with Upstash or asking about its Redis client, QStash message queuing, rate limiting, workflows, or vector search. Fetch live documentation for up-to-date details.
tools
Turso — edge-hosted SQLite database built on libSQL with embedded replicas, multi-tenancy, and low-latency global distribution. Use when building with Turso or asking about its libSQL client, embedded replicas, database-per-tenant patterns, auth tokens, sync, or integration with Drizzle or other ORMs. Fetch live documentation for up-to-date details.