agentleFS
AmirAzyAmirAzy/HoNspot/skills/plan-migration/SKILL.md

plan-migration

Skill2 starsChanged 8 days agoMITView on GitHub

Plan a framework, runtime, dependency or schema upgrade that touches many files, without a big-bang rewrite. Use when asked to upgrade to a new major version, replace a library, split a monolith, move a package between repos, or when a previous migration stalled half-finished and left two ways of doing the same thing.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. krzysztofsurdy/code-virtuoso★ 36same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository8 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Not for: a mechanical rename in three files, or a single dependency patch.

    line 18
  2. Distinctive:

    Every step leaves the project working and shippable: If a step cannot be shipped, it is not a step, it is a branch.

    line 24
  3. Distinctive:

    Remove the scaffolding deliberately: When the last old path is gone: delete the compatibility layer, the flag, the deprecated module and …

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Plan a migration that can be abandoned halfway

The danger in a migration is not the change; it is the state you are in when it stops. A plan is only as good as the point it can be safely paused at, reverted from, or finished by someone who is not you.

When to use

  • A major version bump, a runtime upgrade, a library replacement, or a monolith split.
  • A previous migration left the codebase with two conventions and nobody remembers which is current.
  • Someone proposes "we'll just rewrite it" for anything larger than a day of work.

Not for: a mechanical rename in three files, or a single dependency patch.

Ground rules

  1. Inventory before you plan. You cannot schedule work whose size you have not counted, and you cannot claim "it is nearly done" without a denominator.
  2. Every step leaves the project working and shippable. If a step cannot be shipped, it is not a step, it is a branch.
  3. Codemods over hand-editing, and a reviewable diff over a heroic one.
  4. Two ways of doing something is a temporary state with an end date, written down, or it becomes permanent — the fixture that never gets deleted.
  5. The compatibility matrix is the plan. Old and new versions, and which combinations are legal, decide the ordering more than anything else.
  6. Know the abort point. What exactly would make you stop, and what does the tree look like when you do.

Procedure

  1. Inventory the surface. Count the call sites, the files, the packages and the APIs in play, with a command, not an impression:

    rg -l 'oldApiName' | wc -l            # files to touch
    rg -c 'oldApiName' | sort -t: -k2 -nr | head   # where the weight is
    npm ls old-package                     # who depends on it, directly and transitively
  2. Read the upgrade guide and write the breaking changes as a checklist, in your own words, each with a detection command. Anything you cannot detect, you cannot verify.
  3. Build the compatibility matrix: which versions of the toolchain, runtime and dependencies may coexist. This usually dictates a strict ordering (runtime first, or the framework first) that saves days of dead ends.
  4. Choose the strategy and say why:

    StrategyUse whenCost
    Incremental with a compatibility layerMany call sites, live productExtra abstraction to remove later
    Strangler (new path alongside old, switch by flag or route)Behaviour change, need gradual rolloutTwo paths running at once; needs an end date
    Codemod then manual reviewPurely mechanical API renameNothing, if the codemod is verifiable
    Big-bang rewriteSmall surface, no users mid-flight, strong test suiteAll the risk lands at once
  5. Order the steps by "what unblocks the most" and "what is reversible". Put the reversible, high-leverage work first; leave irreversible data migrations for last, behind a backup.
  6. Add the verification before the change. A test, a type check, a golden file or a snapshot that fails for the old behaviour makes the migration mechanical. If the suite is too thin to catch a regression, that is the first task, not an excuse.
  7. Run the steps as separate pull requests, each with: what changed, what proves it, what is still on the old path, and the remaining count (63 / 214 call sites). Visible progress is what keeps a migration from stalling.
  8. Remove the scaffolding deliberately. When the last old path is gone: delete the compatibility layer, the flag, the deprecated module and every leftover note, in one final commit.

Anti-patterns

Tempting moveWhy it is wrong
A branch that lives for weeksIt merges as a conflict generator, and nobody can review it
"We'll fix the warnings later"Later is a second migration, on top of this one
Keeping the old and new API both "for safety"That is not safety, that is two products
Migrating and refactoring in the same commitWhen it breaks, you cannot tell which change did it
Rewriting tests to match new behaviour mid-migrationYou have deleted the evidence that the behaviour was meant to stay
No inventory, so "80 % done" for a monthWithout a denominator, progress is unmeasurable and morale collapses

Definition of done

  • Inventory with a command and a number; the number is at zero.
  • Compatibility constraints were written down and respected.
  • Every step shipped independently and left the project working.
  • The old path, flag and compatibility layer are deleted, not deprecated.
  • The test suite proves the behaviour survived; any behaviour that changed on purpose is listed.
  • Documentation and examples updated — a migration that leaves the docs on the old API is half done.
  • The rollback story is gone on purpose: you can roll back the deployment, not the change.

Report format

Goal:        <old → new, and why now>
Surface:     <count> call sites in <count> files, <count> packages
Strategy:    <incremental | strangler | codemod | big-bang>, because <one sentence>
Order:       <the steps, in order, with the reason for the order>
Risk:        <the irreversible part, and its backup>
Progress:    <n / total>, and what is left
Abort point: <what would stop this, and the tree state if it does>

A worked template, including the compatibility matrix and the per-PR description, is in references/migration-template.md.

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.