Skip to content
Skills Library
Programming · Building & coding

api-rate-limiting-throttling

/api-rate-limiting-throttling

Use this skill when protecting backend services from traffic spikes and abuse using token bucket, leaky bucket, and Redis counters.

Licence
MIT
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use this skill when protecting backend services from traffic spikes and abuse using token bucket, leaky bucket, and Redis counters.

Original author description

Use this skill when protecting backend services from traffic spikes and abuse using token bucket, leaky bucket, and Redis counters.

How it works

  1. When to use
  2. Prerequisites
  3. Step-by-step workflow
  4. Commands / code examples
  5. Common mistakes & pitfalls
  6. Verification checklist
  7. Related skills
Original SKILL.md headings · 64 lines, 327 words
SKILL.md preview
---
name: api-rate-limiting-throttling
description: Use this skill when protecting backend services from traffic spikes and abuse using token bucket, leaky bucket, and Redis counters.
---
# API Rate Limiting & Throttling

## When to use
Use this skill when you need to protecting backend services from traffic spikes and abuse using token bucket, leaky bucket, and Redis counters.

## Prerequisites
- Working knowledge of backend architecture, HTTP protocols, and systems programming.
- Appropriate runtime installed (Node.js, Python, Go, Rust, Java, or .NET depending on stack).

## Step-by-step workflow
1. **Define resource contracts**: Establish unambiguous request and response schemas, validation rules, and error envelopes.
2. **Implement routing & handlers**: Structure modular controllers or handlers keeping transport logic isolated from domain services.
3. **Enforce input validation**: Validate and sanitize all inbound parameters, headers, and payloads before reaching business logic.
4. **Implement robust error handling**: Return standardized error responses with consistent HTTP status codes and correlation IDs.
5. **Optimize resilience & telemetry**: Instrument endpoints with structured logging, health checks, metrics, and timeout boundaries.

## Commands / code examples
```ts
// Example implementation pattern for api-rate-limiting-throttling
import { Request, Response, NextFunction } from 'express';

export interface StandardApiResponse<T> {
  success: boolean;
  data?: T;
  error?: {
    code: string;
    message: string;
    details?: unknown;
  };
  meta?: {
    timestamp: string;
    requestId: string;
  };
}

export function apiResponseHandler<T>(data: T, req: Request): StandardApiResponse<T> {
  return {
    success: true,
    data,
    meta: {
      timestamp: new Date().toISOString(),
      requestId: (req.headers['x-request-id'] as string) || 'req_auto_gen',
    },
  };
}
```

## Common mistakes & pitfalls
- Exposing raw database exceptions or internal stack traces directly in client responses.
- Neglecting request timeouts, allowing hung external dependencies to exhaust server connection pools.
- Omitting correlation IDs (`X-Request-ID`), making distributed debugging impossible across microservices.

## Verification checklist
- [ ] Endpoints adhere strictly to standardized HTTP status codes and contract specifications.
- [ ] Inbound requests are validated against strict type schemas before processing.
- [ ] Errors return structured envelopes without leaking sensitive infrastructure details.
- [ ] All database queries and external service calls have explicit timeout deadlines.

## Related skills
- restful-api-design-best-practices
- api-rate-limiting-throttling
- distributed-tracing-opentelemetry-sdk
- secure-code-review-static-analysis-sast

Versions

The database has no other skills named api-rate-limiting-throttling.

Database snapshot: 13.11.2026 · package version 2471e8abcc08 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100api-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.
  • 95system-design-rate-limiting
    Use this skill when the user says 'rate limiting algorithm', 'token bucket', 'leaky bucket', 'sliding window', 'fixed window', 'GCRA', 'distributed rate limiter', 'Redis rate limit', '429 Too Many Requests', 'Retry-After', 'throttling design', 'quota'. Designs rate limiters at…
  • 95api-rate-limiting-helper
    Designs rate limiting strategies, quota systems, throttling policies, retry logic, and backoff patterns for APIs. Use whenever the user asks about rate limiting, throttling, quotas, "too many requests", 429 responses, "how do I limit my API", "retry strategy", "exponential…
  • 100rate-limiting-strategy
    Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right…
  • 100rate-limiting-and-security
    This skill should be used when the user is implementing rate limiting, choosing rate limit algorithms, adding rate limit headers, securing API endpoints, preventing OWASP API Top 10 vulnerabilities, configuring CORS, validating input, or implementing request signing. Covers…
  • 100shopify-rate-limits
    Handle Shopify API rate limits for both REST (leaky bucket) and GraphQL (calculated query cost). Use when hitting 429 errors, implementing retry logic, or optimizing API request throughput. Trigger with phrases like "shopify rate limit", "shopify throttling", "shopify 429",…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.