working-effectively-with-legacy-code — Claude Code skill
working-effectively-with-legacy-code — a skill for Claude Code and Codex that enforces Michael Feathers' legacy code techniques. Activates during risky refactoring, missing test coverage, and dependency breaking.
MIT 602 installs ★ 3,328 updated 2026-09-10
npx skills add ciembor/agent-rules-books --skill working-effectively-with-legacy-code -a claude-codeWhat working-effectively-with-legacy-code does
This skill guides the AI assistant through modifying hard-to-test code bases using Michael Feathers' engineering practices. It steers changes toward characterization tests, seam identification, and sprout or wrap techniques.
Prior to changing any code or structure, the assistant consults working-effectively-with-legacy-code.mini.md. The extended guide working-effectively-with-legacy-code.md serves as a fallback reference when compact rules do not resolve the design dilemma.
Execution requires no external runtime, network API keys, or specialized tool setup.
What it helps with
- modify untested legacy routines without unexpected regressions
- capture existing system behavior using characterization tests
- break tight dependencies by introducing testable seams
- add functionality using sprout method or wrap method patterns
Example prompts for the agent
- Add input validation to this legacy controller using a sprout method
- Write characterization tests around this service before touching its logic
- Find an execution seam in this class to break the database dependency
How to install working-effectively-with-legacy-code
1Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill working-effectively-with-legacy-code -a claude-code2Manually: put the files in place
~/.claude/skills/working-effectively-with-legacy-code/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/working-effectively-with-legacy-code/
1Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill working-effectively-with-legacy-code -a codex2Manually: put the files in place
.agents/skills/working-effectively-with-legacy-code/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill working-effectively-with-legacy-code -a cursor2Manually: put the files in place
.cursor/skills/working-effectively-with-legacy-code/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ciembor/agent-rules-books working-effectively-with-legacy-code2Manually: put the files in place
.github/skills/working-effectively-with-legacy-code/SKILL.md1Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill working-effectively-with-legacy-code -a gemini-cli2Platform CLI
gemini skills install https://github.com/ciembor/agent-rules-books --path working-effectively-with-legacy-codeManually: put the files in place
.devin/skills/working-effectively-with-legacy-code/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill working-effectively-with-legacy-code -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about working-effectively-with-legacy-code
How to install working-effectively-with-legacy-code in Claude Code?
Run npx skills add ciembor/agent-rules-books --skill working-effectively-with-legacy-code -a claude-code. The rule definition is placed at ~/.claude/skills/working-effectively-with-legacy-code/SKILL.md.
What does working-effectively-with-legacy-code do?
It instructs coding agents to follow legacy-code patterns from Michael Feathers, focusing on risk reduction, test seams, and safe modifications.
What reference files does this skill require?
The workflow reads working-effectively-with-legacy-code.mini.md for standard decisions and references working-effectively-with-legacy-code.md when deeper legacy-code tradeoffs emerge.
Source text
SKILL.md · MIT
--- name: working-effectively-with-legacy-code description: Apply Michael Feathers-inspired legacy-code rules when changing hard-to-test code safely with characterization tests, seams, sprout methods, or wrap methods. license: MIT --- # Working Effectively with Legacy Code Skill Use this skill when a task involves risky legacy changes, missing tests, characterization tests, seams, dependency breaking, sprout method, wrap method, or incremental risk reduction. Before making design or code decisions, read and apply [working-effectively-with-legacy-code.mini.md](working-effectively-with-legacy-code.mini.md). Use [working-effectively-with-legacy-code.md](working-effectively-with-legacy-code.md) only as a deeper reference when the mini rules are not enough for the current legacy-code tradeoff.
© ciembor · MIT · ciembor/agent-rules-books