Designs gateway routing and policies: route matching, rate limit tiers, JWT validation, and failover before implementation.
Agentic Workflow: Read -> Reason -> Act (api-gateway-routing-design)
You are Api Gateway Routing Design (infrastructure) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — infrastructure context for api-gateway-routing-design
- Domain: Designs gateway routing and policies: route matching, rate limit tiers, JWT validation, and failover before implementation.
- routing-design: Design route matching rules: paths, hosts, headers, and methods —
node -e "const r={paths:['/api/v1/orders'],hosts:['api.example.com'],methods:['G
- policy-design: Design rate limit tiers, quotas, and auth policies —
node -e "const tiers={free:{minute:10},pro:{minute:120},enterprise:{minute:1000}
- Check
knowledge and prerequisites: kong, traefik, aws-cli
2. Reason — think for api-gateway-routing-design
- For
routing-design: Design route matching rules: paths, hosts, headers, and methods — decide which checks to run
- For
policy-design: Design rate limit tiers, quotas, and auth policies — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-gateway-routing-design tools
- Tools:
Glob, Grep, Read, Bash (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-gateway-routing-design:50499283
API Gateway (Design)
Designs gateway routes and policies before wiring them up.
When to Use
- Planning gateway rollout
- Defining rate-limit tiers
- Deciding route ownership
Real Commands
# Route model
node -e "const r={paths:['/api/v1/orders'],hosts:['api.example.com'],methods:['GET','POST']};console.log(JSON.stringify(r,null,2))"
# Tiers
node -e "const tiers={free:{minute:10},pro:{minute:120},enterprise:{minute:1000}};console.log(JSON.stringify(tiers,null,2))"
# Consumers
curl -s -X POST http://localhost:8001/consumers -H 'Content-Type: application/json' -d '{"username":"acme"}'
curl -s -X POST http://localhost:8001/consumers/acme/plugins -H 'Content-Type: application/json' -d '{"name":"rate-limiting","config":{"minute":120}}'
Design Checklist
- Versioned path prefixes
- Internal vs public route split
- Per-tier quotas and burst allowances
Testing
Probe each tier's limit and verify 429 responses carry retry headers.
Best Practices
- Design routes before plugins
- Key limits by consumer, not IP
Capabilities
routing-design
Design route matching rules: paths, hosts, headers, and methods
Parameters:
path (string): Route path
host (string): Route host
Commands:
node -e "const r={paths:['/api/v1/orders'],hosts:['api.example.com'],methods:['GET','POST']};console.log(JSON.stringify(r,null,2))"
node -e "console.log('priority: method > header > path > host')"
curl -s -H 'Host: api.example.com' http://localhost:8000/api/v1/orders -o /dev/null -w '%{http_code}'
node -e "const routes=['/api/v1/*','/internal/*','/healthz'];console.log(routes.join('\n'))"
curl -s http://localhost:8000/healthz -o /dev/null -w '%{http_code}'
Examples:
policy-design
Design rate limit tiers, quotas, and auth policies
Parameters:
consumer (string): Consumer name
tier (string): Rate limit tier
Commands:
node -e "const tiers={free:{minute:10},pro:{minute:120},enterprise:{minute:1000}};console.log(JSON.stringify(tiers,null,2))"
node -e "console.log('burst: 2x rate, keyed by consumer id')"
curl -s -X POST http://localhost:8001/consumers -H 'Content-Type: application/json' -d '{"username":"acme"}'
curl -s -X POST http://localhost:8001/consumers/acme/plugins -H 'Content-Type: application/json' -d '{"name":"rate-limiting","config":{"minute":120}}'
curl -s -X POST http://localhost:8001/consumers/acme/key-auth -H 'Content-Type: application/json' -d '{}'
Examples:
References
1---2name: "api-gateway-routing-design"3description: "Designs gateway routing and policies: route matching, rate limit tiers, JWT validation, and failover before implementation. Use when working with routing design, policy design or when the user mentions routing design, policy design."4license: "MIT"5compatibility: "Requires kong, traefik, aws-cli, docker, kubernetes. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/api-gateway-routing-design8 author: Kdesk9 version: 2.0.010 category: infrastructure11allowed-tools: "Glob Grep Read Bash(curl:*) Bash(node:*)"12---1314Designs gateway routing and policies: route matching, rate limit tiers, JWT validation, and failover before implementation.1516## Agentic Workflow: Read -> Reason -> Act (api-gateway-routing-design)1718You are **Api Gateway Routing Design** (infrastructure) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — infrastructure context for `api-gateway-routing-design`21- Domain: Designs gateway routing and policies: route matching, rate limit tiers, JWT validation, and failover before implementation.22- **routing-design**: Design route matching rules: paths, hosts, headers, and methods — `node -e "const r={paths:['/api/v1/orders'],hosts:['api.example.com'],methods:['G`23- **policy-design**: Design rate limit tiers, quotas, and auth policies — `node -e "const tiers={free:{minute:10},pro:{minute:120},enterprise:{minute:1000}`24- Check `knowledge` and `prerequisites: kong, traefik, aws-cli`2526### 2. Reason — think for `api-gateway-routing-design`27- For `routing-design`: Design route matching rules: paths, hosts, headers, and methods — decide which checks to run28- For `policy-design`: Design rate limit tiers, quotas, and auth policies — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-gateway-routing-design` tools32- Tools: `Glob`, `Grep`, `Read`, `Bash` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `api-gateway-routing-design:50499283`3536# API Gateway (Design)3738Designs gateway routes and policies before wiring them up.3940## When to Use41- Planning gateway rollout42- Defining rate-limit tiers43- Deciding route ownership4445## Real Commands4647```bash48# Route model49node -e "const r={paths:['/api/v1/orders'],hosts:['api.example.com'],methods:['GET','POST']};console.log(JSON.stringify(r,null,2))"5051# Tiers52node -e "const tiers={free:{minute:10},pro:{minute:120},enterprise:{minute:1000}};console.log(JSON.stringify(tiers,null,2))"5354# Consumers55curl -s -X POST http://localhost:8001/consumers -H 'Content-Type: application/json' -d '{"username":"acme"}'56curl -s -X POST http://localhost:8001/consumers/acme/plugins -H 'Content-Type: application/json' -d '{"name":"rate-limiting","config":{"minute":120}}'57```5859## Design Checklist60- Versioned path prefixes61- Internal vs public route split62- Per-tier quotas and burst allowances6364## Testing65Probe each tier's limit and verify 429 responses carry retry headers.6667## Best Practices68- Design routes before plugins69- Key limits by consumer, not IP7071## Capabilities7273### routing-design74Design route matching rules: paths, hosts, headers, and methods7576**Parameters:**77- `path` (string): Route path78- `host` (string): Route host7980**Commands:**81- `node -e "const r={paths:['/api/v1/orders'],hosts:['api.example.com'],methods:['GET','POST']};console.log(JSON.stringify(r,null,2))"`82- `node -e "console.log('priority: method > header > path > host')"`83- `curl -s -H 'Host: api.example.com' http://localhost:8000/api/v1/orders -o /dev/null -w '%{http_code}'`84- `node -e "const routes=['/api/v1/*','/internal/*','/healthz'];console.log(routes.join('\n'))"`85- `curl -s http://localhost:8000/healthz -o /dev/null -w '%{http_code}'`8687**Examples:**88- node -e "const r={paths:['/api/v1/orders'],hosts:['api.example.com'],methods:['GET','POST']};console.log(JSON.stringify(r,null,2))"89- curl -s -H 'Host: api.example.com' http://localhost:8000/api/v1/orders -o /dev/null -w '%{http_code}'90- curl -s http://localhost:8000/healthz -o /dev/null -w '%{http_code}'9192### policy-design93Design rate limit tiers, quotas, and auth policies9495**Parameters:**96- `consumer` (string): Consumer name97- `tier` (string): Rate limit tier9899**Commands:**100- `node -e "const tiers={free:{minute:10},pro:{minute:120},enterprise:{minute:1000}};console.log(JSON.stringify(tiers,null,2))"`101- `node -e "console.log('burst: 2x rate, keyed by consumer id')"`102- `curl -s -X POST http://localhost:8001/consumers -H 'Content-Type: application/json' -d '{"username":"acme"}'`103- `curl -s -X POST http://localhost:8001/consumers/acme/plugins -H 'Content-Type: application/json' -d '{"name":"rate-limiting","config":{"minute":120}}'`104- `curl -s -X POST http://localhost:8001/consumers/acme/key-auth -H 'Content-Type: application/json' -d '{}'`105106**Examples:**107- node -e "const tiers={free:{minute:10},pro:{minute:120},enterprise:{minute:1000}};console.log(JSON.stringify(tiers,null,2))"108- curl -s -X POST http://localhost:8001/consumers/acme/plugins -H 'Content-Type: application/json' -d '{"name":"rate-limiting","config":{"minute":120}}'109- curl -s -X POST http://localhost:8001/consumers/acme/key-auth -H 'Content-Type: application/json' -d '{}'110111## References112- [Kong Routing](https://docs.konghq.com/gateway/latest/key-concepts/routes/)113- [Rate Limiting Design](https://docs.konghq.com/hub/kong-inc/rate-limiting/)