secondsky avatar

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-code

Installs into .claude/skills of the current project.

Files

API Versioning Strategy

Choose and implement API versioning approaches with proper deprecation timelines.

Versioning Methods

MethodExampleProsCons
URL Path/api/v1/usersClear, cache-friendlyURL clutter
HeaderAPI-Version: 1Clean URLsHidden, harder to test
Query?version=1Easy to useNot 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
1patricio0312rev avatarapi-docs-generatorpatricio0312rev/skillsGenerates API documentation using OpenAPI/Swagger specifications with interactive documentation, code examples, and SDK generation. Use when users request "API 407skills.sh installs
2martinholovsky avatarweb-audio-apimartinholovsky/claude-skills-generatorWeb Audio API for JARVIS audio feedback and voice processing406skills.sh installs
3tivojn avatargoogle-maps-apitivojn/google-maps-api-skillComplete Google Maps Platform API client - 20+ APIs including geocoding, routes, places, weather, air quality, pollen, solar, elevation, timezone, address valid403skills.sh installs
4umbraco avatarumbraco-context-apiumbraco/umbraco-cms-backoffice-skillsUnderstand and use Context API in Umbraco backoffice (foundational concept)402skills.sh installs
5sickn33 avatarvector-database-engineersickn33/antigravity-awesome-skillsvector database engineer392skills.sh installs
6gocallum avatarmcp-server-skillsgocallum/nextjs16-agent-skillsPattern for building MCP servers in Next.js with mcp-handler, shared Zod schemas, and reusable server actions.387skills.sh installs