legacy-code-refactorer
Skill26 starsChanged 4 months agoMITView on GitHub
Formulates safe Mikado Method refactoring dependency graphs and Strangler Fig extraction paths for fragile legacy codebases.
In this repository119 other files it gives its agents.
- adr-writerSkill
- architecture-reviewerSkill
- cache-strategy-plannerSkill
- cost-optimization-auditorSkill
- cqrs-event-sourcing-designerSkill
- disaster-recovery-plannerSkill
- event-driven-architectSkill
- feature-flag-lifecycle-managerSkill
- migration-plannerSkill
- multi-tenant-data-partitionerSkill
- project-plannerSkill
- rate-limiting-architectSkill
- tech-debt-assessorSkill
- zero-downtime-migration-plannerSkill
- api-designerSkill
- bug-hunterSkill
- code-reviewerSkill
- concurrency-race-detectorSkill
- database-architectSkill
- dependency-auditorSkill
- error-handling-architectSkill
- graphql-schema-designerSkill
- memory-leak-detectorSkill
- microservices-boundary-definerSkill
- performance-auditorSkill
- pr-reviewerSkill
- refactor-expertSkill
- resilience-circuit-breaker-designerSkill
- security-auditorSkill
- sql-query-optimizerSkill
- state-machine-designerSkill
- typescript-guardianSkill
- websocket-protocol-designerSkill
- adr-generatorSkill
- changelog-generatorSkill
- codebase-glossary-builderSkill
- commit-message-expertSkill
- contributor-guide-writerSkill
- documentation-writerSkill
- executive-summary-writerSkill
- readme-builderSkill
- release-notes-writerSkill
- rfc-proposal-writerSkill
- runbook-generatorSkill
- sdk-getting-started-writerSkill
- status-update-writerSkill
- ci-cd-pipeline-optimizerSkill
- context-window-optimizerSkill
- git-conflict-resolverSkill
- interview-question-generatorSkill
- meeting-notes-distillerSkill
- monorepo-workflow-architectSkill
- onboarding-guide-generatorSkill
- on-call-handover-writerSkill
- prompt-enhancerSkill
- retro-facilitatorSkill
- task-breakdown-assistantSkill
- tech-debt-burndown-plannerSkill
- cognitive-bias-detectorSkill
- decision-makerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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 22
Incremental Verification: Ensure every micro-step leaves the codebase in a releasable, passing state.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
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.
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.

