legacy-code-refactorer
SkillDev toolsFormulates safe Mikado Method refactoring dependency graphs and Strangler Fig extraction paths for fragile legacy codebases.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the legacy-code-refactorer skill
What this skill tells your AI
The instructions your AI receives, as published by codebygarv/ai-skills in skills/development/legacy-code-refactorer/SKILL.md and read by ahel’s review.
Purpose
Plan safe, incremental refactorings of complex, untested legacy codebases using proven methodologies (Mikado Method, Characterization Testing, Strangler Fig pattern, Seams) without breaking production behavior.
When to Use
- Refactoring sprawling 3,000-line "God classes" or legacy spaghetti functions.
- Untangling deeply coupled monolithic code with zero existing unit tests.
- Modernizing ancient callback-hell or global-state architectures into clean, testable interfaces.
What to Analyze
- Characterization Tests (Golden Master): Capture existing behavior with black-box snapshot tests before touching code.
- Mikado Graph: Map dependency prerequisites to identify leaf nodes that can be refactored safely first.
- Seam Identification: Find places where behavior can be intercepted and mocked without editing core logic.
- Extract Interface & Dependency Injection: Replace direct static class instantiation with injected interfaces.
- Incremental Verification: Ensure every micro-step leaves the codebase in a releasable, passing state.
Output Format
- Mikado Refactoring Dependency Tree: Step-by-step ordered graph of prerequisite tasks.
- Characterization Test Harness: Safety-net test verifying existing input/output contracts.
- Before / After Code Diffs: Clean step-by-step refactoring transformations.
Avoid
- Attempting a "Big Bang" rewrite from scratch that never reaches production.
- Refactoring internal logic before establishing characterization test safety nets.
Signals
- GitHub stars
- 25
- Forks
- 1
- Last commit
- Aug 2026
Advanced
- Catalog kind
- skill
- Gateway key
legacy-code-refactorer- Source
- github.com/codebygarv/ai-skills