
Api Versioning Strategy
This gives you the three main API versioning approaches with actual implementation code: URL path versioning (the recommended default), header-based, and query parameters. The version adapter pattern is handy for translating between formats, and there's a solid deprecation workflow with proper HTTP headers like Sunset and successor-version links. The best part is the practical guidance on what counts as a breaking change versus a safe one, plus a realistic 7-month deprecation timeline. If you're spinning up a new API or finally dealing with that v1 you've been maintaining for three years, this covers the decision points and gives you copy-paste starting code for Express routes.
- skills.sh installs
- 410
- GitHub stars
- 248
- last updated
- Aug 21, 2026
Install
$ npx -y skills add secondsky/claude-skills --skill api-versioning-strategy --agent claude-codeInstalls into .claude/skills of the current project.
Files
API Versioning Strategy
Choose and implement API versioning approaches with proper deprecation timelines.
Versioning Methods
| Method | Example | Pros | Cons |
|---|---|---|---|
| URL Path | /api/v1/users | Clear, cache-friendly | URL clutter |
| Header | API-Version: 1 | Clean URLs | Hidden, harder to test |
| Query | ?version=1 | Easy to use | Not RESTful |
URL Path Versioning (Recommended)
const v1Router = require('./routes/v1');
const v2Router = require('./routes/v2');
app.use('/api/v1', v1Router);
app.use('/api/v2', v2Router);
Version Adapter Pattern
// Transform between versions
const v1ToV2 = (v1Response) => ({
data: {
type: 'user',
id: v1Response.user_id,
attributes: {
name: v1Response.user_name,
email: v1Response.email
}
}
});
Deprecation Headers
app.use('/api/v1', (req, res, next) => {
res.setHeader('Deprecation', 'true');
res.setHeader('Sunset', 'Sat, 01 Jun 2025 00:00:00 GMT');
res.setHeader('Link', '</api/v2>; rel="successor-version"');
next();
});
Safe vs Breaking Changes
Sponsors
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Backend & APIs, Productivity & Planning
- First seen
- Jun 3, 2026
More from secondsky/claude-skills
All 146- Claude Code Bash Patterns408
- Claude Hook Writer408
- Logging Best Practices408
- Cloudflare Manager407
- Plan Interview406
- Ml Pipeline Automation402
- Nuxt Core401
- Nuxt Data400
- Microservices Patterns398
- Multi Ai Consultant397
- Graphql Implementation393
- Mcp Management393
- Model Deployment393
- Jest Generator391
- Cloudflare Agents389
- Cloudflare Mcp Server388
- Thesys Generative Ui384
- Access Control Rbac381
- Maz Ui380
- React Best Practices380
- Woocommerce Backend Dev379
- Woocommerce Code Review379
- Bun Hono Integration376
- Bun Test Basics375