Skip to content
aj-geddes avatar

Rate Limiting Implementation

Practical rate limiting skill with token bucket, Redis, sliding window, and tiered guides for protecting APIs.

CCM score
37 of 100
skills.sh installs
509
GitHub stars
396
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers token bucket, Redis-backed distributed, sliding window, tiered, and adaptive rate limiting approaches
  • Includes Express middleware and a TypeScript token bucket example, with implementations in references/ for six guides
  • Returns 429 responses with a Retry-After header, and warns against fail-closed behavior when the limiter itself fails
  • Designed for teams building public APIs that need abuse protection, quotas, or backpressure under load

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill rate-limiting-implementation -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Rate Limiting Implementation

Table of Contents

Overview

Implement rate limiting and throttling mechanisms to protect your services from abuse, ensure fair resource allocation, and maintain system stability under load.

When to Use

  • Protecting public APIs from abuse
  • Preventing DOS/DDOS attacks
  • Ensuring fair resource usage across users
  • Implementing API quotas and billing tiers
  • Managing system load and backpressure
  • Enforcing SLA limits
  • Controlling third-party API usage
  • Database connection management

Quick Start

Minimal working example:

interface TokenBucketConfig {
  capacity: number;
  refillRate: number; // tokens per second
  refillInterval: number; // milliseconds
}

class TokenBucket {
  private tokens: number;
  private lastRefill: number;
  private readonly capacity: number;
  private readonly refillRate: number;
  private readonly refillInterval: number;
  private refillTimer?: NodeJS.Timeout;

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Category
Backend & APIs
First seen
Jun 3, 2026

Questions

What does the rate-limiting-implementation skill do?

The rate-limiting-implementation skill adds rate limiting, throttling, API quotas and backpressure to a service so it stays protected from abuse and handles load fairly. It covers token bucket, sliding window and tiered approaches, plus Redis-based distributed limiting and Express middleware.

When should I use the rate-limiting-implementation skill?

Use rate-limiting-implementation when building public APIs, guarding against DOS or DDOS attacks, enforcing API quotas or billing tiers, or managing system load. It also helps with third-party API usage limits and database connection management.

How do I install the rate-limiting-implementation skill?

Run npx -y skills add aj-geddes/useful-ai-prompts --skill rate-limiting-implementation -y inside your project. Once installed, the agent gains guidance on returning 429 responses with Retry-After headers and choosing distributed storage for multi-server deployments.

Which category does the rate-limiting-implementation skill belong to?

The rate-limiting-implementation skill is listed in the Backend & APIs category on Claude Marketplaces. It is aimed at developers protecting services and APIs with rate limiting rules.

More from aj-geddes/useful-ai-prompts

All 258

Similar to Rate Limiting Implementation

More Backend & APIs