Contract
- Input: backend service inventory, traffic profile, auth requirements, and SLA targets.
- Output: gateway architecture with route rules, policies, auth configuration, and observability plan.
- Scope: stay within the skill's declared boundaries; do not broaden without explicit direction.
- Rule: documented standards override defaults; explicit project rules take precedence.
- Rule: if blocked by missing context or dependencies, surface the blocker before proceeding.
Provenance
| Question |
Answer |
| What is the source of truth? |
The user's request, originating spec/issue, and the skill's declared outputs |
| What is in scope? |
Work covered by the skill's acceptance criteria and completion rules |
| What is explicitly out of scope? |
Files, behaviors, and decisions outside the skill's declared boundary |
| Who or what consumes this artifact afterward? |
The next skill in the workflow or the user |
| What evidence proves it is done? |
Completion criteria met, artifact saved, validation passed |
| What risk remains? |
Subjective judgment calls, missing context, or external dependency failures |
Artifact
Emit ApiGatewayArtifact as both:
- JSON:
.agents/skills/platform/artifacts/api-gateway/{identifier}.json
- Markdown view: same filename with
.md extension
API Gateway
Use this skill when designing or reviewing an API gateway layer — Kong, Envoy, AWS API Gateway, or similar — for routing, rate limiting, authentication, and observability.
Process
1. Catalog backend services
- Inventory all internal services, their paths, versions, and owners.
- Define service contract: expected request/response shapes and auth requirements.
- Map dependencies between services and external APIs.
Completion criterion: service catalog documented with routes, versions, and owners.
2. Design routing rules
- Define path-based, host-based, and header-based routing rules.
- Plan versioning strategy (path prefix, header, or query parameter).
- Configure retries, timeouts, circuit breaking, and fallback routes.
Completion criterion: routing rules documented with precedence and fallback behavior.
3. Configure rate limiting and quotas
- Set per-client, per-route, or per-user rate limits based on SLA.
- Define burst allowance, quota periods, and limit-by headers.
- Plan graceful degradation when limits are exceeded (429 with Retry-After).
Completion criterion: rate limit matrix documented with enforcement strategy.
4. Implement authentication and authorization
- Choose auth mechanism per route: API key, JWT, OAuth2, mTLS, or custom.
- Configure upstream credential injection or header transformation.
- Define auth failure behavior (401, 403, redirect) and token validation rules.
Completion criterion: auth strategy per route documented with token handling.
5. Configure request transformation
- Plan request/response body and header transformation rules.
- Define caching policies for idempotent GET requests.
- Set up CORS, request/response logging, and payload size limits.
Completion criterion: transformation and caching rules documented.
6. Plan observability and operations
- Design gateway metrics: request rate, error rate, latency, upstream health.
- Configure distributed tracing propagation and log enrichment.
- Document rollout, rollback, and canary routing for gateway config changes.
Completion criterion: observability and operational runbook documented.
Rules
- Rule: enforce TLS termination and HSTS at the gateway edge.
- Rule: reject malformed requests before they reach backend services.
- Rule: keep route rules and policies as code; version control gateway configuration.
- Rule: log request metadata (not sensitive payloads) for audit and debugging.
- Rule: define health check endpoints and upstream failure behavior explicitly.
- Rule: test gateway config changes in staging with production-like traffic before deploy.
Completion
- the skill's completion criteria are explicitly checked
- the artifact is saved and validated
- any blockers or skipped validations are documented
- the next consumer is identified or the work is handed off
@include .agents/skills/platform/contract-base.xml
1---2name: "api-gateway"3category: "backend"4maturity: "stable"5version: "1"6description: "API gateway (Kong, Envoy, AWS API Gateway, rate limiting, auth, routing)."7license: "MIT"8capabilities:9 - apply api gateway methods within explicit backend boundaries10 - analyze api gateway (kong, envoy, aws api gateway, rate limiting, auth, routing) with assumptions, constraints, and failure modes11 - produce and validate a backend artifact with evidence, decisions, and next steps12outputs: "gateway architecture with route rules, policies, auth configuration, and observability plan."13sideEffects: []14dependencies: []15stopCondition: "API gateway design complete; artifact saved; completion criteria checked."16risk: "medium"17trustTier: "3"18maxIterations: "6"19promptVersion: "2.0"20artifactType: "plan"21modelTier: "reasoning"22evaluators: ["behavioral", "regression"]23fixturesPath: .agents/skills/platform/fixtures/behavioral/api-gateway.json24diataxis: "how-to"25tags: ["backend"]26compatibility: []27approvalRequired: "true"28approvalFor: []29metadata:30 source: https://skillmd.com/skills/quantumquirkxyz/api-gateway31---3233## Contract3435- Input: backend service inventory, traffic profile, auth requirements, and SLA targets.36- Output: gateway architecture with route rules, policies, auth configuration, and observability plan.37- Scope: stay within the skill's declared boundaries; do not broaden without explicit direction.38- Rule: documented standards override defaults; explicit project rules take precedence.39- Rule: if blocked by missing context or dependencies, surface the blocker before proceeding.4041## Provenance4243| Question | Answer |44|---|---|45| What is the source of truth? | The user's request, originating spec/issue, and the skill's declared outputs |46| What is in scope? | Work covered by the skill's acceptance criteria and completion rules |47| What is explicitly out of scope? | Files, behaviors, and decisions outside the skill's declared boundary |48| Who or what consumes this artifact afterward? | The next skill in the workflow or the user |49| What evidence proves it is done? | Completion criteria met, artifact saved, validation passed |50| What risk remains? | Subjective judgment calls, missing context, or external dependency failures515253## Artifact5455Emit `ApiGatewayArtifact` as both:56- JSON: `.agents/skills/platform/artifacts/api-gateway/{identifier}.json`57- Markdown view: same filename with `.md` extension585960# 61# 62# API Gateway6364Use this skill when designing or reviewing an API gateway layer — Kong, Envoy, AWS API Gateway, or similar — for routing, rate limiting, authentication, and observability.656667## Process6869### 1. Catalog backend services70- Inventory all internal services, their paths, versions, and owners.71- Define service contract: expected request/response shapes and auth requirements.72- Map dependencies between services and external APIs.7374**Completion criterion:** service catalog documented with routes, versions, and owners.7576### 2. Design routing rules77- Define path-based, host-based, and header-based routing rules.78- Plan versioning strategy (path prefix, header, or query parameter).79- Configure retries, timeouts, circuit breaking, and fallback routes.8081**Completion criterion:** routing rules documented with precedence and fallback behavior.8283### 3. Configure rate limiting and quotas84- Set per-client, per-route, or per-user rate limits based on SLA.85- Define burst allowance, quota periods, and limit-by headers.86- Plan graceful degradation when limits are exceeded (429 with Retry-After).8788**Completion criterion:** rate limit matrix documented with enforcement strategy.8990### 4. Implement authentication and authorization91- Choose auth mechanism per route: API key, JWT, OAuth2, mTLS, or custom.92- Configure upstream credential injection or header transformation.93- Define auth failure behavior (401, 403, redirect) and token validation rules.9495**Completion criterion:** auth strategy per route documented with token handling.9697### 5. Configure request transformation98- Plan request/response body and header transformation rules.99- Define caching policies for idempotent GET requests.100- Set up CORS, request/response logging, and payload size limits.101102**Completion criterion:** transformation and caching rules documented.103104### 6. Plan observability and operations105- Design gateway metrics: request rate, error rate, latency, upstream health.106- Configure distributed tracing propagation and log enrichment.107- Document rollout, rollback, and canary routing for gateway config changes.108109**Completion criterion:** observability and operational runbook documented.110111## Rules112113- Rule: enforce TLS termination and HSTS at the gateway edge.114- Rule: reject malformed requests before they reach backend services.115- Rule: keep route rules and policies as code; version control gateway configuration.116- Rule: log request metadata (not sensitive payloads) for audit and debugging.117- Rule: define health check endpoints and upstream failure behavior explicitly.118- Rule: test gateway config changes in staging with production-like traffic before deploy.119120## Completion121122- the skill's completion criteria are explicitly checked123- the artifact is saved and validated124- any blockers or skipped validations are documented125- the next consumer is identified or the work is handed off126---127@include .agents/skills/platform/contract-base.xml