This skill gives a coding agent a set of rules inspired by Michael Feathers’s Working Effectively with Legacy Code. It applies when a change touches code without trustworthy tests, where behavior is unclear or dependencies block local feedback.
The agent first states the behavior to change and the behavior to keep, then adds characterization tests, finds or creates the smallest seam, breaks the dependency that blocks testing, makes the change and refactors locally. A longer reference version of the rules covers the dependency-breaking techniques in detail.
What You Get
- A compact rule set with a legacy-change loop, trigger rules and a final checklist that the agent loads when the skill applies
- A longer reference version listing dependency-breaking techniques and how to pick one for the actual barrier
- Guidance on sprout method, sprout class, wrap method and wrap class for adding behavior beside fragile code
- Review rules that flag mixed structural and behavioral edits, hard-coded collaborators and constructor side effects
Common Use Cases
- Adding a feature to a large untested method without editing its many branches
- Making a class instantiable in a test when its constructor opens connections or reads global state
- Wrapping time, randomness, files or network calls so tests become repeatable
- Reviewing a pull request that renames and reformats while leaving the real dependency knots in place
What Makes It Unique
Where general refactoring skills assume tests exist, this one starts from their absence. Its loop puts characterization and seam creation before any design change, separates seams for sensing from seams for separation, and attaches a cleanup duty to temporary tricks such as subclass-only or public-for-test seams. It also names the techniques to use for each kind of barrier.
Under The Hood
The skill is a short SKILL.md that tells the agent to read the compact rules file before making design or code decisions, and to open the full file only when the compact one does not settle a tradeoff. There are no scripts. It does not fetch web pages, call APIs, run commands or write files. The rules shape how the agent plans tests and edits in the code you point it at.