/custom-plugin-api-design:versioningfrom custom-plugin-api-design
API versioning strategies and backward compatibility
Ships in custom-plugin-api-design. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Choose and implement API versioning strategies.
| Strategy | Format | Pros | Cons |
|---|---|---|---|
| URL path | /api/v1/users | Clear, cacheable | URL pollution |
| Header | Accept: application/vnd.api.v1+json | Clean URLs | Hidden |
| Query param | /api/users?version=1 | Flexible | Unconventional |
# Version in path
/api/v1/users # Current stable
/api/v2/users # New version
/api/v3-beta/users # Pre-release
# Version-specific routing
app.use('/api/v1', v1Router);
app.use('/api/v2', v2Router);
# Request
Accept: application/vnd.myapi.v1+json
# Response
Content-Type: application/vnd.myapi.v1+json
# Sunset header
Sunset: Sat, 31 Dec 2025 23:59:59 GMT
Deprecation: true
Link: </api/v2/users>; rel="successor-version"
# Response body warning
{
"data": {...},
"warnings": [
{
"type": "deprecation",
"message": "This endpoint is deprecated. Use /api/v2/users instead.",
"sunset": "2025-12-31"
}
]
}
# Migration from v1 to v2
## Breaking Changes
### User endpoint
- `GET /api/v1/users/{id}` → `GET /api/v2/users/{id}`
- Response field `fullName` renamed to `name`
### Before (v1)
{
"id": "123",
"fullName": "John Doe"
}
### After (v2)
{
"id": "123",
"name": "John Doe"
}
## Timeline
- v2 available: January 2025
- v1 deprecated: March 2025
- v1 removed: December 2025
describe('API Versioning', () => {
it('should route to v1 handler', async () => {
await request(app)
.get('/api/v1/users')
.expect(200);
});
it('should include deprecation headers for old version', async () => {
const res = await request(app)
.get('/api/v1/users')
.expect(200);
expect(res.headers.deprecation).toBe('true');
expect(res.headers.sunset).toBeDefined();
});
});
| Issue | Cause | Solution |
|---|---|---|
| Clients use wrong version | No redirect | Add version negotiation |
| Breaking change missed | No detection | Use schema diff tools |
| Sunset too short | Client migration time | Minimum 6 month notice |
What SKILL.md sets; muted values are Claude Code's defaults
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, commands: Invalid input, agents: Invalid input, skills: Invalid input
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
12 skills in this plugin
/api-architectureREST, GraphQL, and hybrid API architecture patterns for building scalable and maintainable APIs/backend-patternsProduction-grade backend patterns for Node.js, Python, Go, and Java/Spring frameworks/database-patternsDatabase design, optimization, and caching strategies for SQL, NoSQL, and Redis/devops-patternsInfrastructure, deployment, and operations patterns for Docker, Kubernetes, and CI/CD