add-rate-limit · git:20261115.237aa7d · 2026-11-15 · sha256 2e7137166bbb0281

add-rate-limit git:20261115.237aa7dA

Immutable. This exact content never changes and is served at /api/v1/blob/2e7137166bbb0281.

No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_x5s3f5g7otff7e7u/2e7137166bbb02814755beda2f1503323c7c0c88ec2ac453efe2d19e3efc17b6.json

Then /plugin install add-rate-limit@markdownregistry-x5s3f5g7otff7e7u in Claude Code. It installs this exact version, the one graded A here, pinned to the commit it was graded at, and leaves it there.

---
name: add-rate-limit
description: Adds rate limiting to a named route group using your current stack, with sane limits, proper 429 replies and a test.
disable-model-invocation: true
---

Add rate limiting to this route group: $ARGUMENTS

1. Find how the app is served and whether a limiter exists already (express-rate-limit, slowapi, Rack::Attack, a gateway or CDN rule, Redis). Reuse it. Do not add a new store without asking.
2. Choose the key per route: IP for anonymous routes, user id or API key for authenticated ones, and both IP and account name for login. Mention proxy setups: read the real client IP only from a trusted forwarded header.
3. Propose limits and show the numbers before coding, for example 5 per minute for login, 60 per minute for general reads. A burst allowance is better than a hard cap.
4. Return 429 with a Retry-After header and the project's normal error body. Never reveal whether an account exists.
5. Check multi-instance behavior: an in-memory counter is wrong behind several servers, so say so.
6. Write a test that exceeds the limit, sees the 429, and checks that a different key is unaffected. Run the tests.

Report the limits, keys and any gap such as a shared store you did not set up.