Back to skills
SKILL.md
Rate Limiter
ASecurityAdds rate limiting to API endpoints with Redis or in-memory storage
- 10 stars
- 0 votes
- 0 copies
- 2 views
- Added June 1, 2026
Works with
Security analysis
100/100npx -y skills add berkcangumusisik/claude-code-practices --skill rate-limiter --agent claude-codeAre you the author of Rate Limiter?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/berkcangumusisik-rate-limiter)---
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
Comments
Loading comments…