tanstack-query-expert

tanstack-query-expert is a skill for Claude Code, Codex from roedyrustam/vibes-plug. It costs 67 tokens per session (2,263 once invoked), scanned A, original, MIT.

A guide to TanStack Query, a library for fetching, caching, updating, and synchronizing server data in React and Next.js applications.

In plain words
What is it for?
It helps implement cached queries, optimistic updates, infinite scrolling, Suspense, server rendering, and type-safe TanStack routes.
Why use it?
It helps avoid scattered data-fetching code and stale or inconsistent screens when remote data changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps implement cached queries, optimistic updates, infinite scrolling, Suspense, server rendering, and type-safe TanStack routes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/roedyrustam/vibes-plug/tanstack-query-expert
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add roedyrustam/vibes-plug --skill tanstack-query-expert
Clone the repo
git clone --depth 1 https://github.com/roedyrustam/vibes-plug

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tanstack-query-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/roedyrustam/vibes-plug/tanstack-query-expert.svg)](https://agentmods.dev/skills/roedyrustam/vibes-plug/tanstack-query-expert)
Your own site
<a href="https://agentmods.dev/skills/roedyrustam/vibes-plug/tanstack-query-expert"><img src="https://agentmods.dev/badge/skills/roedyrustam/vibes-plug/tanstack-query-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,263 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00067 $0.02263
Opus 5 $0.00034 $0.01131
Sonnet 5 $0.00013 $0.00453
Haiku 4.5 $0.00007 $0.00226

Measured 3d ago against content hash 2ef9234584a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tanstack-query-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/tanstack-query-expert/SKILL.md · 206 lines

How it starts

The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TanStack Query Expert (v5 + TanStack Router/Start Edition)

English | Bahasa Indonesia


English

Orchestration & Integration

Connects and orchestrates with relevant domain skills like brainstorming, zero-to-prod-orchestrator, and project-context-mapper to ensure cohesive execution.

Description

Production-grade TanStack Query (v5) mastery for modern React (v18/19) and Next.js (App Router) applications. Covers declarative data fetching, advanced cache invalidation, optimistic UI updates, Suspense boundaries, SSR hydration, and the new TanStack Router + TanStack Start ecosystem for full-stack type-safe applications.

Trigger Conditions

  • Refactoring data fetching logic (replacing useEffect + useState patterns).
  • Designing query key factories (Array-based, strictly typed).
  • Writing useMutation hooks with immediate Optimistic Updates.
  • Implementing Infinite Scrolling (useInfiniteQuery).
  • Using React Suspense with useSuspenseQuery.
  • Integrating TanStack Query with Next.js App Router (Server Components prefetching + Client Boundary hydration).
  • Building type-safe SPAs with TanStack Router (typed routes, route-level loaders).
  • Building full-stack apps with TanStack Start (server functions, RSC-like patterns).

Core Concepts & Rules of Thumb

  • Never use useEffect to fetch data if TanStack Query is available.
  • Never sync query data into local React state (e.g., useEffect(() => setLocalState(data), [data])). Derive state during render instead.
  • Stale != Garbage Collected: staleTime dictates when background refetch triggers. gcTime dictates how long inactive data stays in memory.
  • Always use queryOptions() helper to co-locate query definition and reuse it across components and loaders.

Advanced Query Patterns

1. queryOptions() Helper — The 2026 Best Practice

Co-locate your query definition using queryOptions() to share it between components and route loaders:

import { queryOptions } from '@tanstack/react-query';

export const userQueryOptions = (userId: string) =>
  queryOptions({
    queryKey: ['users', userId],
    queryFn: () => fetchUser(userId),
    staleTime: 5 * 60 * 1000, // 5 minutes
  });

// In component:
const { data } = useQuery(userQueryOptions(userId));

// In TanStack Router loader:
export const Route = createFileRoute('/users/$userId')({
  loader: ({ context: { queryClient }, params }) =>
    queryClient.ensureQueryData(userQueryOptions(params.userId)),
  component: UserPage,
});

Read the full file on GitHub · 206 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 206 lines · 67 tokens per session scan A 2ef9234584a3

Subscribe to this mod's changes

tanstack-query-expert is a skill published in the GitHub repository roedyrustam/vibes-plug (49 stars, last pushed 3d ago), licensed MIT. It adds 67 tokens to every session and 2,263 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

nextjs-code-review

A code-review assistant for Next.js applications. Next.js is a framework for building React websites and web applications, including pages that run on the server.

sutchan/Agent-Skills-Hub · 72 tokens

component-scaffold

Create a new React component with co-located test, story, and styles. Use when creating new UI components, when asked to scaffold/generate a component, or when building new pages.

zakelfassi/skills-driven-development · 42 tokens

expo

Expert in Expo for React Native development. Covers Expo Router, EAS Build and Submit, development builds, native module integration, and production deployment. Knows how to build cross-platform mobile apps efficiently while maintaining access to native capabilities. Use when "expo, react native, mobile app, eas…

omer-metin/skills-for-antigravity · 86 tokens

frontend

World-class frontend engineering - React philosophy, performance, accessibility, and production-grade interfacesUse when "frontend, react, vue, svelte, next.js, nuxt, component, state management, redux, zustand, client side, spa, ssr, hydration, bundle size, web vitals, accessibility, a11y, responsive, css, tailwind…

omer-metin/skills-for-antigravity · 95 tokens

coding-standards

Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.

Jamkris/everything-gemini-code · 28 tokens

clerk-nextjs-patterns

A collection of implementation patterns for adding Clerk authentication to Next.js applications. Clerk is a service that manages user accounts and login sessions.

sutchan/Agent-Skills-Hub · 41 tokens