Provides TanStack Pacer best practices for execution control in React — debouncing, throttling, rate limiting, queuing, and batching. Use for search inputs, scroll handlers, API rate limits, task queues, or bulk operations.
Ships in frontend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Version: @tanstack/react-pacer@latest Requires: React 16.8+, TypeScript recommended
npm install @tanstack/react-pacer
import { useDebouncedCallback } from '@tanstack/react-pacer'
function SearchInput() {
const debouncedSearch = useDebouncedCallback(
(query: string) => fetchResults(query),
{ wait: 300 },
)
return <input onChange={(e) => debouncedSearch(e.target.value)} />
}
Each utility (Debouncer, Throttler, RateLimiter, Queuer, Batcher) provides 4 React hooks:
| Hook | Returns | Use Case |
|---|---|---|
use[Utility] | Instance | Full control, custom state subscriptions |
use[Utility]Callback | Wrapped function | Simple event handler wrapping |
use[Utility]State | [value, setValue, instance] | Debounced/throttled React state |
use[Utility]Value | [derivedValue, instance] | Read-only derived value from props/state |
import { PacerProvider } from '@tanstack/react-pacer'
<PacerProvider
defaultOptions={{
debouncer: { wait: 300 },
throttler: { wait: 200 },
}}
>
<App />
</PacerProvider>
npm install -D @tanstack/react-devtools @tanstack/react-pacer-devtools
import { TanStackDevtools } from '@tanstack/react-devtools'
import { pacerDevtoolsPlugin } from '@tanstack/react-pacer-devtools'
<TanStackDevtools plugins={[pacerDevtoolsPlugin()]} />
Utilities must have a key option to appear in devtools.
| Priority | Category | Rule File | Impact |
|---|---|---|---|
| CRITICAL | Hook Selection | rules/hook-selection.md | Correct hook choice per use case |
| CRITICAL | Debouncing | rules/deb-debouncing.md | Prevents wasted API calls and flickering UI |
| HIGH | Throttling | rules/thr-throttling.md | Smooth, evenly-spaced execution |
| HIGH | State & Reactivity | rules/state-reactivity.md | Prevents unnecessary re-renders |
| HIGH | Async Patterns | rules/async-patterns.md | Correct async execution with retry, abort, error handling |
| MEDIUM | Rate Limiting | rules/rl-rate-limiting.md | Enforces execution budgets |
| MEDIUM | Queuing | rules/que-queuing.md | Lossless ordered/priority task processing |
| MEDIUM | Batching | rules/bat-batching.md | Groups operations for bulk processing |
| LOW | Configuration | rules/config-options.md | Dynamic options, providers, shared config |
| LOW | Devtools | rules/devtools.md | Debugging and monitoring utilities |
useDebouncedCallback not debounce() for proper React lifecycleuseCallback for event handlers, useState for controlled inputs, useValue for derived valuesuseDebouncer(fn, opts, (s) => ({ isPending: s.isPending }))useAsyncDebouncedCallback gives error handling, retry, abortAbortSignal to fetch — getAbortSignal() enables cancellation of in-flight requestskey option for devtools — only keyed utilities appear in devtools paneldebounce() function in React — no lifecycle cleanup; use useDebouncedCallback hook insteadmaxWait on Debouncer — Pacer has no maxWait; use Throttler for guaranteed periodic execution// Debounced search input with state
import { useDebouncedState } from '@tanstack/react-pacer'
function Search() {
const [query, setQuery, debouncer] = useDebouncedState('', { wait: 300 })
// query updates after 300ms pause; setQuery is immediate
return <input onChange={(e) => setQuery(e.target.value)} />
}
// Async debounced API call with abort
import { useAsyncDebouncedCallback } from '@tanstack/react-pacer'
function AsyncSearch() {
const search = useAsyncDebouncedCallback(
async (query: string) => {
const signal = search.getAbortSignal()
const res = await fetch(`/api/search?q=${query}`, { signal })
return res.json()
},
{ wait: 300, onSuccess: (data) => setResults(data) },
)
return <input onChange={(e) => search(e.target.value)} />
}
// Throttled scroll handler
import { useThrottledCallback } from '@tanstack/react-pacer'
function ScrollTracker() {
const onScroll = useThrottledCallback(
() => trackScrollPosition(window.scrollY),
{ wait: 100 },
)
useEffect(() => {
window.addEventListener('scroll', onScroll)
return () => window.removeEventListener('scroll', onScroll)
}, [onScroll])
}
// Derived debounced value from props
import { useDebouncedValue } from '@tanstack/react-pacer'
function FilteredList({ filter }: { filter: string }) {
const [debouncedFilter] = useDebouncedValue(filter, { wait: 300 })
return <ExpensiveList filter={debouncedFilter} />
}
// Async queue with concurrency
import { useAsyncQueuer } from '@tanstack/react-pacer'
function UploadQueue() {
const queuer = useAsyncQueuer(uploadFile, { concurrency: 3 })
return <button onClick={() => queuer.addItem(file)}>Upload</button>
}
agents/openai.yaml (opens in a new tab)rules/async-patterns.md (opens in a new tab)rules/bat-batching.md (opens in a new tab)rules/config-options.md (opens in a new tab)rules/deb-debouncing.md (opens in a new tab)rules/devtools.md (opens in a new tab)rules/hook-selection.md (opens in a new tab)rules/que-queuing.md (opens in a new tab)rules/rl-rate-limiting.md (opens in a new tab)rules/state-reactivity.md (opens in a new tab)rules/thr-throttling.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tanstack-pacer, debounce, throttle, rate-limit, queue, batch, execution-control
34 skills in this plugin
/ai-sdkAnswer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat"./baseline-uiQuickly deslop UI code by fixing spacing, hierarchy, typography, and small layout issues. Use when the interface needs a fast cleanup or polish pass./Other plugins' skills for the same job
/frontend:tanstack-pacerfrom frontend
npx claudepluginhub fellipeutaka/leon --plugin frontend