# Commandkit Ratelimit

> Configure advanced abuse protection with @commandkit/ratelimit. Use for runtime defaults, command-level policy, directive usage, storage strategy, and user-facing cooldown behavior.

- Skill: `neplexlabs/commandkit-ratelimit` (Agent Skill, multi-file: 9 files)
- Install (CLI): `npx skillmds@latest add neplexlabs/commandkit-ratelimit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/neplexlabs/commandkit-ratelimit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: neplexlabs (https://skillmd.com/u/neplexlabs)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/neplexlabs/commandkit-ratelimit

---


# CommandKit Ratelimit Plugin

## Activation guidance

Use when protecting commands from abuse while keeping user UX
predictable.

## Required filesystem expectations

- plugin registration in `commandkit.config.ts`
- runtime config bootstrap in `ratelimit.ts` or `ratelimit.js`
- optional per-command metadata in command files

## Execution workflow

1. Define runtime defaults with `configureRatelimit`.
2. Register plugin in config.
3. Apply command-level overrides or directive-based limits.
4. Configure memory/redis/fallback storage based on deployment.
5. Validate limited responses and retry timing.

## Guardrails

- Balance burst and sustained limits.
- Avoid policy that blocks legitimate normal usage.

## Reference index

| Name                                          | Description                                         |
| --------------------------------------------- | --------------------------------------------------- |
| `references/00-filesystem-structure.md`       | Required ratelimit bootstrap/config file placement. |
| `references/01-runtime-config.md`             | Runtime defaults and initialization pattern.        |
| `references/02-plugin-setup.md`               | Plugin wiring and startup ordering expectations.    |
| `references/03-command-metadata-ratelimit.md` | Command-level metadata policy examples.             |
| `references/04-use-ratelimit-directive.md`    | Function directive usage and error handling.        |
| `references/05-storage-options.md`            | Memory/Redis storage strategy and deployment fit.   |

## Tool index

| Name                                  | Description                                                       |
| ------------------------------------- | ----------------------------------------------------------------- |
| `tools/generate-ratelimit-config.mjs` | Prints a baseline `configureRatelimit()` runtime config template. |

