skills/mine/tanstack/SKILL.md
TanStack Query, Router, and Form patterns for React. Use when writing useQuery/queryOptions, mutations, caching, file-based routes, search params, loaders, or TanStack Form validation. Don't use for TanStack Start, TanStack DB/collections, Zustand client state, or non-TanStack routing.
npx skillsauth add pedronauck/skills tanstackInstall 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.
Read the reference matched by the API or behavior being changed. Load adjacent references only for concerns the change crosses; reuse relevant context already read.
| When you are… | Reference |
| --- | --- |
| Defining or changing query keys / factories | references/query-keys.md |
| Setting staleTime, gcTime, invalidation, placeholder/initial data | references/query-caching.md |
| Writing mutations, optimistic updates, or mutation state | references/query-mutations.md |
| Prefetching, parallel queries, infinite queries, or cancellation | references/query-fetch-patterns.md |
| SSR dehydrate/hydrate, offline networkMode, or query persistence | references/query-ssr-offline.md |
| Query error boundaries or select/performance | references/query-errors-performance.md |
| Registering the router, from typing, virtual routes, or router defaults | references/router-type-and-org.md |
| Route loaders, ensureQueryData, or parallel route loading | references/router-data-loading.md |
| Search params, Link/navigate, route masks, or preload | references/router-search-nav.md |
| Lazy routes, not-found, route context, or auth beforeLoad | references/router-split-errors-context.md |
| TanStack Form hooks, Zod validators, or field components | references/form.md |
Apply the technical rules relevant to the changed behavior.
Query — array keys that include every dependency; reconcile mutations through canonical keys: update from authoritative responses or invalidate when the owning read model requires a server reread; optimistic cache writes need rollback; never put non-serializable values in keys.
Router — register the router type; validate search with defaults (.catch()); use ensureQueryData in loaders when pairing with Query; throw redirect(...) not return.
Form — complete defaultValues for inference; Zod at form/field level; debounce async validators to fit endpoint cost and interaction needs; role="alert" on field errors; preventDefault on submit.
testing
Assess DDD fit; discover domains with EventStorming, define language and bounded contexts, and design aggregates, value objects, events, and repositories. Excludes architecture-only audits, product specs, and CQRS/Event Sourcing catalogs.
development
Build terminal UIs with ratatui following 2026 Rust best practices. Use when: (1) Creating new TUI apps, (2) Adding widgets/layouts, (3) Keyboard navigation/state management, (4) Image integration via ratatui-image, (5) Async event handling, (6) Release optimization. Covers v0.30.0+ API, Elm Architecture, StatefulWidget, color-eyre.
development
Find 10x product opportunities and high-leverage improvements. Use when user wants strategic product thinking, mentions '10x', wants to find high-impact features, or says 'what would make this 10x better', 'product strategy', or 'what should we build next'.
development
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.