agentleFS
chiruu12chiruu12/claude-skills-template/.claude/skills/deprecation-migration/SKILL.md

deprecation-migration

Skill0 starsChanged 7 months agoMITView on GitHub

Plan and execute deprecation and migration paths for APIs, dependencies, or patterns. Ensures nothing breaks during transition. Use when removing old code, upgrading dependencies, migrating between APIs, or when user mentions "deprecate", "migrate", "upgrade", "remove old", or "phase out".

5 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use code-review.

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.
  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 7

    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:

    Remove old things without breaking anything.

    line 12
  2. Distinctive:

    Every caller must have a clear path from old → new:

    line 40
  3. Distinctive:

    Only after ALL callers are migrated:

    line 72
  4. Very specific:

    Verify zero usages remain: grep -rn "oldFunction" src/

    line 74
  5. Distinctive:

    Remove the deprecated code

    line 75
  6. Distinctive:

    Remove any compatibility shims

    line 76
  7. Distinctive:

    No sunset date on deprecated APIs — they'll live forever

    line 91
  8. Distinctive:

    DO NOT: remove without replacing — every deprecation needs a migration path

    line 107

“Common” is measured: kept by at least 6 in 10 of the 5 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

Deprecation and Migration

Remove old things without breaking anything. Every deprecation needs a migration path — a clear route from old to new that callers can follow incrementally. Never remove without replacing, and never replace without a transition period.

When to Use

  • Removing old API endpoints, functions, or modules
  • Upgrading major dependency versions with breaking changes
  • Migrating between services or patterns (e.g., REST → GraphQL)
  • Phasing out deprecated library usage
  • NOT for adding new features alongside old ones — that's just feature development
  • NOT for deleting unused code — just delete it, no migration needed

Process

1. Identify what's changing

Map the scope:

  • What's being deprecated (old API, old pattern, old dependency)?
  • What replaces it (new API, new pattern, new version)?
  • Who depends on the old thing? (internal callers, external consumers, other services)
# Find all callers of the deprecated thing
grep -rn "oldFunction\|OldClass\|old-endpoint" src/ --include="*.ts" --include="*.py"

2. Design the migration path

Every caller must have a clear path from old → new:

Migration TypeStrategy
Internal functionAdd new function, update callers one-by-one, delete old
Public API endpointVersion the API, maintain both, set sunset date
Dependency upgradeUpdate in isolated branch, fix breaking changes, verify tests
Pattern migrationWrite codemod or provide find-replace instructions

3. Mark deprecation

Make the old thing visibly deprecated:

/** @deprecated Use newFunction() instead. Will be removed in v3.0. */
function oldFunction() { ... }
  • Compiler warnings where possible
  • Runtime warnings in dev mode
  • Documentation updated to point to replacement

4. Migrate callers incrementally

Migrate one caller at a time. Each migration is its own commit that:

  • Passes all tests
  • Doesn't change behavior for end users
  • Is independently revertable

5. Remove the deprecated code

Only after ALL callers are migrated:

  • Verify zero usages remain: grep -rn "oldFunction" src/
  • Remove the deprecated code
  • Remove any compatibility shims
  • Update documentation

Common Rationalizations

ShortcutWhy It Fails
"Let's just remove it and fix what breaks"You'll miss callers in tests, scripts, config files, and downstream consumers. The "fix what breaks" approach means production incidents. Incremental migration prevents all of them.
"We'll maintain both forever, it's fine"Technical debt compounds. Two implementations means two things to test, two things to fix when bugs are found, two things to explain to new developers. Set a sunset date.
"Nobody uses the old API anymore"Verify with data, not assumptions. Check logs, grep the codebase, check downstream consumers. "Nobody uses it" has caused more outages than any other assumption.
"The upgrade is small, we can do it in one PR"Major version upgrades have cascading breakage. What looks like "one small change" in the changelog becomes 50 call sites that need updating, each with edge cases. Go incremental.

Red Flags

  • Deprecated code with no replacement documented — callers don't know where to go
  • No sunset date on deprecated APIs — they'll live forever
  • "Big bang" migration PR that changes 100+ files — too risky, should be incremental
  • Removing code without verifying zero remaining callers — breakage incoming

Verification Checklist

  • All callers of deprecated code identified
  • Replacement exists and is documented
  • Migration path is clear (caller knows exactly what to change)
  • Each migration step passes tests independently
  • Zero usages of deprecated code remain after migration
  • Deprecated markers removed along with the code (no orphaned @deprecated tags)
  • Documentation updated to reference only the new approach

Anti-patterns

  • DO NOT remove without replacing — every deprecation needs a migration path
  • DO NOT "big bang" migrate everything in one PR — go caller by caller
  • DO NOT maintain deprecated code indefinitely — set a sunset date and honor it
  • DO NOT assume zero callers without verifying — grep, check logs, check downstream

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.