ワンクリックで
react-query-best-practices
Audit React Query usage for best practices — key factories, staleTime, mutations, and server state ownership
メニュー
Audit React Query usage for best practices — key factories, staleTime, mutations, and server state ownership
Review UI code for alignment with the emcn design system — components, tokens, patterns, and conventions
Create or update a Sim integration block with correct subBlocks, conditions, dependsOn, modes, canonicalParamId usage, outputs, and tool wiring. Use when working on `apps/sim/blocks/blocks/{service}.ts` or aligning a block with its tools.
Audit an existing Sim integration against the service API docs and repository conventions, then report and fix issues across tools, blocks, outputs, OAuth scopes, triggers, and registry entries. Use when validating or repairing a service integration under `apps/sim/tools`, `apps/sim/blocks`, or `apps/sim/triggers`.
Add a complete Sim integration from API docs, covering tools, block, icon, optional triggers, registrations, and integration conventions. Use when introducing a new service under `apps/sim/tools`, `apps/sim/blocks`, and `apps/sim/triggers`.
Add a code-defined table enrichment (registry entry) under `apps/sim/enrichments/` backed by an ordered provider cascade, ensuring every provider tool it calls has hosted-key support. Use when adding a per-row table enrichment that fills cells via existing Sim tools.
Add hosted API key support to a tool so Sim provides the key (metered and billed to the workspace) when a user has not brought their own. Use when adding a `hosting` config to a tool under `apps/sim/tools/{service}/`.
| name | react-query-best-practices |
| description | Audit React Query usage for best practices — key factories, staleTime, mutations, and server state ownership |
Arguments:
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)keepPreviousData / 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: Infinity