tanstack-pacer · oakoss — Claude Code skill: what it does, how to install
A skill that hands your agent a map of TanStack Pacer: debouncing, throttling, rate limits and async queues, with the matching React hooks. Useful when a handler fires too often.
MIT 126 installs ★ 29 updated 2026-08-17
npx skills add oakoss/agent-skills --skill tanstack-pacer -a claude-codeWhat tanstack-pacer does
The agent gets a reference for Pacer's core classes: Debouncer, Throttler, RateLimiter, Queuer, AsyncQueuer, AsyncBatcher. React hooks sit on top with instance, callback, state and value variants. One table pairs each pattern with its API and the catch, another lists mistakes that come up again and again.
Most of the value is in the sharp edges. Debouncer ships without a maxWait option, so steady pacing means reaching for Throttler, where leading and trailing are both on by default. A RateLimiter drops over-limit calls silently unless you wire onReject. Fixed windows leak bursts at the boundary; sliding windows spread the load.
The skill also marks where Pacer stops. A single delay belongs to setTimeout, infrastructure-level limits belong to middleware or an API gateway, and real job scheduling belongs to a task queue such as BullMQ. Fetching and cache work are handed off to a tanstack-query skill when one is installed.
What it helps with
- debounce a search field so requests fire after typing pauses
- cap how often an external API gets called
- smooth a scroll or resize handler with throttle
- queue async tasks with a concurrency limit
- collect several operations into one batched request
Example prompts for the agent
- Debounce the search input with
useDebouncedCallbackso the request only goes out after the typing stops. - Put a sliding-window
RateLimiteron the weather API calls and tell the user throughonRejectwhen one is refused. - Set up an
AsyncQueuerfor uploads and limit how many run at once.
How to install tanstack-pacer
1Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill tanstack-pacer -a claude-code2Manually: put the files in place
~/.claude/skills/tanstack-pacer/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tanstack-pacer/
1Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill tanstack-pacer -a codex2Manually: put the files in place
.agents/skills/tanstack-pacer/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill tanstack-pacer -a cursor2Manually: put the files in place
.cursor/skills/tanstack-pacer/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install oakoss/agent-skills skills/tanstack-pacer2Manually: put the files in place
.github/skills/tanstack-pacer/SKILL.md1Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill tanstack-pacer -a gemini-cli2Platform CLI
gemini skills install https://github.com/oakoss/agent-skills --path skills/tanstack-pacerManually: put the files in place
.devin/skills/tanstack-pacer/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill tanstack-pacer -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about tanstack-pacer
How do I install tanstack-pacer in Claude Code?
Run npx skills add oakoss/agent-skills --skill tanstack-pacer -a claude-code. The skill file lands at ~/.claude/skills/tanstack-pacer/SKILL.md.
What does tanstack-pacer do?
It gives the agent a working map of TanStack Pacer: debouncing, throttling, rate limits, queuing and batching, along with the React hooks and the mistakes to avoid.
When should I use throttle instead of debounce?
Throttle keeps a steady interval, debounce waits for a pause in calls. Pacer's Debouncer has no maxWait, so anything that must fire on a fixed cadence goes through Throttler.
Source text
SKILL.md · MIT
--- name: tanstack-pacer description: 'TanStack Pacer for rate limiting, throttling, debouncing, and async queuing. Use when controlling execution frequency, managing API rate limits, debouncing user input, or queuing async tasks. Use for pacer, throttle, debounce, rate-limit, queue, async-throttle, rate-limiting.' license: MIT metadata: author: oakoss version: '1.1' source: 'https://tanstack.com/pacer/latest' user-invocable: false --- # TanStack Pacer ## Overview TanStack Pacer is a lightweight, type-safe library for controlling function execution timing through debouncing, throttling, rate limiting, queuing, and batching. It provides framework-agnostic core classes with dedicated React hooks at multiple abstraction levels (instance, callback, state, value). **When to use:** Debouncing search input, throttling scroll/resize handlers, enforcing API rate limits, queuing async tasks with concurrency control, batching multiple operations into single requests. **When NOT to use:** Simple one-off delays (use `setTimeout`), server-side rate limiting at the infrastructure level (use middleware/API gateway), complex job scheduling (use a task queue like BullMQ). ## Quick Reference | Pattern | API | Key Points | | ----------------- | ------------------------------------------- | ---------------------------------------------------------- | | Debounce function | `Debouncer` / `debounce(fn, opts)` | Waits for inactivity; no `maxWait` option by design | | Throttle function | `Throttler` / `throttle(fn, opts)` | Even spacing; `leading` and `trailing` both default `true` | | Rate limit | `RateLimiter` / `rateLimit(fn, opts)` | Fixed or sliding window; rejects calls over limit | | Queue items | `Queuer` / `queue(fn, opts)` | FIFO default; supports LIFO, priority, expiration | | Async queue | `AsyncQueuer` / `asyncQueue(fn, opts)` | Concurrency control, retry, error callbacks | | Async batch | `AsyncBatcher` / `asyncBatch(fn, opts)` | Collects items, processes as batch after wait/maxSize | | React debounce | `useDebouncer` / `useDebouncedCallback` | Instance hook vs simple callback hook | | React throttle | `useThrottler` / `useThrottledCallback` | Instance hook vs simple callback hook | | React rate limit | `useRateLimiter` / `useRateLimitedCallback` | Instance hook vs simple callback hook | | React queue | `useQueuer` / `useQueuedState` | Instance hook vs state-integrated hook | | React async queue | `useAsyncQueuer` / `useAsyncQueuedState` | Concurrency + state management | | React batch | `useBatcher` / `useAsyncBatcher` | Sync and async batching hooks | | State hooks | `useDebouncedState`, `useThrottledState` | Integrate with React state directly | | Value hooks | `useDebouncedValue`, `useThrottledValue` | Create derived debounced/throttled values | ## Common Mistakes | Mistake | Correct Pattern | | --------------------------------------- | ---------------------------------------------------------------------------- | | Using `maxWait` on Debouncer | Debouncer has no `maxWait`; use Throttler for evenly spaced execution | | Creating instances inside render | Create with hooks (`useDebouncer`, `useThrottler`) to manage lifecycle | | Ignoring `maybeExecute` return | Rate limiter and throttler may reject calls; check state or use callbacks | | Using debounce when throttle is needed | Debounce waits for pause; throttle guarantees max-once-per-interval | | Not cleaning up on unmount | React hooks handle cleanup automatically; manual instances need `cancel()` | | Using Queuer when items can be dropped | Queuers process every item; use throttle/debounce if dropping is acceptable | | Fixed window when sliding is needed | Fixed windows allow bursts at boundaries; sliding window gives smoother rate | | Forgetting `onReject` on RateLimiter | Rejected calls are silent by default; add `onReject` for user feedback | | Not passing `enabled: false` to disable | All utilities support `enabled` option to temporarily disable processing | ## Delegation > If the `tanstack-query` skill is available, delegate data fetching and cache management tasks to it. TanStack Pacer complements Query for controlling request frequency. > Otherwise, recommend: `npx skills add oakoss/agent-skills --skill tanstack-query` - **Execution timing patterns**: Use this skill - **Data fetching and caching**: Delegate to `tanstack-query` - **Component architecture**: Delegate to framework-specific skills ## References - [Throttle and debounce patterns](references/throttle-debounce.md) - [Rate limiting patterns](references/rate-limiting.md) - [Queuing and async queuing](references/queuing.md) - [React hooks and integration](references/react-integration.md)
© oakoss · MIT · oakoss/agent-skills
Similar skills
All skills for Frontend and UI →tanstack-pacer by other authors comes first.