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.
npx agentmods add skills/rungchan2/frontend-skills/tanstack-querynpx skills add rungchan2/frontend-skills --skill tanstack-querygit clone --depth 1 https://github.com/rungchan2/frontend-skillsWrote 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.
[](https://agentmods.dev/skills/rungchan2/frontend-skills/tanstack-query)<a href="https://agentmods.dev/skills/rungchan2/frontend-skills/tanstack-query"><img src="https://agentmods.dev/badge/skills/rungchan2/frontend-skills/tanstack-query.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00148 | $0.00931 |
| Opus 5 | $0.00074 | $0.00465 |
| Sonnet 5 | $0.00030 | $0.00186 |
| Haiku 4.5 | $0.00015 | $0.00093 |
Grade A, and why
tanstack-query 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TanStack Query 표준 setup
새 프로젝트에 React Query 인프라 3개를 한 번에 깐다.
왜 이 3개를 묶는가
| 파일 | 역할 |
|---|---|
lib/query-defaults.ts |
staleTime/gcTime 같은 캐시 정책 — 컴포넌트마다 다르면 동작 예측 불가 |
lib/query-keys.ts |
도메인별 queryKey 팩토리 — invalidate prefix 매칭 깨짐 방지 |
providers/query-provider.tsx |
QueryClient lifecycle 관리 + devtools — SSR 안전 |
이 셋이 합쳐져야 "캐시가 의도대로 동작하는" 환경이 된다.
워크플로우
1. 패키지 설치
pnpm add @tanstack/react-query
pnpm add -D @tanstack/react-query-devtools
2. 위치 결정
| 구조 | 파일들 |
|---|---|
src/ |
src/lib/query-defaults.ts, src/lib/query-keys.ts, src/providers/query-provider.tsx |
| 루트 | lib/query-defaults.ts, lib/query-keys.ts, providers/query-provider.tsx |
3. 파일 생성
| asset | 대상 위치 |
|---|---|
query-defaults.ts |
lib/query-defaults.ts |
query-keys.ts |
lib/query-keys.ts |
query-provider.tsx |
providers/query-provider.tsx |
4. 루트 layout에 Provider 적용
app/layout.tsx에 <QueryProvider> 래핑:
import { QueryProvider } from "@/providers/query-provider"
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="ko">
<body>
<QueryProvider>{children}</QueryProvider>
</body>
</html>
)
}
기존 layout이 있다면 안전하게 children만 감싸도록 편집한다.
5. queryKey 도메인 채우기 안내
assets/query-keys.ts는 users 예시만 있고 posts는 주석. 사용자에게:
"주요 도메인이 뭔가요? (예: posts, comments, projects). 알려주시면 query-keys.ts에 미리 박아드립니다. 일단 지금은 users만 들어가 있어요."
도메인 받으면 같은 패턴으로 추가.
6. CLAUDE.md 사용 규칙 (선택)
## React Query 사용 규칙
- 모든 useQuery/useMutation은 `lib/query-keys.ts`의 키만 사용. 인라인 배열 금지.
- 이유: invalidate 시 prefix 매칭 정합성 보장.
- staleTime/gcTime은 개별 훅에서 오버라이드하지 않는다. 짧은 캐시는 SHORT_CACHE_CONFIG, 실시간은 REALTIME_CONFIG 사용.
- 새 도메인이 생기면 query-keys.ts에 먼저 추가하고 훅 작성.
산출물
lib/query-defaults.ts,lib/query-keys.tsproviders/query-provider.tsxapp/layout.tsx에 Provider 적용- (선택) CLAUDE.md 사용 규칙
비-목표
- 이 스킬은 개별 useQuery 훅을 만들지 않는다. 인프라만 깐다.
- SWR과 병행 사용 권장하지 않음 — 클라이언트 캐싱 도구는 하나로 통일.
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 5d ago First seen · 94 lines · 148 tokens per session scan A 8b6b1ae3cfad
tanstack-query is a skill published in the GitHub repository rungchan2/frontend-skills (2 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 148 tokens to every session and 931 once invoked, about $0.0007 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-08-31.
Other skills, from other repositories
v8-jit
V8 JIT optimization patterns for writing high-performance JavaScript in Next.js server internals. Use when writing or reviewing hot-path code in app-render, stream-utils, routing, caching, or any per-request code path. Covers hidden classes / shapes, monomorphic call sites, inline caches, megamorphic deopt, closure…
chakra-ui-builder
Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…
material-ui-tailwind
Integrates Material UI with Tailwind CSS v4 using cascade layers (enableCssLayer, @layer order) and documents Tailwind v3 interoperability (preflight, important, injectFirst, portals). Use when combining MUI with Tailwind utilities, slotProps className, or theme token bridges.
verify
Use when you want to validate changes before committing, or when you need to check all React contribution requirements.
r3f-best-practices
React Three Fiber (R3F) and Poimandres ecosystem best practices. Use when writing, reviewing, or optimizing R3F code. Triggers on tasks involving @react-three/fiber, @react-three/drei, zustand, @react-three/postprocessing, @react-three/rapier, or leva.
git-safety
Git safety rules. INVOKE WHEN: git push, force push, git reset, git clean, destructive git, push force, reset hard. NEVER force push or do destructive git operations.