agentsclimarketplace

Rate limiting

Skill kimtth/agent-skill-100-lines-or-less/skills/rate-limiting

Use when: protect a service with rate limiting and backpressure without harming legitimate users.From its SKILL.md

Install
npx -y skills add kimtth/agent-skill-100-lines-or-less --skill rate-limiting

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.1 KB, 219 tokens by cl100k_base, as published. Nobody here has run it

Goal: limit abuse and overload while staying fair to real traffic.

Use for:

  • protecting APIs and expensive endpoints
  • preventing abuse, scraping, and accidental floods
  • shaping traffic to downstream capacity

Workflow:

  1. Pick the dimension: per IP, per user, per API key.
  2. Choose an algorithm: token bucket, sliding window, or leaky bucket.
  3. Set limits from real capacity and usage patterns.
  4. Return 429 with Retry-After and clear limit headers.
  5. Apply backpressure and timeouts to protect dependencies.
  6. Monitor rejection rates and adjust thresholds.

Patterns:

  • token bucket for bursts with a steady refill
  • sliding window for smooth enforcement
  • distributed counter (e.g. Redis) for multi-instance limits
  • separate limits for anonymous vs. authenticated

Rules:

  • always return 429 with Retry-After, not a silent drop
  • key limits on a stable identity, not just IP when possible
  • fail closed on critical resources, open on best-effort ones
  • expose remaining-quota headers so clients can adapt

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.