Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add oakoss/agent-skills --skill tanstack-pacer -a claude-code
Open on GitHub

What 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 useDebouncedCallback so the request only goes out after the typing stops.
  • Put a sliding-window RateLimiter on the weather API calls and tell the user through onReject when one is refused.
  • Set up an AsyncQueuer for 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-code

2Manually: put the files in place

~/.claude/skills/tanstack-pacer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/tanstack-pacer/

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.

tanstack-pacer tanstack-skills tanstack-pacer is a Claude Code skill for choosing utilities that control when functions run. It comes into play for debouncing, rate limits, queues, and batching. CX Codex +1 3,900installs vueuse-shared-skilld skilld-dev vueuse-shared-skilld — a skill that brings @vueuse/shared v15.0.0 API reference into Claude Code, Cursor, and other editors. Covers reactive utilities: debounce, throttle, watch variants, state sharing, and ref synchronization for Vue 3. CX Codex +1 137installs tanstack-integration-best-practices DeckardGer tanstack-integration-best-practices — a skill that hands the agent rules for wiring TanStack Query, Router and Start together: loaders, SSR hydration, cache ownership. Useful once all three live in one codebase. CX Codex +1 3,100installs clerk-tanstack-patterns clerk The clerk-tanstack-patterns Claude Code skill covers Clerk authentication patterns for TanStack React Start. It activates for work with createServerFn, beforeLoad route protection, and request middleware. CX Codex +1 16,400installs tanstack-start tanstack-skills Guides agents through building full-stack React apps with TanStack Start, streaming SSR, and type-safe server functions. CX Codex +1 4,000installs tanstack-virtual tanstack-skills Shows the agent how to wire up TanStack Virtual so only visible rows render in long lists, tables and grids. CX Codex +1 2,600installs tanstack-start-cursorrules-prompt-file PatrickJS tanstack-start-cursorrules-prompt-file — a Cursor rule for TanStack Start, a full-stack React framework with SSR, server functions and type safety. Triggers when you work on Start projects, TanStack Router routes or Vinxi config files. CX Codex +1 ★ 41,178repo stars

From the same set106

The whole set →
python-uv python-uv teaches coding agents to manage Python projects with uv: initialization, dependencies, lockfiles, workspaces, and packaging. Useful when migrating from pip and poetry workflows. CX Codex +1 129installs rust This skill guides Rust work across ownership, async services, CLIs, terminal UIs, and testing. Use it when an agent needs Rust-specific patterns. CX Codex +1 128installs github-cli github-cli equips AI coding assistants with gh CLI workflows for pull requests, issues, Actions runs, releases, and API calls. CX Codex +1 128installs resend Guides AI agents in integrating the Resend email API, handling React Email templates, domain verification, and Svix webhooks. CX Codex +1 127installs tanstack-devtools tanstack-devtools guides AI coding agents in configuring Query cache, Router, and Form debugging panels across React applications. CX Codex +1 125installs seo-optimizer seo-optimizer — an SEO architecture skill: JSON-LD entities, E-E-A-T signals, topic clusters and a 30-point content audit. Runs in Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. CX Codex +1 125installs performance-optimizer performance-optimizer provides structured workflows for profiling, caching, and full-stack performance tuning. Helps eliminate slow database queries, optimize bundles, and reduce API latency. CX Codex +1 124installs storybook-stories Writes Storybook stories and interaction tests in CSF3 format. Handles component examples, Chromatic visual snapshot setup, and accessibility checks. CX Codex +1 124installs

Project sponsors

Companies that keep this analytics open