React Query
TanStack Query v5 best practices, code review, and coding standards
/plugin install react-query@rvanbaalen When to use
Use whenever you’re writing or reviewing code that uses TanStack Query v5. The skill catches common anti-patterns, enforces best practices, and helps migrate from v4 patterns.
How it works
Operates in two modes:
Review mode
Audits existing code for critical issues and anti-patterns:
- Server state copied to client state (
useState+useEffectthat copies query data) fetch()withoutresponse.okchecking- Cache mutation via
setQueryDatawithout returning new references - Missing invalidation in
onSettled gcTimelower thanstaleTime- Scattered inline query keys instead of
queryOptionsfactories
Coding mode
Enforces strict v5 patterns when writing new code:
queryOptionsfactories for type-safe, reusable query definitions- Proper query key hierarchies
- Correct mutation callback separation
- Suspense integration with React 19
Invoke
/rvanbaalen:react-query
Also auto-triggers when it detects @tanstack/react-query imports in your code.