원클릭으로
tanstack-query
TanStack Query in React. Use when implementing or reviewing queries, mutations, invalidation, or query hooks.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
TanStack Query in React. Use when implementing or reviewing queries, mutations, invalidation, or query hooks.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | tanstack-query |
| description | TanStack Query in React. Use when implementing or reviewing queries, mutations, invalidation, or query hooks. |
useSuspenseQuery when data is required to render the unit. The component assumes data exists.useQuery when the read is optional, lazy, click-triggered, polling, typeahead, or needs enabled, placeholderData, isFetching, refetch, or previous data.useMutation for writes.Do not use useQuery to hand-roll a page loading state that should be a Suspense fallback.
ALWAYS destructure the result. Never assign the whole hook return to a variable.
const { mutate, isPending } = useMutation(...);
const { data, refetch } = useSuspenseQuery(...);
One visual unit, one read contract.
If a component needs two queries to render the same block:
Customize query options through queryOptions(). Never spread the generated options.
useSuspenseQuery(orpc.status.queryOptions({ staleTime: 30_000 }))
useQuery(
orpc.search.preview.queryOptions(
{ term },
{ enabled: term.length > 2, placeholderData: keepPreviousData },
),
)
Wrong:
useSuspenseQuery({ ...orpc.status.queryOptions(), staleTime: 30_000 })
Invalidate after mutation. Do not default to optimistic setQueryData — server state belongs to the server.
const { mutate } = useMutation(
orpc.tasks.create.mutationOptions({
onSuccess: () => {
queryClient.invalidateQueries(orpc.tasks.list.pathFilter());
},
}),
);
Extract a hook when the mutation is shared, or owns invalidation/toast behavior used in multiple places. Otherwise inline.
The parent mounts <Suspense>, not the component that calls useSuspenseQuery. Each independent visual unit gets its own <ErrorBoundary> + <Suspense> pair. Skeletons live with the data component and mirror its real layout.
function HomePage() {
return (
<ErrorBoundary fallback={<HeroError />}>
<Suspense fallback={<HeroSectionSkeleton />}>
<HeroSection />
</Suspense>
</ErrorBoundary>
);
}
function HeroSection() {
const { data } = useSuspenseQuery(orpc.home.hero.get.queryOptions());
return <section>...</section>;
}
A route/layout boundary is correct only when the entire route is the visual unit.
Skill writing principles. Use when creating, editing, or reviewing any SKILL.md.
Skill rule extraction and creation. Use when the user says /learn.
Kysely database queries. Use when writing, reviewing, or debugging Kysely selects, mutations, joins, transactions, filters, or aggregates.
Frontend components and Tailwind. Use when creating, reviewing, refactoring, splitting, or organizing React components, shared components, component folders, or Tailwind classes.
Lint and optimize existing skills. Use when the user says /skill-linter.
Implement the agreed slice. Use when the user invokes $execute-slice or wants to implement a slice agreed via slice-prd.