tanstack-query-expert
Skill by sickn33
Guides developers on TanStack Query (React Query) for data fetching, caching, mutations and Next.js App Router integration. Aimed at React and Next.js developers building async state layers.
Install tanstack-query-expert
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/tanstack-query-expert ~/.claude/skills/tanstack-query-expertRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/tanstack-query-expert ~/.gemini/antigravity-cli/skills/tanstack-query-expertAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install tanstack-query-expert in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill acts as a TanStack Query (formerly React Query) expert for React and Next.js applications. It covers declarative data fetching with custom hooks, array-based query keys, staleTime, gcTime and retry settings, and useMutation with cache invalidation. It also explains optimistic updates with rollback and server prefetching with HydrationBoundary in the Next.js App Router.
The skill is written as guidance with code examples that use the v5 object API and TypeScript types. It sets out rules such as avoiding useEffect for fetching, scoping keys to tenant or user, and not dehydrating secrets or other users' data. It is intended for developers who want a production-grade async state layer in React or Next.js, and it notes that examples assume a single mutation for optimistic updates.
Written from the project's SKILL.md and checked against it.
What it can do
- Data fetching hooksWraps useQuery calls in custom hooks with typed fetchers and query keys.
- Query key factoriesUses array-based, strictly typed query keys for lists, filters and details.
- Cache timingExplains configuring staleTime, gcTime and retry behavior globally or per query.
- MutationsWrites useMutation hooks for POST, PUT and DELETE requests with cache invalidation.
- Optimistic updatesUpdates the cache before the server responds and rolls back if the request fails.
- Next.js App Router setupProvides a client QueryClientProvider with default query options.
- Server prefetchingPrefetches data on the server and hydrates client components with dehydrate.
- TroubleshootingCovers fetch loops and the difference between staleTime and gcTime.
What you need
- React
- Next.js App Router, for the SSR integration examples
- TanStack Query v5
Try asking
- Refactor this useEffect data fetch to use a TanStack Query custom hook.
- Add an optimistic update with rollback to my todo mutation using TanStack Query.
- Prefetch posts on the server in my Next.js App Router page and hydrate the client.
Good to know
- Examples target the TanStack Query v5 object API.
- Optimistic update examples assume a single mutation; concurrent mutations need reconciliation.
- Not a substitute for environment-specific validation, testing, or expert review.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/tanstack-query-expert/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md10 KB
Alternatives to tanstack-query-expert
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
tanstack-query-expert: common questions
Does this skill cover Next.js App Router?
Yes. It includes a client provider setup and server prefetching with HydrationBoundary and dehydrate.
What is the default staleTime in TanStack Query?
The source says the default staleTime is 0, so a background refetch happens on every component remount by default.
What is the difference between staleTime and gcTime?
staleTime controls when a background refetch is triggered, while gcTime controls how long inactive data stays in memory after a component unmounts.
How do I install tanstack-query-expert?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is tanstack-query-expert free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is tanstack-query-expert safe to use?
It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to tanstack-query-expert?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
