본문으로 건너뛰기
cccskills
무료GitHub에 공개

api-versioning

Manage API versioning and evolution with URL/header/query strategies, deprecation workflows, breaking change classification, sunset headers, and consumer-driven contract testing. Use when designing versioning strategy, deprecating endpoints, or evolving API contracts.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md6.4 KB
  • references/typescript.md4.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

API Versioning & Evolution

APIs are contracts with consumers. Breaking that contract destroys trust. This skill covers how to version, evolve, and deprecate APIs without breaking clients.

Stack-Specific References

After reading the methodology below, read the reference matching your surface's framework:

FrameworkReference
TypeScript / Node.jsreferences/typescript.md

Versioning Strategies

StrategyExampleProsCons
URL path/api/v2/modelsObvious, cacheable, easy routingURL represents resource not version; copies endpoints
HeaderAPI-Version: 2Clean URLs, content negotiationHidden from browser, harder to test
Query param/api/models?version=2Easy to test, no routing changesPollutes query string, cache key complexity
Accept headerAccept: application/vnd.api.v2+jsonProper content negotiationVerbose, often misunderstood

Recommendation

Use URL path versioning for public APIs (simplicity and discoverability). Use header versioning for internal/partner APIs (cleaner resource model).


Default Version Behavior

StrategyBehaviorWhen to Use
Default to latestUnversioned requests get the newest versionInternal APIs with controlled consumers
Default to oldest supportedUnversioned requests get V1Public APIs (avoid surprise breakage)
Require explicit versionReturn 400 if no version specifiedStrict APIs where ambiguity is unacceptable

Breaking vs Non-Breaking Changes

Non-Breaking (Safe to Ship)

ChangeExampleWhy It Is Safe
Add optional field to response"avatar_url": "..." addedClients ignore unknown fields
Add optional query parameter?sort=name now supportedExisting queries still work
Add new endpointPOST /api/v1/webhooksDoes not affect existing endpoints
Widen accepted input typesField accepts `stringnumber`
Add optional request field"metadata": {} now acceptedExisting requests without it still work
Relax validationMax length 100 → 200Previously valid inputs still valid

Breaking (Requires New Version)

ChangeExampleWhy It Breaks
Remove field from responseprice_per_token removedClients reading this field break
Rename fieldprice_per_token → pricingClients reading old name break
Change field typeprice from number to objectParsing breaks
Remove endpointDELETE /api/v1/legacyClients calling it get 404
Add required request field"region" now requiredExisting requests missing it fail
Tighten validationMax length 200 → 100Previously valid inputs rejected
Change error response formatDifferent error shapeClient error handling breaks
Change authentication schemeBearer token → API keyAuth headers break

Additive-Only API Policy

The safest evolution strategy: never remove or rename, only add.

V1 response:
  { id, name, price_per_token }

V1.1 response (additive — no new version needed):
  { id, name, price_per_token, pricing: { input, output, currency, unit } }

Clients reading price_per_token still work.
New clients use pricing object.
Remove price_per_token only in V2.

Sunset Headers and Deprecation Workflow

Sunset Header (RFC 8594)

Every deprecated endpoint/version must include these headers:

  • Deprecation: true
  • Sunset: <HTTP date> — when this version will stop working
  • Link: <migration-url>; rel="sunset"

Deprecation Timeline

PhaseDurationActions
AnnounceT-6 monthsAdd Deprecation: true header, publish migration guide
WarnT-3 monthsAdd Sunset header with date, email consumers
MonitorT-1 monthTrack usage, notify active consumers directly
SunsetT-0Return 410 Gone with migration link
RemoveT+3 monthsRemove code (keep tests to prevent regression)

Consumer-Driven Contract Testing

Consumers define the contract they depend on. The provider runs these contracts in CI.

Concept:

  1. Each API consumer writes contract tests specifying fields they depend on
  2. Provider runs ALL consumer contracts in CI before deploy
  3. If a consumer contract breaks, the deploy is blocked
  4. Adding new fields never breaks contracts (consumers ignore unknown fields)

Changelog Automation

Conventional Commits for API Changes

feat(api): add /api/v1/webhooks endpoint
fix(api): correct pagination cursor encoding in /api/v1/models
deprecate(api): mark /api/v1/legacy/search as deprecated
breaking(api): remove price_per_token field from /api/v2/models response

Migration Guides

Every version bump must include a migration guide:

  1. Timeline — deprecation date, sunset date, removal date
  2. Breaking changes — before/after for each changed field or endpoint
  3. Migration steps — numbered steps to update client code
  4. Testing instructions — how to verify migration works

Anti-Patterns

Anti-PatternCorrect Approach
Increment version for every changeVersion only on breaking changes
Remove old version without noticeFollow deprecation timeline (6+ months)
Different versioning per endpointConsistent strategy across the entire API
Version in the response body onlyUse URL path or headers — visible and consistent
No default version behaviorDefine and document the default
Breaking change without migration guideEvery breaking change needs a guide
No consumer notificationEmail, changelog, and headers all used together

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit and improve web accessibility following WCAG 2.1 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

RepairYourTech/cfsa-antigravity62026년 8월 16일 업데이트

Structured methodology for adversarial thinking — generating attack scenarios, abuse cases, race conditions, and security edge cases against specs and implementations. Produces spec-level gap items, not code-level fixes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

RepairYourTech/cfsa-antigravity62026년 8월 16일 업데이트

Orchestrate multiple Antigravity skills through guided workflows for SaaS MVP delivery, security audits, AI agent builds, and browser QA.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

RepairYourTech/cfsa-antigravity62026년 8월 16일 업데이트

Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

RepairYourTech/cfsa-antigravity62026년 8월 16일 업데이트

Analyzes codebase structure, data flow, module relationships, and key patterns to generate and maintain a living architecture document (ARCHITECTURE.md).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

RepairYourTech/cfsa-antigravity62026년 8월 16일 업데이트

Orchestrate ambiguity auditing across selected layers with rubric-driven scoring, remediation flow, and next-step gating

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

RepairYourTech/cfsa-antigravity62026년 8월 16일 업데이트

RepairYourTech의 스킬 모두 보기

이 스킬의 문제 신고