Configures API gateway middleware using Kong Gateway and decK: global plugins like rate-limiting, key-auth, request-transformer, and CORS applied at the gateway edge.
Agentic Workflow: Read -> Reason -> Act (api-middleware-kong-plugins)
You are Api Middleware Kong Plugins (backend) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — backend context for api-middleware-kong-plugins
- Domain: Configures API gateway middleware using Kong Gateway and decK: global plugins like rate-limiting, key-auth, request-transformer, and CORS applied at the gateway edge.
- kong-plugins: Apply global and per-service middleware plugins on Kong Gateway —
docker run -d --name kong -p 8000:8000 -p 8443:8443 -p 8001:8001 kong/kong-gatew
- plugin-operations: Inspect, update, and remove gateway middleware plugins via the Kong Admin API —
curl -s http://localhost:8001/plugins -G --data-urlencode "name=key-auth" | jq '
- Check
knowledge and prerequisites: node.js, python, express, fastify
2. Reason — think for api-middleware-kong-plugins
- For
kong-plugins: Apply global and per-service middleware plugins on Kong Gateway — decide which checks to run
- For
plugin-operations: Inspect, update, and remove gateway middleware plugins via the Kong Admin API — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-middleware-kong-plugins tools
- Tools:
Glob, Grep, Read, Bash (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-middleware-kong-plugins:3d0e66ef
API Middleware v5 - Gateway Edge
Middleware implemented as Kong Gateway plugins.
What This Skill Does
- Applies rate limiting, key-auth, CORS, and request transformation at the gateway
- Manages plugins as declarative config with decK
- Moves cross-cutting concerns out of service code
When to Use
- Centralizing auth and throttling across many services
- Applying CORS at the edge instead of per service
- Auditing middleware config in version control
Real Commands
docker run -d --name kong -p 8000:8000 -p 8001:8001 kong/kong-gateway
curl -s -X POST http://localhost:8001/plugins -d 'name=rate-limiting' -d 'config.minute=60'
curl -s -X POST http://localhost:8001/plugins -d 'name=key-auth'
Plugin Operations
- Filter plugins by name with --data-urlencode
- Update config in place with PATCH
- Remove plugins with DELETE
Testing
- POST to /plugins then hit the proxy route to observe 429 or 401
- Run deck gateway diff before syncing changes
- Verify plugin order matches execution phases (auth before rate-limit)
Best Practices
- Prefer decK files over Admin API mutations for reproducibility
- Scope plugins per route when global behavior differs
- Keep secrets out of declarative config via vault references
Capabilities
kong-plugins
Apply global and per-service middleware plugins on Kong Gateway
Parameters:
plugin-name (string): Kong plugin: rate-limiting, key-auth, cors, request-transformer
config (object): Plugin-specific config (minute, allow list, header names)
scope (string): Global, per-service, per-route, or per-consumer plugin scope
Commands:
docker run -d --name kong -p 8000:8000 -p 8443:8443 -p 8001:8001 kong/kong-gateway
curl -s http://localhost:8001/plugins | jq '.data | length'
curl -s -X POST http://localhost:8001/plugins -d 'name=rate-limiting' -d 'config.minute=60'
curl -s -X POST http://localhost:8001/plugins -d 'name=key-auth'
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8000/api
Examples:
- curl -s -X POST localhost:8001/plugins -d 'name=rate-limiting' -d 'config.minute=60' applies global limits
- deck gateway sync kong.yaml applies plugins from declarative config
- curl -s localhost:8001/plugins returns installed gateway middleware
plugin-operations
Inspect, update, and remove gateway middleware plugins via the Kong Admin API
Commands:
curl -s http://localhost:8001/plugins -G --data-urlencode "name=key-auth" | jq '.data[0] | {name, enabled}'
curl -s -X PATCH http://localhost:8001/plugins/$(curl -s http://localhost:8001/plugins | jq -r '.data[0].id') -d 'config.minute=120'
curl -s -X DELETE http://localhost:8001/plugins/$(curl -s http://localhost:8001/plugins | jq -r '.data[0].id') -o /dev/null -w '%{http_code}\n'
curl -s http://localhost:8001/plugins -o /dev/null -w '%{http_code}\n'
Examples:
- curl with --data-urlencode filters plugins by name
- PATCH updates plugin config in place
- DELETE removes a middleware plugin
References
1---2name: "api-middleware-kong-plugins"3description: "Configures API gateway middleware using Kong Gateway and decK: global plugins like rate-limiting, key-auth, request-transformer, and CORS applied at the gateway edge. Use when working with kong plugins, plugin operations or when the user mentions kong plugins, plugin operations."4license: "MIT"5compatibility: "Requires node.js, python, express, fastify, koa. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/api-middleware-kong-plugins8 author: Kdesk9 version: 2.0.010 category: backend11allowed-tools: "Glob Grep Read Bash(curl:*) Bash(docker:*)"12---1314Configures API gateway middleware using Kong Gateway and decK: global plugins like rate-limiting, key-auth, request-transformer, and CORS applied at the gateway edge.1516## Agentic Workflow: Read -> Reason -> Act (api-middleware-kong-plugins)1718You are **Api Middleware Kong Plugins** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — backend context for `api-middleware-kong-plugins`21- Domain: Configures API gateway middleware using Kong Gateway and decK: global plugins like rate-limiting, key-auth, request-transformer, and CORS applied at the gateway edge.22- **kong-plugins**: Apply global and per-service middleware plugins on Kong Gateway — `docker run -d --name kong -p 8000:8000 -p 8443:8443 -p 8001:8001 kong/kong-gatew`23- **plugin-operations**: Inspect, update, and remove gateway middleware plugins via the Kong Admin API — `curl -s http://localhost:8001/plugins -G --data-urlencode "name=key-auth" | jq '`24- Check `knowledge` and `prerequisites: node.js, python, express, fastify`2526### 2. Reason — think for `api-middleware-kong-plugins`27- For `kong-plugins`: Apply global and per-service middleware plugins on Kong Gateway — decide which checks to run28- For `plugin-operations`: Inspect, update, and remove gateway middleware plugins via the Kong Admin API — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-middleware-kong-plugins` 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-middleware-kong-plugins:3d0e66ef`3536# API Middleware v5 - Gateway Edge3738Middleware implemented as Kong Gateway plugins.3940## What This Skill Does41- Applies rate limiting, key-auth, CORS, and request transformation at the gateway42- Manages plugins as declarative config with decK43- Moves cross-cutting concerns out of service code4445## When to Use46- Centralizing auth and throttling across many services47- Applying CORS at the edge instead of per service48- Auditing middleware config in version control4950## Real Commands5152```bash53docker run -d --name kong -p 8000:8000 -p 8001:8001 kong/kong-gateway54curl -s -X POST http://localhost:8001/plugins -d 'name=rate-limiting' -d 'config.minute=60'55curl -s -X POST http://localhost:8001/plugins -d 'name=key-auth'56```5758## Plugin Operations59- Filter plugins by name with --data-urlencode60- Update config in place with PATCH61- Remove plugins with DELETE6263## Testing64- POST to /plugins then hit the proxy route to observe 429 or 40165- Run deck gateway diff before syncing changes66- Verify plugin order matches execution phases (auth before rate-limit)6768## Best Practices69- Prefer decK files over Admin API mutations for reproducibility70- Scope plugins per route when global behavior differs71- Keep secrets out of declarative config via vault references7273## Capabilities7475### kong-plugins76Apply global and per-service middleware plugins on Kong Gateway7778**Parameters:**79- `plugin-name` (string): Kong plugin: rate-limiting, key-auth, cors, request-transformer80- `config` (object): Plugin-specific config (minute, allow list, header names)81- `scope` (string): Global, per-service, per-route, or per-consumer plugin scope8283**Commands:**84- `docker run -d --name kong -p 8000:8000 -p 8443:8443 -p 8001:8001 kong/kong-gateway`85- `curl -s http://localhost:8001/plugins | jq '.data | length'`86- `curl -s -X POST http://localhost:8001/plugins -d 'name=rate-limiting' -d 'config.minute=60'`87- `curl -s -X POST http://localhost:8001/plugins -d 'name=key-auth'`88- `curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8000/api`8990**Examples:**91- curl -s -X POST localhost:8001/plugins -d 'name=rate-limiting' -d 'config.minute=60' applies global limits92- deck gateway sync kong.yaml applies plugins from declarative config93- curl -s localhost:8001/plugins returns installed gateway middleware9495### plugin-operations96Inspect, update, and remove gateway middleware plugins via the Kong Admin API9798**Commands:**99- `curl -s http://localhost:8001/plugins -G --data-urlencode "name=key-auth" | jq '.data[0] | {name, enabled}'`100- `curl -s -X PATCH http://localhost:8001/plugins/$(curl -s http://localhost:8001/plugins | jq -r '.data[0].id') -d 'config.minute=120'`101- `curl -s -X DELETE http://localhost:8001/plugins/$(curl -s http://localhost:8001/plugins | jq -r '.data[0].id') -o /dev/null -w '%{http_code}\n'`102- `curl -s http://localhost:8001/plugins -o /dev/null -w '%{http_code}\n'`103104**Examples:**105- curl with --data-urlencode filters plugins by name106- PATCH updates plugin config in place107- DELETE removes a middleware plugin108109## References110- [Kong Gateway Plugins](https://docs.konghq.com/gateway/latest/reference/proxy-reference/)111- [decK Documentation](https://docs.konghq.com/deck/)