legacy-migration
Legacy Migration (Forward Pass)
The forward half of a reverse-first modernization: given an audit of a legacy system, decide the route, specify the target, and implement it in reviewable slices. The guiding move: don't pick a stack first. The instinct is "rewrite it in ." The process does the opposite — tally the audit's findings, score candidate routes against the constraints that actually matter, and pick the route whose weaknesses the organization can live with. That turns an engineering opinion into an engineering decision, and a scored decision defends itself when stakeholders push back: you don't say "trust me," you show the scoreboard.
Prerequisite: the audit
This skill consumes audit artifacts — at minimum a severity-tagged bug catalog (docs/BUGS-MITIGATIONS.md or equivalent) and ideally per-file analyses. The audit is the specification: when the reading and cataloging were done properly, the rewrite plan almost falls out of them, and the rewrite team's job becomes designing the cataloged problems out, not porting them across.
If no audit exists, stop and say so. Designing a migration for a system nobody understands reproduces every landmine in a new language. Offer to run the audit first (use the legacy-audit skill if available). Don't accept "we've eyeballed it, let's just rewrite" — even a throwaway verdict requires understanding what's being thrown away.
Phase 8: Choose the route
Read references/route-scoring.md, then:
- Gather constraints from the user — budget, timeline, team size and actual skills, must-keep integrations (reporting engines, file formats, hardware), deployment targets, and required fidelity to the original (pixel-faithful vs. workflow-faithful vs. spirit-faithful).
- Generate 4–6 candidate routes spanning genuinely different strategies, not just different languages: keep-and-remediate, incremental/strangler migration, automated translation + cleanup, greenfield rewrites in 2–3 plausible stacks.
- Score every route against every constraint, with honest effort ranges and honest weaknesses. No free options exist; pretending otherwise destroys the decision's credibility.
- Recommend one, with the trade-off reasoning stated plainly (e.g., "the codebase is small enough that the translation tool's license costs more than the time it saves, and 150 cataloged bugs are easier to design out than to fix in place").