rate-limit
Skill2 starsChanged 4 months agoMITView on GitHub
Add rate limiting / throttling to an endpoint or service — protecting against abuse, brute force, and overload — using the project's framework and a shared store where needed. Use when the user says "add rate limiting", "throttle this endpoint", "limit requests per user", "prevent brute force", "add a request quota", or "protect this API from abuse".
2 other projects use a version of this.
Adopted by
Most recently taken up by
- 1398281322-a11y/java-backend-guardrailstheir own version, first seen Aug 31, 2026
- Jinbae10/skillstheir own version, first seen Jul 7, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- 1398281322-a11y/java-backend-guardrails★ 2same name
- Jinbae10/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository68 other files it gives its agents.
- a11ySkill
- api-docsSkill
- audit-logSkill
- benchmarkSkill
- bisectSkill
- cacheSkill
- changelogSkill
- cherry-pickSkill
- ci-setupSkill
- codeownersSkill
- commit-messageSkill
- connection-poolSkill
- contributingSkill
- coverageSkill
- db-migrateSkill
- dead-codeSkill
- debugSkill
- depsSkill
- diagramSkill
- dockerizeSkill
- docstringSkill
- e2eSkill
- env-exampleSkill
- error-handlingSkill
- explainSkill
- feature-flagSkill
- flaky-testSkill
- gitignoreSkill
- graceful-shutdownSkill
- graphqlSkill
- healthcheckSkill
- i18nSkill
- idempotencySkill
- licenseSkill
- lint-fixSkill
- loggingSkill
- migrateSkill
- mockSkill
- onboardSkill
- optimizeSkill
- paginationSkill
- pr-descriptionSkill
- pre-commitSkill
- profileSkill
- prune-branchesSkill
- readmeSkill
- rebaseSkill
- refactorSkill
- regexSkill
- releaseSkill
- resolve-conflictsSkill
- retrySkill
- review-diffSkill
- scaffoldSkill
- secrets-scanSkill
- security-headersSkill
- seedSkill
- soft-deleteSkill
- sqlSkill
- squashSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Add rate limiting for the target in $ARGUMENTS.
- Very specific: line 21
Detect the framework and any shared store: Use the idiomatic library (express-rate-limit, Fastify's rate-limit, NestJS throttler, slowapi …
- Distinctive: line 30
Use a shared store (Redis/etc.) when the service runs multiple instances.
- Very specific: line 31
Always return 429 with Retry-After/RateLimit-* headers — don't silently drop or use the wrong status.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Framework & store signals
!grep -rilE "express|fastify|koa|nestjs|flask|fastapi|django|gin|echo|rails|spring|express-rate-limit|slowapi|rack-attack" package.json pyproject.toml go.mod Gemfile 2>/dev/null | head
!grep -rilE "redis|memcached|ioredis" --include='*.*' package.json pyproject.toml 2>/dev/null | grep -vE 'node_modules|\.git' | head -5
Instructions
Add rate limiting for the target in $ARGUMENTS. If the policy (limit, window, and key) isn't given, propose sensible defaults for the use case and confirm. Match the project's framework and middleware style.
Method
- Detect the framework and any shared store. Use the idiomatic library (
express-rate-limit, Fastify's rate-limit, NestJS throttler,slowapifor FastAPI, DRF throttling,rack-attackfor Rails, a Gin/Echo middleware). Mirror how the project registers middleware. - Choose the key — what is being limited. Per IP (anonymous/login), per user or API key (authenticated), or per route. For login/abuse protection prefer a key that's hard to rotate (account + IP). Be careful behind a proxy/load balancer: read the real client IP from the trusted forwarded header, not the socket, or attackers/limits both break.
- Pick the policy and algorithm. A window + max (e.g. 5/min) with a sliding-window or token-bucket algorithm for smooth limiting. Tighter on sensitive routes (auth, password reset, payment), looser on read-heavy public ones.
- Use a shared store for multi-instance deployments. In-memory counters only work for a single process — if the app runs more than one instance/worker, back the limiter with Redis (or the existing store) so the limit is global, not per-process. Note this even if you default to in-memory for dev.
- Respond correctly when limited. Return 429 Too Many Requests with
Retry-Afterand the standardRateLimit-*headers, and a safe message. Make sure failures of the limiter store fail open or closed deliberately (decide which, and say so) rather than crashing the request.
Rules
- Limit at the right key and read the client IP from the trusted proxy header when behind a load balancer — limiting on a proxy's IP throttles everyone together.
- Use a shared store (Redis/etc.) when the service runs multiple instances; flag clearly if you leave an in-memory limiter that won't hold across processes.
- Always return
429withRetry-After/RateLimit-*headers — don't silently drop or use the wrong status. - Apply stricter limits to auth and other abuse-prone endpoints; don't apply one blanket limit that's either too loose for login or too tight for normal traffic.
- Decide and state the store-failure behavior (fail open vs closed), and don't let the limiter itself become a crash or bottleneck. Summarize the policy, key, store, and headers after wiring it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

