language-version-migrator
Skill2 starsChanged 38 days agoMITView on GitHub
Ports a codebase across a breaking language or runtime version with compatibility shims, batched automated transforms, dual-runtime CI, and old-vs-new output diffing, ending in a flag-flip cutover with a rollback rule. Use when someone says "migrate us from Python 2 to 3", "we're jumping Node majors", "move to the next Java LTS", or any runtime upgrade where source must change to keep compiling or behaving correctly. Do NOT use for an application framework's major version (React, Rails, Spring) - use framework-upgrader instead; for proving a database schema or data migration is safe, use migration-safety-checker; and skip it entirely when the runtime change is purely operational (base image, CI matrix, deploy target) with no syntax or semantic breaks.
In this repository8 other files it gives its agents.
- business-rule-extractorSkill
- characterization-test-writerSkill
- dead-code-eliminatorSkill
- dependency-risk-auditSkill
- framework-upgraderSkill
- monolith-decomposerSkill
- strangler-fig-plannerSkill
- tdd-expertSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 17 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
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
- could be automatic: a setting could enforce it
- Distinctive: line 13
Run the steps in order. Dependencies gate the interpreter, tests gate the transforms, and the transforms gate the cutover - skipping ahead …
- Distinctive: line 21
Test coverage per module. Any module under roughly 60 percent line coverage on migration-affected paths needs characterization tests first …
- Distinctive: line 36
Add characterization tests on the old runtime first so behavior preservation is provable after the move.
- Distinctive: line 44
Run transforms (2to3, pyupgrade, jscodeshift, OpenRewrite recipes) under these batch rules:
- Distinctive: line 48
Every batch merges to main behind dual compatibility and is revertible with a single git revert.
- Distinctive: line 50
Read and fix semantic changes by hand in separate commits - encoding boundaries, division, hash/ordering stability, default charset, …
- Distinctive: line 54
Keep the suite green on old and new until cutover.
- Distinctive: line 60
Keep the old runtime deployable for at least one full release cycle after cutover.
- Distinctive: line 62
Delete the compatibility shims only after two consecutive green weeks (or one release cycle, whichever is longer) on the new runtime, in a …
- Distinctive: line 100
Every automated transform lands in its own reviewable sub-500-line commit, separate from hand-written semantic fixes.
- Distinctive: line 107
Do NOT blind-merge codemod output - review every hunk.
- Distinctive: line 108
Do NOT flip the interpreter before the dependency tree and shims are in place.
- Distinctive: line 109
Do NOT let a migration branch live unmerged past two weeks - merge dual-compatible batches to main continuously.
- Distinctive: line 110
Do NOT trust pass/fail tests for str/bytes, division, charset, ordering, or timezone changes - diff actual outputs.
- Distinctive: line 111
Do NOT roll back by reverting migration commits after cutover.
- Distinctive: line 112
Do NOT apply the full codemod ceremony when no source changes are required.
- Distinctive: line 113
Do NOT use this for framework major-version upgrades - that is framework-upgrader's job.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Language Version Migrator
Port code across a breaking language or runtime version by making it run on both versions first, then flipping the interpreter. The failure this skill prevents is the big-bang migration branch: a months-long fork that cannot merge, cannot ship, and cannot roll back, where the team discovers the semantic breaks (encoding, division, ordering) in production. Dual compatibility turns cutover into a config flip.
Operating procedure
Run the steps in order. Dependencies gate the interpreter, tests gate the transforms, and the transforms gate the cutover - skipping ahead is how migrations stall.
Step 1: Gather inputs
Collect these before planning. Label any estimate as a guess and refine as the inventory lands.
- Source and target versions, and whether intermediate stops are required (Java 8 to 21 usually staged through 11 and 17; Python 2 to 3 is direct).
- Codebase size: LOC and module count. This sets the batch count.
- Test coverage per module. Any module under roughly 60 percent line coverage on migration-affected paths needs characterization tests first (pair with characterization-test-writer).
- Dependency count and lockfile state. Every dependency needs a compatibility verdict.
- Deployment shape: one deployable or many services (many services migrate independently - sequence leaf services first).
- Deadline and any code-freeze windows.
Step 2: Inventory the breaking surface
Run the official analyzers - 2to3, python-modernize, pyupgrade for Python; jdeps and the JDK migration guide for Java; Node's deprecation list plus the linter's target-version rule for Node. Produce a categorized list: mechanical (renames, removed syntax), semantic (Python 3 str/bytes split and integer division; Java module system and removed javax APIs; Node ESM/CommonJS and removed globals), and dependency-blocked. The mechanical count sizes the codemod work; the semantic count sizes the hand-review work.
Step 3: Sequence dependencies before the interpreter
Resolve the dependency graph for the target runtime first: find compatible versions, upgrade them on the OLD runtime where possible, and flag any library with no compatible release as a separate tracked blocker with an owner. Flip the interpreter only once the tree supports it.
Step 4: Pin behavior where tests are thin
Add characterization tests on the old runtime first so behavior preservation is provable after the move. For data-affecting changes (encoding, numeric, locale), capture real-sample outputs now to diff against later.
Step 5: Make the code dual-compatible
Land changes that pass on BOTH runtimes while still on the old interpreter: future imports or six for Python, conditional polyfills, multi-release JARs for Java. Ship these incrementally to main. This is what turns cutover into a flag flip, not a rewrite.
Step 6: Batch the transforms - automate the mechanical, hand-carve the semantic
Run transforms (2to3, pyupgrade, jscodeshift, OpenRewrite recipes) under these batch rules:
- One module or 10-20 files per batch, whichever keeps the PR under about 500 changed lines - beyond that, review quality collapses and codemod mistakes slip through.
- One transform category per commit (print statements in one, import renames in another). A reviewer must be able to verify a commit by pattern-matching one kind of change.
- Every batch merges to main behind dual compatibility and is revertible with a single git revert. No migration branch lives longer than two weeks unmerged.
Read and fix semantic changes by hand in separate commits - encoding boundaries, division, hash/ordering stability, default charset, timezone handling - because codemods cannot see intent. Treat every I/O and serialization boundary as suspect.
Step 7: Run both runtimes in CI throughout
Keep the suite green on old and new until cutover. For data-affecting changes, gate on actual output comparison old-vs-new on real samples, not just pass/fail.
Step 8: Cut over with an explicit rollback rule
Flip the runtime in CI and deploy config, confirm green, and hold to these rules:
- Keep the old runtime deployable for at least one full release cycle after cutover.
- Rollback trigger: any P0/P1 regression attributable to the migration within 48 hours of cutover reverts the interpreter flip (a config change), never a code revert of the migration commits.
- Delete the compatibility shims only after two consecutive green weeks (or one release cycle, whichever is longer) on the new runtime, in a final dedicated pass so they do not ossify.
Worked artifact: migration plan skeleton
Copy this, fill the fields, and keep it updated per batch.
MIGRATION PLAN - [FILL: repo] - [FILL: from-version] -> [FILL: to-version]
INVENTORY
Mechanical changes (codemod-able): [FILL: count] across [FILL: n] modules
Semantic changes (hand review): [FILL: count] - list: [FILL]
Dependency blockers: [FILL: lib -> status/owner]
Modules under 60% coverage: [FILL] -> characterization tests first
BATCH SCHEDULE (one row per PR, <=500 changed lines each)
# Module/files Transform category Owner Merged?
1 [FILL] [FILL: e.g. imports] [FILL] [ ]
2 [FILL] [FILL] [FILL] [ ]
VERIFICATION
Dual-runtime CI green since: [FILL: date/commit]
Output-diff samples (encoding/num): [FILL: dataset + location]
CUTOVER
Flip date: [FILL]
Rollback trigger: P0/P1 within 48h -> revert runtime config
Old runtime deployable until: [FILL: date, >= 1 release cycle]
Shim deletion PR after: [FILL: 2 green weeks]Deliverable
Produce a filled migration plan (skeleton above) containing the categorized breaking-surface inventory, the dependency compatibility verdicts with blockers and owners, the batch schedule with one transform category per PR, the dual-runtime CI status, and the cutover date with its rollback trigger and shim-deletion date.
Quality bar
- A single codebase passes its full suite on both the old and new runtime before the interpreter is flipped.
- Every automated transform lands in its own reviewable sub-500-line commit, separate from hand-written semantic fixes.
- Encoding, numeric, locale, and serialization changes are validated by diffing real outputs, not by green tests alone.
- Each dependency is either confirmed compatible with the target runtime or recorded as a tracked blocker with an owner.
- The plan names its rollback trigger and the date the old runtime stops being deployable.
Do NOT
- Do NOT blind-merge codemod output - review every hunk; transforms miss dynamic usage and rewrite intent wrong.
- Do NOT flip the interpreter before the dependency tree and shims are in place; a big-bang cutover is the failure mode this skill exists to avoid.
- Do NOT let a migration branch live unmerged past two weeks - merge dual-compatible batches to main continuously.
- Do NOT trust pass/fail tests for str/bytes, division, charset, ordering, or timezone changes - diff actual outputs.
- Do NOT roll back by reverting migration commits after cutover; revert the runtime config flip instead.
- Do NOT apply the full codemod ceremony when no source changes are required; an operational-only runtime bump is a config/infra task.
- Do NOT use this for framework major-version upgrades - that is framework-upgrader's job; for schema/data migration safety, use migration-safety-checker.
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
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.

