agentleFS
qyndexqyndex/claude-init/.claude/skills/api-versioning/SKILL.md

api-versioning

Skill2 starsChanged 5 months agoMITView on GitHub

Manage public API version transitions — v2-alongside-v1, Deprecation/Sunset headers, client migration tracker. Use when a breaking API change is needed but cannot ship as a wire-break.

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use dependency-injection, openapi and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • HamzaSheikh768Skill

    dependency-injection

    Leverages FastAPI's powerful Depends system for reusable authentication, database sessions, rate limiting, and business logic injection.

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    openapi

    OpenAPI/Swagger specification and documentation

    Also in 3 projects that use this

  • diego-tobalinaSkill

    logging

    Logging best practices for Java (SLF4J/Logback) and Node.js (Winston/Pino). Use for structured logging, log levels, and avoiding sensitive data exposure.

    Also in 3 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Both versions must be tested: Don't let v1 rot during the transition.

    line 80
  2. Distinctive:

    Sunset day is announced once and held: Don't extend repeatedly — credibility erodes.

    line 81
  3. Very specific:

    410 Gone for ≥ 90 days post-sunset: before deleting endpoints.

    line 82

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

API Versioning

Public APIs can't break clients. This skill encodes the v2-alongside-v1 dance with explicit sunset.

When to version

ChangeRequires version bump
Add a new field (response)No — additive, no bump
Add a new optional request paramNo
Remove a fieldYES — breaking
Change a field typeYES
Change a field's semantic meaningYES
Tighten validationUsually YES (may reject previously-valid input)
Change error codeYES
Change auth schemeYES
Rename endpointYES

Process

  1. Decide cut-line — what changes go into v2 (don't drip; one v2 per logical theme).
  2. Build v2 alongside v1. Both endpoints live. v1 stays as-is.
  3. Announce deprecation — v1 endpoints emit Deprecation: <ISO-date> and Sunset: <ISO-date> HTTP headers (RFC 8594).
  4. Track client migration — query analytics for v1 usage; identify top callers; reach out.
  5. Reduce v1 traffic — month-by-month migration; report % migrated weekly.
  6. Final warning — 30 days before sunset, emit louder warnings (log + status page).
  7. Sunset — v1 returns 410 Gone with migration guide URL. Keep 410 for ≥ 90 days.
  8. Remove — delete v1 code, schema, tests. Update SDK / docs / OpenAPI spec.

Per-endpoint deprecation header

HTTP/1.1 200 OK
Content-Type: application/json
Deprecation: Sat, 28 May 2027 00:00:00 GMT
Sunset: Wed, 28 Nov 2027 00:00:00 GMT
Link: <https://api.example.com/v2/users>; rel="successor-version"
Link: <https://docs.example.com/migrate/v1-to-v2>; rel="deprecation"

Tracking artifact

# .claude/memory/deprecations/api-v1.yaml
api: v1
announced: 2026-05-28
sunset: 2027-11-28
successor: v2

endpoints:
  - path: GET /v1/users
    successor: GET /v2/users
    callers:
      total: 247
      migrated: 198
      remaining:
        - { client: "mobile-ios v3.4", contact: "@mobile" }
        - { client: "internal-cron", contact: "@platform" }
        - { client: "partner XYZ", contact: "partners@example.com" }

  - path: GET /v1/orders
    successor: GET /v2/orders
    callers:
      total: 89
      migrated: 89
      remaining: []   # safe to sunset early

Hard rules

  • 6-month minimum sunset window for external APIs. 90-day minimum for internal.
  • Both versions must be tested. Don't let v1 rot during the transition.
  • Sunset day is announced once and held. Don't extend repeatedly — credibility erodes.
  • 410 Gone for ≥ 90 days post-sunset before deleting endpoints. Some clients are slow.
  • Migration guide is required. Link from the deprecation header.

CI gates

  • New endpoint adds Deprecation/Sunset headers if /deprecate-api was run on it
  • E2E tests cover both v1 and v2 until v1 is removed
  • Spec lists v2's supersedes: referring to v1's spec

References

  • RFC 8594 — Sunset HTTP header
  • IETF draft — Deprecation header field
  • See also: .claude/memory/deprecations/REGISTRY.md
  • /deprecate-api command

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.