Install
$ agentstack add skill-mblauberg-provenant-tanstack-query ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
TanStack Query
Design TanStack Query as a server-state boundary, not a fetch-hook convenience. This skill targets @tanstack/react-query v5. Confirm the installed major and framework adapter before changing APIs; use current official documentation for version-sensitive behaviour.
Core rules
- Query keys are top-level arrays, JSON-serialisable and complete: include every
input that can change the returned data. Centralise families without hiding their hierarchy.
- Co-locate
queryKeyandqueryFnwithqueryOptions; reuse that contract for
hooks, prefetching, invalidation and cache updates.
- Query functions throw/reject on failure and consume the supplied
AbortSignal
when the transport supports cancellation.
- Choose
staleTimefrom data semantics. ChoosegcTimefrom inactive-cache
retention needs. Do not suppress focus/reconnect refetches to conceal a poor freshness policy.
- Prefer targeted invalidation after mutations. Use
setQueryDataonly when the
response is canonical for the exact cached shape.
- Optimistic UI through mutation variables is simpler than cache mutation. If
updating the cache, cancel matching queries, snapshot, update immutably, restore on error and invalidate on settlement.
- Keep initial loading, background fetching, empty data and errors distinct.
Never blank usable data merely because isFetching is true.
- Avoid serial request waterfalls: start independent queries together and
prefetch at route or intent boundaries where evidence justifies it.
- Create a request-scoped
QueryClientfor SSR. Never share a server cache
between users. Hydrate only serialisable, authorised data.
- Tests receive a fresh
QueryClient, disabled retries for error cases and
network behaviour exercised at the public boundary.
Workflow
- Inventory query clients, key families, option factories, mutation effects,
SSR boundaries and existing tests.
- State freshness, invalidation, concurrency and error invariants before code.
- Implement through
tdd; loadtypescript-clean-codefor type boundaries and
react-performance only for broader React/Next.js performance.
- Run tests, typecheck and the TanStack Query ESLint plugin where installed.
- Review with [review-checklist.md](references/review-checklist.md).
Load [patterns.md](references/patterns.md) for implementation patterns and [sources.md](references/sources.md) for the official source map and provenance.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: mblauberg
- Source: mblauberg/provenant
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.