Audit React Query usage for best practices — key factories, staleTime, mutations, and server state ownership
61
73%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/react-query-best-practices/SKILL.mdArguments:
User arguments: $ARGUMENTS
This codebase uses React Query (TanStack Query) as the single source of truth for all server state. All query hooks live in hooks/queries/. Zustand is used only for client-only UI state. Server data must never be duplicated into useState or Zustand outside of mutation callbacks that coordinate cross-store state.
Read these before analyzing:
hooks/queries/ must have a hierarchical key factory with an all root keylists, details) for prefix invalidationqueryFn must forward signal for request cancellationstaleTime (default 0 is almost never correct), assigned from a named exported constant — never an inline numeric literal. A server-side prefetch hydrating the same query key must import and reuse that constant instead of restating the numberkeepPreviousData / placeholderData only on variable-key queries (where params change), never on static keysenabled to prevent queries from running without required paramsonSettled (not onSuccess) for cache reconciliation — it fires on both success and erroronMutate, roll back in onErrorentityKeys.lists()) not broad (entityKeys.all) when possibleuseCallback deps — .mutate() is stablesetQueryData is for optimistic updates onlystaleTime: Infinity417ae20
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.