react-query-mutations

Installation
SKILL.md

react-query-mutations

Implements TanStack Query mutations correctly — focused on the optimistic update lifecycle, which is where almost all real mistakes happen.


Phase 1 — Discover

Before writing any mutation:

  • Does this mutation need optimistic updates? (Instant UI feedback before API confirms.) If no, the implementation is trivial — skip to Phase 3B.
  • What query key holds the data being mutated? (Needed for cancel, snapshot, and invalidation.)
  • Is the cache entry a list (add/remove item) or a single record (update in place)? The optimistic update logic differs.
  • Should the UI reflect only the mutation's loading state, or also per-item loading states? (The latter requires storing mutation variables in local state alongside the cache update.)

Phase 2 — The Optimistic Update Lifecycle (and where it breaks)

Installs
2
GitHub Stars
2
First Seen
Apr 22, 2026
react-query-mutations — blunotech-dev/agents