Agent skill · Databases

api-rate-limiting

Implements API rate limiting using token bucket, sliding window, and Redis-based algorithms to protect against abuse. Use when securing public APIs, implementing tiered access, or preventing denial-of-service attacks.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill api-rate-limiting-secondsky-claude-skills --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 2 KB
Bundled scripts: none
Path: skills/api/api-rate-limiting-secondsky-claude-skills/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# API Rate Limiting Protect APIs from abuse using rate limiting algorithms with per-user and per-endpoint strategies. ## Algorithms | Algorithm | Pros | Cons | |-----------|------|------| | Token Bucket | Handles bursts, smooth | Memory per user | | Sliding Window | Accurate | Memory intensive | | Fixed Window | Simple | Boundary spikes | ## Token Bucket (Node.js) ```javascript class TokenBucket { constructor(capacity, refillRate) { this.capacity = capacity; this.tokens = capacity; this.refillRate = refillRate; // tokens per second this.lastRefill = Date.now(); } consume() { this.refill(); if (this.tokens >= 1) { this.tokens--; return true; } return false; } refill() { const now = Date.now(); const elapsed = (now - this.lastRefill) / 1000; this.tokens = Math.min(this.capacity, this.tokens + elapsed * this.refillRate); this.lastRefill = now; } } ``` ## Express Middleware ```javascript const rateLimit = require('express-rate-limit'); const limiter = rateLimit({ windowMs: 15 * 60 * 1000, // 15 minutes max: 100, standardHeaders: true, message: { error: 'Too many requests, try again later' } }); app.use('/api/', limiter); ``` ## Response Headers ``` X-RateLimit-Limit: 100 X-RateLimit-Re

What's inside
Steps it walks through
  1. Algorithms
  2. Token Bucket (Node.js)
  3. Express Middleware
  4. Response Headers
  5. Tiered Limits
  6. Best Practices
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the api-rate-limiting skill do?

Implements API rate limiting using token bucket, sliding window, and Redis-based algorithms to protect against abuse. Use when securing public APIs, implementing tiered access, or preventing denial-of-service attacks.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill api-rate-limiting-secondsky-claude-skills --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going