agentleFS
blitzhash360-webblitzhash360-web/blitzhash-vibe-coding-rules/skills/add-rate-limiting/SKILL.md

add-rate-limiting

Skill0 starsChanged 23 days agoMITView on GitHub

Add rate limits and abuse controls to login, signup, password reset, OTP, forms, uploads, public APIs and AI or other paid API routes, using a shared store (Upstash or Redis, Cloudflare rules, KV or Durable Objects) with 429 responses, per-user quotas and spend caps. Use when the user worries about bots, spam, brute force or surprise AI bills.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before launch, for every public or paid route.

    line 16
  2. Distinctive:

    After a spam wave, credential-stuffing attempt or a surprise invoice.

    line 17
  3. Very specific:

    AI and paid APIs: add per-user daily quotas, max_tokens, timeouts, and remind the user to set a spend cap and billing alert in the provider …

    line 25
  4. Distinctive:

    Never load-test or flood production.

    line 35
  5. Distinctive:

    Do not change provider billing settings yourself.

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add rate limiting

A single script should not be able to lock out your users, empty your email quota or run up your AI bill.

When to use

  • Before launch, for every public or paid route.
  • After a spam wave, credential-stuffing attempt or a surprise invoice.

Steps

  1. List the routes that are public, auth-related or call paid APIs. Propose a limit for each (for example login 5 per minute per IP and per account, AI chat 20 per minute and 200 per day per user).
  2. Pick the store that fits the hosting: Upstash Redis for Vercel or Netlify serverless, Cloudflare rate limiting rules or Durable Objects on Cloudflare, Redis for containers or a VPS. Explain why an in-memory limiter is not enough when there is more than one instance.
  3. Choose the key: user id when signed in, trusted client IP otherwise (platform helper or trusted proxy header), plus email for login and reset routes.
  4. Implement the limiter as one helper, apply it at the top of each route, return 429 with Retry-After.
  5. AI and paid APIs: add per-user daily quotas, max_tokens, timeouts, and remind the user to set a spend cap and billing alert in the provider dashboard (they do this themselves).
  6. Bots on forms: suggest Turnstile, hCaptcha or reCAPTCHA on signup and contact forms.
  7. Test with a short loop of requests and show the first 429.

Output format

Table of routes with limits and keys, the limiter helper, the changed routes, and the test output.

Safety rules (always)

  1. Never load-test or flood production. Test locally or on staging.
  2. Redis or Upstash tokens only from environment variables; never print or commit them.
  3. Do not change provider billing settings yourself; give the user the exact steps.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.