Command Palette

Search for a command to run...

Назад к скиллам
скилл № 73605

api-gateway-design

Design API gateways that route, authenticate, rate-limit, and aggregate backend services. Use when building client-facing APIs or managing service boundaries.

БесплатноБез исполняемых скриптов
sethdfordот sethdford★ 51 звезда на GitHub

Установить api-gateway-design в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

API Gateway Design

Design robust API gateways that handle authentication, rate limiting, routing, and response aggregation for backend services.

Context

You are designing an API layer. The user is building client-facing APIs, managing multiple backends, or handling cross-cutting concerns like auth and rate limiting. Read their current API structure.

Domain Context

Based on Sam Newman's API Gateway pattern and Kong/AWS API Gateway reference implementations:

  • Reverse Proxy: Single entry point routing to multiple backends
  • Protocol Translation: GraphQL ↔ REST, REST ↔ gRPC
  • Authentication Gateway: Centralized JWT validation, OAuth2 token exchange
  • Rate Limiting: Per-user, per-API, per-IP rate limits with backpressure
  • Response Aggregation: Fan-out to multiple backends, merge responses (avoid N+1 problems)

Instructions

  1. Define Gateway Responsibilities: What should the gateway do?

    • Route requests to backends
    • Authenticate and authorize
    • Rate limit and throttle
    • Aggregate responses
    • Transform requests/responses (JSON ↔ Protocol Buffers)
  2. Design Routing Rules: Map API paths to backend services. Example:

    /api/users/* → user-service
    /api/orders/* → order-service
    /api/inventory/* → inventory-service
    
  3. Implement Authentication: Centralize JWT validation or OAuth2 token exchange. Avoid pushing auth to every backend. Include refresh token handling.

  4. Configure Rate Limiting: Per-user limits (1000 req/min) and per-API limits (10k req/min total). Include exponential backoff and retry-after headers.

  5. Handle Response Aggregation: For queries needing data from multiple services, aggregate at gateway. Example: order detail page fetches from order-service + inventory-service + pricing-service.

Anti-Patterns

  • Gateway as Business Logic: Adds validation, transformation, or orchestration logic. Result: gateway becomes bottleneck and single point of failure. Guard: Gateway routes and translates; backends own business logic.
  • No Rate Limiting Strategy: Treats all clients equally. Result: one misbehaving client can starve others. Guard: Implement per-user, per-API, per-endpoint rate limits.
  • Synchronous Aggregation Without Timeout: Gateway waits indefinitely for slow backend. Result: cascading timeout. Guard: Set timeout for each backend call; timeout on any exceeding limit.
  • Authentication Token Validation Every Request: Validates token with auth service on every request. Result: auth service becomes bottleneck. Guard: Cache token validation (with TTL); only revalidate on expiry.

Further Reading

  • Building Microservices by Sam Newman — gateway patterns and responsibilities
  • API Design Patterns by JJ Geewax — RESTful design and backwards compatibility
  • Kong API Gateway Documentation — practical implementation reference
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл api-gateway-design?

Design API gateways that route, authenticate, rate-limit, and aggregate backend services. Use when building client-facing APIs or managing service boundaries.

Как установить скилл api-gateway-design?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл api-gateway-design запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить api-gateway-design с