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★ 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
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)
Design Routing Rules: Map API paths to backend services. Example:
/api/users/* → user-service /api/orders/* → order-service /api/inventory/* → inventory-serviceImplement Authentication: Centralize JWT validation or OAuth2 token exchange. Avoid pushing auth to every backend. Include refresh token handling.
Configure Rate Limiting: Per-user limits (1000 req/min) and per-API limits (10k req/min total). Include exponential backoff and retry-after headers.
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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…