Skip to main content
skill CX Codex

api-gateway-patterns · nickcrew — Claude Code skill: what it does, how to install

api-gateway-patterns — a skill for API gateway design in microservices: routing, authentication, rate limiting, and request composition.

MIT 101 installs ★ 71 updated 2026-06-29

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add NickCrew/Claude-Cortex --skill api-gateway-patterns -a claude-code
Open on GitHub

What api-gateway-patterns does

The skill provides references and checklists for implementing API gateways (Kong, Nginx, Envoy, AWS API Gateway) and the Backend for Frontend pattern. Covers path- and header-based routing, centralized authentication (JWT, OAuth, RBAC), traffic management (circuit breakers, retry logic), service call composition and aggregation. Includes references for service discovery, request transformation, and observability setup.

Works in projects with **/*.http, **/openapi.*, **/swagger.*, **/api/**, **/services/**, **/microservice/**, and **/service/**/handlers/** files. Author recommends keeping the gateway lightweight: delegate complex business logic to services, handle routing, security, and cross-cutting concerns like logging at the gateway level.

What it helps with

  • design a BFF layer for mobile, web, and admin clients
  • configure JWT validation and API key management at the gateway
  • add rate limiting and circuit breakers to protect services from overload
  • aggregate multiple backend calls into a single client response
  • integrate service discovery and dynamic routing

Example prompts for the agent

  • Load the routing patterns reference from skills/api-gateway-patterns/references/routing-patterns.md and suggest a scheme for three client types
  • Show a Kong config example for JWT authentication with RBAC using skills/api-gateway-patterns/references/authentication.md
  • Suggest a rate limiting strategy for a public API — load skills/api-gateway-patterns/references/traffic-management.md

How to install api-gateway-patterns

1Skills CLI (Vercel)

npx skills add NickCrew/Claude-Cortex --skill api-gateway-patterns -a claude-code

2Manually: put the files in place

~/.claude/skills/api-gateway-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/api-gateway-patterns/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about api-gateway-patterns

How to install api-gateway-patterns in Claude Code?

Run npx skills add NickCrew/Claude-Cortex --skill api-gateway-patterns -a claude-code, the skill will appear at ~/.claude/skills/api-gateway-patterns/SKILL.md.

What does the api-gateway-patterns skill do?

Provides references for API gateway design: routing, authentication, rate limiting, request composition, service discovery integration. Suited for microservices architectures with Kong, Nginx, Envoy, AWS API Gateway.

Which files activate the api-gateway-patterns skill?

The skill activates in projects with **/*.http, **/openapi.*, **/swagger.*, **/api/**, **/services/**, **/microservice/**, and **/service/**/handlers/** files.

Source text

SKILL.md · MIT
---
name: api-gateway-patterns
description: API Gateway patterns for routing, authentication, rate limiting, and service composition in microservices architectures. Use when implementing API gateways, building BFF layers, or managing service-to-service communication at scale.
keywords:
  - API gateway
  - BFF
  - Kong
  - Nginx
  - backend for frontend
  - gateway pattern
  - load balancing
  - rate limiting
  - request routing
  - reverse proxy
file_patterns:
  - '**/*.http'
  - '**/api/**'
  - '**/microservice/**'
  - '**/openapi.*'
  - '**/service/**/handlers/**'
  - '**/services/**'
  - '**/swagger.*'
confidence: 0.8
---

# API Gateway Patterns

Expert guidance for implementing API gateways with routing, authentication, traffic management, and service composition patterns for microservices architectures at scale.

## When to Use This Skill

- Implementing API gateway infrastructure for microservices
- Designing Backend for Frontend (BFF) layers
- Adding authentication and authorization at the gateway level
- Implementing rate limiting, circuit breakers, and retry logic
- Setting up service discovery and dynamic routing
- Building API composition and aggregation layers
- Managing cross-cutting concerns (logging, monitoring, CORS)
- Evaluating gateway solutions (Kong, Nginx, Envoy, AWS API Gateway)

## Core Concepts

### Gateway Responsibilities
**Routing**: Direct requests to appropriate backend services based on path, headers, or host
**Security**: Centralized authentication, authorization, and API key validation
**Traffic Management**: Rate limiting, circuit breakers, retry logic
**Composition**: Aggregate multiple service calls into unified responses
**Transformation**: Modify requests/responses for client optimization or legacy adaptation

### Architecture Patterns
**Single Gateway**: One gateway for all clients (simple, potential bottleneck)
**BFF Pattern**: Separate gateway per client type (mobile, web, admin) - optimized for each
**GraphQL Gateway**: Schema stitching across services, client-driven data fetching
**Service Mesh**: Distributed gateway pattern with sidecar proxies (Istio, Linkerd)

## Quick Reference

| Task | Load reference |
| --- | --- |
| Routing strategies (path, header, host-based) | `skills/api-gateway-patterns/references/routing-patterns.md` |
| Request/response transformation | `skills/api-gateway-patterns/references/transformation.md` |
| API composition and aggregation | `skills/api-gateway-patterns/references/composition.md` |
| Authentication & authorization (JWT, OAuth, RBAC) | `skills/api-gateway-patterns/references/authentication.md` |
| Traffic management (rate limiting, circuit breakers) | `skills/api-gateway-patterns/references/traffic-management.md` |
| Backend for Frontend (BFF) pattern | `skills/api-gateway-patterns/references/bff-pattern.md` |
| Service discovery integration | `skills/api-gateway-patterns/references/service-discovery.md` |
| Gateway implementations (Kong, Nginx, Envoy, AWS) | `skills/api-gateway-patterns/references/implementations.md` |

## Implementation Workflow

### Phase 1: Requirements Analysis
1. **Identify client types**: Mobile, web, admin, partners
2. **Map service landscape**: Catalog backend services and endpoints
3. **Define cross-cutting concerns**: Auth, logging, monitoring, CORS
4. **Determine composition needs**: Which endpoints require aggregation?
5. **Establish SLAs**: Latency, throughput, availability targets

### Phase 2: Gateway Design
1. **Choose architecture**: Single gateway vs BFF vs GraphQL
2. **Select implementation**: Kong, Nginx, Envoy, AWS API Gateway
3. **Design routing rules**: Path-based, header-based, host-based
4. **Plan authentication**: JWT, OAuth 2.0, API keys, or hybrid
5. **Define traffic policies**: Rate limits, circuit breakers, timeouts

### Phase 3: Implementation
1. **Set up infrastructure**: Deploy gateway instances, configure load balancer
2. **Implement routing**: Configure service discovery and route definitions
3. **Add authentication**: JWT validation, OAuth integration, API key management
4. **Apply traffic management**: Rate limiting, circuit breakers, retry logic
5. **Enable observability**: Distributed tracing, metrics, structured logging

### Phase 4: Testing & Optimization
1. **Load testing**: Verify performance under expected and peak load
2. **Failure injection**: Test circuit breakers and retry logic
3. **Security testing**: Verify auth flows, token validation, RBAC policies
4. **Latency optimization**: Cache strategies, connection pooling
5. **Monitor and tune**: Adjust timeouts, limits based on real traffic

## Best Practices

1. **Centralize Cross-Cutting Concerns**: Authentication, logging, monitoring at gateway
2. **Keep Gateway Lightweight**: Avoid complex business logic, delegate to services
3. **Implement Health Checks**: Monitor upstream service health, remove unhealthy instances
4. **Use Circuit Breakers**: Prevent cascading failures, fail fast
5. **Apply Rate Limiting**: Protect services from overload, implement tiered limits
6. **Enable Observability**: Distributed tracing, metrics, structured logging
7. **Version APIs**: Support multiple API versions, plan deprecation
8. **Secure Communication**: TLS everywhere, mutual TLS for service-to-service
9. **Cache Strategically**: Response caching, but invalidate properly
10. **Test Resilience**: Chaos engineering, failure injection, load testing

## Common Mistakes

1. **Business Logic in Gateway**: Keep gateway focused on routing/security, not business rules
2. **Chatty Composition**: Too many upstream calls (use BFF, GraphQL, or caching)
3. **Single Point of Failure**: Deploy redundantly, use load balancers
4. **No Timeout Configuration**: Always set connection/read timeouts to prevent hanging requests
5. **Ignoring Backpressure**: Implement queue limits, graceful degradation
6. **Over-Aggregation**: Don't make gateway do too much work (compute-heavy transformations)
7. **Inadequate Monitoring**: Must track latency, errors, throughput at gateway level
8. **No Rate Limiting**: Services will be overwhelmed eventually without protection
9. **Synchronous Everything**: Use async patterns for non-critical operations
10. **No Version Strategy**: Breaking changes break all clients simultaneously

## Resources

- **Kong**: https://docs.konghq.com/gateway/latest/
- **Nginx**: https://nginx.org/en/docs/
- **Envoy**: https://www.envoyproxy.io/docs/envoy/latest/
- **AWS API Gateway**: https://docs.aws.amazon.com/apigateway/
- **Patterns**: "Microservices Patterns" by Chris Richardson
- **Service Mesh**: https://istio.io/latest/docs/
- **Circuit Breakers**: Martin Fowler's CircuitBreaker pattern
- **BFF Pattern**: Sam Newman's "Building Microservices"

© NickCrew · MIT · NickCrew/Claude-Cortex

Similar skills

All skills for Backend and APIs →

api-gateway-patterns by other authors comes first.

api-gateway-patterns manutej api-gateway-patterns is a Claude Code skill for designing API gateways with Kong. It comes into play when routing microservice requests or setting traffic and authentication policies. CX Codex +1 482installs api-gateway-configuration aj-geddes api-gateway-configuration is a Claude Code skill that configures routing, authentication, and rate limiting for API gateways. Activates when deploying microservices and reverse proxies. CX Codex +1 509installs analyzing-api-gateway-access-logs mahipal The analyzing-api-gateway-access-logs skill parses API Gateway access logs and flags BOLA/IDOR, rate-limit bypass, credential scanning, and injection attempts. CX Codex +1 795installs connecting-lambda-to-api-gateway aws connecting-lambda-to-api-gateway — a skill that walks the agent through wiring an existing Lambda function into Amazon API Gateway: resources, methods, proxy integration, permissions and deploy. CX Codex +1 7,400installs creating-api-gateway-stage aws creating-api-gateway-stage is a Claude Code skill that creates API Gateway stages with CloudWatch logging, X-Ray, WAF, and IAM roles for REST API deployment across dev, test, and production. CX Codex +1 7,100installs api-gateway-backend-security-and-rate-limiting official google api-gateway-backend-security-and-rate-limiting is a Claude Code, Gemini CLI, and Codex skill that configures client and backend authentication and request quotas on Google Cloud API Gateway, including MCP-enabled gateways. CX Codex +1 360installs alibabacloud-nginx-ingress-to-api-gateway aliyun alibabacloud-nginx-ingress-to-api-gateway migrates Kubernetes nginx Ingress to Alibaba Cloud API Gateway. Analyzes YAML locally, classifies annotations, generates Higress config and migration report. CX Codex +1 152installs

From the same set21

The whole set →
event-driven-architecture The event-driven-architecture skill guides event-driven system design with event sourcing, CQRS, sagas, and message brokers. Use it for microservices and distributed transactions. CX Codex +1 118installs dashboard-designer The dashboard-designer Claude Code skill plans dashboard KPIs, layout, and visual hierarchy. It activates for requests about monitoring dashboards or choosing a BI tool. CX Codex +1 109installs terraform-best-practices terraform-best-practices adds enterprise Terraform guidelines covering module layout, secure remote state, workspace isolation, and CI/CD security scanning. CX Codex +1 109installs mermaid-diagramming mermaid-diagramming gets the agent to write Mermaid diagrams for docs: flowcharts, sequence and ER diagrams, state machines, Gantt charts and architecture views. CX Codex +1 105installs kubernetes-security-policies kubernetes-security-policies — a coding-agent skill that walks through Kubernetes hardening: pod security standards, network policies, RBAC. Useful when a cluster needs tightening before production. CX Codex +1 104installs user-journey-mapping The user-journey-mapping Claude Code skill lays out user journeys with stages, touchpoints, emotions, and friction points. It activates for experience mapping or conversion-flow analysis. CX Codex +1 102installs tutorial-design tutorial-design guides you through writing hands-on tutorials, workshops, and coding guides with explicit checkpoints and troubleshooting sections. CX Codex +1 102installs requirements-discovery The requirements-discovery Claude Code skill gathers requirements, sets project boundaries, and structures PRDs. It activates for feature discovery, stakeholder interviews, or specification reviews. CX Codex +1 101installs

Project sponsors

Companies that keep this analytics open