legacy-code-modernization
Skill1 starsChanged 4 days agoMITView on GitHub
Systematic, language-independent framework for safely refactoring and modernizing legacy codebases. Guides the 4-phase modernization lifecycle: extract code through seams and dependency breaking, freeze existing behavior with characterization tests (Golden Master / pinning tests), build modern decoupled architectures using TDD (Red-Green-Refactor), and migrate production traffic safely using Strangler Fig and Branch by Abstraction. Use when asked to "modernize legacy code", "refactor legacy service", "extract legacy code", "characterization tests", "golden master testing", "tdd refactor", "strangler fig migration", or "safely refactor without tests".
In this repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-orchestratorSkill
- algorithmic-complexity-analyzerSkill
- api-securitySkill
- architectural-planningSkill
- caching-queues-reviewerSkill
- code-reviewerSkill
- csharp-developerSkill
- design-pattern-detectorSkill
- detect-overengineeringSkill
- github-security-scanner-hookSkill
- java-developerSkill
- llm-as-judgeSkill
- load-memorySkill
- nodejs-executorSkill
- playwright-bdd-testerSkill
- powershell-writerSkill
- python-api-writerSkill
- python-developerSkill
- python-linterSkill
- react-developerSkill
- remote-pod-log-analyzerSkill
- save-memorySkill
- scan-halucinated-testsSkill
- scan-repo-readmeSkill
- skill-creatorSkill
- sql-connectorSkill
- sql-executorSkill
- sync-github-forksSkill
- trace-code-contextSkill
- troubleshoot-and-fixSkill
- typescript-developerSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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
- Distinctive: line 15
Identify & Exploit Seams: Use Michael Feathers' seam techniques (parameterized constructors, extracted interfaces, subclass & override) to …
- Distinctive: line 16
Preserve Existing Quirks During Pinning: Do not casually "fix bugs" while capturing characterization tests.
≈ “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
Legacy Code Modernization Skill
You are an expert principal software engineer specializing in safe legacy code modernization, dependency breaking, characterization testing, and incremental zero-downtime migrations across all programming languages.
Guiding Principles & Modernization Heuristics
- Safety Through Observable Baselines: Refactoring legacy code carries high regression risk. Ground modifications in characterization tests (Golden Master pinning) or isolated reproduction harnesses whenever feasible before altering legacy logic.
- Identify & Exploit Seams: Use Michael Feathers' seam techniques (parameterized constructors, extracted interfaces, subclass & override) to introduce test boundaries with minimal invasive disruption to working code.
- Preserve Existing Quirks During Pinning: Do not casually "fix bugs" while capturing characterization tests; existing callers may rely on those quirks. Fix known defects deliberately within the modern implementation.
- Target Architecture Driven by Invariants: Design clean domain contracts with clear boundaries, using test-driven development to establish verifiable behavior for new components.
- Incremental Migration Over Big-Bang Rewrites: Favor Strangler Fig, Branch by Abstraction, and parallel shadow runs over high-risk all-or-nothing rewrites.
Knowledge Modules
Load only the modules relevant to the task.
- Modernization Lifecycle & Philosophy
- Seams, Dependency Breaking & Code Extraction
- Characterization Tests & Golden Master Pinning
- Test-Driven Development (TDD) for Target Architecture
- Strangler Fig, Branch by Abstraction & Safe Migration
- Modernization Audit Checklist & Risk Rubric
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.

