Implements API versioning in Express: URL path versioning, version routing, versioned controllers, and default version behavior.
Agentic Workflow: Read -> Reason -> Act (api-version-engineer)
You are api-version-engineer (backend) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — backend context for api-version-engineer
- Domain: Implements API versioning in Express: URL path versioning, version routing, versioned controllers, and default version behavior.
- url-versioning: Route requests by versioned URL paths —
node -e "const express=require('express'); const app=express(); app.use('/v1', r
- version-router: Structure versioned routers and shared middleware —
node -e "const fs=require('fs'); console.log(fs.existsSync('routes/v2/users.js')
- Check
knowledge and prerequisites: node.js, python, openapi
2. Reason — think for api-version-engineer
- For
url-versioning: Route requests by versioned URL paths — decide which checks to run
- For
version-router: Structure versioned routers and shared middleware — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-version-engineer tools
- Tools:
Glob, Grep, Read, Bash (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-version-engineer:7787f0a3
API Version Engineer
URL-based API versioning.
What This Skill Does
- Mounts versioned routers at /v1, /v2 paths
- Keeps versions in isolated modules
- Controls default version behavior
When to Use
- Public APIs with external consumers
- Adding breaking changes safely
- Supporting multiple client cohorts
Real Commands
node -e "const express=require('express'); const app=express(); app.use('/v1', require('./v1Routes')); app.use('/v2', require('./v2Routes')); app.listen(3000)"
curl -s http://localhost:3000/v1/users | jq '.apiVersion'
curl -s http://localhost:3000/v2/users | jq '.apiVersion'
Structure
routes/
v1/users.js
v2/users.js
Testing
- Test each version independently
- Verify default version behavior
- Assert unknown versions 404 cleanly
Best Practices
- Keep version routers thin
- Share only stable middleware
- Document sunset dates per version
Capabilities
url-versioning
Route requests by versioned URL paths
Parameters:
version (string): Version prefix like v1 or v2
router (string): Router module path
default-version (string): Version served at the bare path
Commands:
node -e "const express=require('express'); const app=express(); app.use('/v1', require('./v1Routes')); app.use('/v2', require('./v2Routes')); app.listen(3000)"
curl -s http://localhost:3000/v1/users | jq '.apiVersion'
curl -s http://localhost:3000/v2/users | jq '.apiVersion'
curl -s http://localhost:3000/users -o /dev/null -w '%{http_code}\n'
Examples:
- app.use('/v1', v1Routes) mounts versioned routers
- curl /v2/users hits the current version
- Unversioned paths can 404 or default
version-router
Structure versioned routers and shared middleware
Commands:
node -e "const fs=require('fs'); console.log(fs.existsSync('routes/v2/users.js'))"
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:3000/v9/users
curl -s http://localhost:3000/v1/users | jq '.count'
Examples:
References
1---2name: "api-version-engineer"3description: "Implements API versioning in Express: URL path versioning, version routing, versioned controllers, and default version behavior. Use when working with url versioning, version router or when the user mentions url versioning, version router."4license: "MIT"5compatibility: "Requires node.js, python, openapi, postman, stoplight-studio. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/api-version-engineer8 author: Kdesk9 version: 2.0.010 category: backend11allowed-tools: "Glob Grep Read Bash(curl:*) Bash(node:*)"12---1314Implements API versioning in Express: URL path versioning, version routing, versioned controllers, and default version behavior.1516## Agentic Workflow: Read -> Reason -> Act (api-version-engineer)1718You are **api-version-engineer** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — backend context for `api-version-engineer`21- Domain: Implements API versioning in Express: URL path versioning, version routing, versioned controllers, and default version behavior.22- **url-versioning**: Route requests by versioned URL paths — `node -e "const express=require('express'); const app=express(); app.use('/v1', r`23- **version-router**: Structure versioned routers and shared middleware — `node -e "const fs=require('fs'); console.log(fs.existsSync('routes/v2/users.js')`24- Check `knowledge` and `prerequisites: node.js, python, openapi`2526### 2. Reason — think for `api-version-engineer`27- For `url-versioning`: Route requests by versioned URL paths — decide which checks to run28- For `version-router`: Structure versioned routers and shared middleware — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-version-engineer` 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-version-engineer:7787f0a3`3536# API Version Engineer3738URL-based API versioning.3940## What This Skill Does41- Mounts versioned routers at /v1, /v2 paths42- Keeps versions in isolated modules43- Controls default version behavior4445## When to Use46- Public APIs with external consumers47- Adding breaking changes safely48- Supporting multiple client cohorts4950## Real Commands5152```bash53node -e "const express=require('express'); const app=express(); app.use('/v1', require('./v1Routes')); app.use('/v2', require('./v2Routes')); app.listen(3000)"54curl -s http://localhost:3000/v1/users | jq '.apiVersion'55curl -s http://localhost:3000/v2/users | jq '.apiVersion'56```5758## Structure5960```61routes/62 v1/users.js63 v2/users.js64```6566## Testing67- Test each version independently68- Verify default version behavior69- Assert unknown versions 404 cleanly7071## Best Practices72- Keep version routers thin73- Share only stable middleware74- Document sunset dates per version7576## Capabilities7778### url-versioning79Route requests by versioned URL paths8081**Parameters:**82- `version` (string): Version prefix like v1 or v283- `router` (string): Router module path84- `default-version` (string): Version served at the bare path8586**Commands:**87- `node -e "const express=require('express'); const app=express(); app.use('/v1', require('./v1Routes')); app.use('/v2', require('./v2Routes')); app.listen(3000)"`88- `curl -s http://localhost:3000/v1/users | jq '.apiVersion'`89- `curl -s http://localhost:3000/v2/users | jq '.apiVersion'`90- `curl -s http://localhost:3000/users -o /dev/null -w '%{http_code}\n'`9192**Examples:**93- app.use('/v1', v1Routes) mounts versioned routers94- curl /v2/users hits the current version95- Unversioned paths can 404 or default9697### version-router98Structure versioned routers and shared middleware99100**Commands:**101- `node -e "const fs=require('fs'); console.log(fs.existsSync('routes/v2/users.js'))"`102- `curl -s -o /dev/null -w '%{http_code}\n' http://localhost:3000/v9/users`103- `curl -s http://localhost:3000/v1/users | jq '.count'`104105**Examples:**106- -cli --help107- -api --help108109## References110- [Express Routing](https://expressjs.com/en/guide/routing.html)111- [Stripe API Versioning Guide](https://docs.stripe.com/api/versioning)