Skip to content
Back to skills

Rate Limiter

ASecurity

Adds rate limiting to API endpoints with Redis or in-memory storage

  • 10 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 1, 2026
ai-agentsrustbashexpressapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned June 1, 2026

npx -y skills add berkcangumusisik/claude-code-practices --skill rate-limiter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rate Limiter?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rate Limiter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/berkcangumusisik-rate-limiter/badge)](https://www.skillsdirectory.com/skills/berkcangumusisik-rate-limiter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rate-limiter
description: Adds rate limiting to API endpoints with Redis or in-memory storage
argument-hint: [endpoint-pattern]
user-invocable: true
allowed-tools: Read Glob Edit
effort: low
---

## Add Rate Limiting

Endpoint: **$1** (or all routes if not specified)

1. Check existing rate limiting:
```bash
cat package.json | grep -E '"express-rate-limit"|"@fastify/rate-limit"|"rate-limiter-flexible"|"upstash"'
grep -rn "rateLimit\|rateLimiter" src/ --include="*.ts" | head -5
```

2. Check if Redis is available (preferred for distributed deployments):
```bash
cat package.json | grep -E '"ioredis"|"redis"|"@upstash/redis"'
```

3. Implement appropriate rate limiter:

**Tiered limits by endpoint sensitivity:**
```ts
// Auth endpoints - strict
authLimiter = rateLimit({ windowMs: 15 * 60 * 1000, max: 5 })

// API endpoints - moderate
apiLimiter = rateLimit({ windowMs: 60 * 1000, max: 100 })

// Public read endpoints - loose
publicLimiter = rateLimit({ windowMs: 60 * 1000, max: 300 })
```

4. Include:
   - Proper `Retry-After` header in 429 responses
   - Different limits for authenticated vs anonymous users
   - Whitelist for trusted IPs/service accounts
   - Graceful degradation if Redis is down (fall back to in-memory)

5. Apply to the specified endpoint or globally.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…