plugins/nextjs-expert/skills/nextjs-tanstack-query/SKILL.md
TanStack Query v5 integration with Next.js 16. Server-side prefetching, hydration, useQuery, useMutation, cache management.
npx skillsauth add fusengine/agents nextjs-tanstack-queryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
TanStack Query v5 provides powerful server state management with Next.js 16 integration.
Before ANY implementation, use TeamCreate to spawn 3 agents:
After implementation, run fuse-ai-pilot:sniper for validation.
| Feature | Benefit | |---------|---------| | Server prefetching | Data ready on first render, no loading flash | | Automatic caching | Deduplication, stale-while-revalidate | | Mutations | Optimistic updates, rollback on error | | DevTools | Visual cache inspection | | TypeScript-first | Full type inference |
prefetchQuery for SSR datastaleTime on prefetched queries - Prevent immediate refetch on mountqueryClient in Client Components directly - Use hooksbun add @tanstack/react-query @tanstack/react-query-devtools
staleTime - Prevent unnecessary refetches after hydrationinvalidateQueries after writesthrowOnError for critical queriesprocess.env.NODE_ENV check| Need | Reference | |------|-----------| | useQuery, useMutation | query-patterns.md | | Server prefetching | hydration.md | | QueryClient setup | hydration.md | | Cache invalidation | query-patterns.md |
development
Use when optimizing entity-based / semantic SEO 2026. Covers entity maps, Google Knowledge Graph resolution, salience scoring, passage-level ranking, about/sameAs/knowsAbout schema, Cloud Natural Language API validation.
development
Use when running SEO, GEO, schema, Core Web Vitals, sitemap, hreflang, E-E-A-T, AI Overviews, technical SEO, or structured data tasks. Covers full-site audits, single-page analysis, schema markup, content quality, AI search optimization, local SEO, sitemap/robots, internal linking, semantic clustering, and search experience.
development
Use when optimizing search experience (SXO). Covers intent matching, user personas, user stories, page-type analysis, dwell time, scroll depth, pogo-sticking prevention.
development
Use when optimizing local SEO. Covers Google Business Profile, NAP consistency, citations, reviews acquisition, Local Pack ranking, location pages, LocalBusiness schema.