Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ciembor/working-effectively-with-legacy-code
Apply Michael Feathers-inspired legacy-code rules when changing hard-to-test code safely with characterization tests, seams, sprout methods, or wrap methods.
Passed 8 of 24 test cases with the skill, and 16 of 24 without it.
1 fixed20 passed either way1 still failing2 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
In a 1,000-line legacy OrderProcessor class, you need to add logic that calculates a 5% loyalty discount for premium customers during checkout. The method processOrder is untested and has complex side effects. You are tempted to insert an if (customer.isPremium()) block directly in the middle of processOrder. Recommend the best legacy refactoring technique to add this new calculation while keeping the new logic fully testable, and explain how to test it.
| Checked | Without skill | With skill |
|---|---|---|
| Recommends using the Sprout Method pattern. | Missed | Passed |
| Advises testing the sprouted discount calculation method independently before calling it from processOrder. | Passed | Passed |
The instructions your model reads when the skill loads.
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. Use working-effectively-with-legacy-code.md only as a deeper reference when the mini rules are not enough for the current legacy-code tradeoff.
test cases passed, vs 16 / 24 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.