/tslateman-skills:legacyfrom tslateman-skills
Get code with no tests under a harness so it can be changed safely, applying Feathers' Working Effectively with Legacy Code. Use when a change is needed in untested code, when refactor refuses for want of a green baseline, when a class cannot be instantiated in a test, or when adding behavior to code you dare not touch. Covers characterization tests, seams, dependency-breaking, and sprout/wrap. Do NOT use when a green suite already covers the target (that is refactor or tidy) or to drive new behavior from a failing test (that is test-first).
Ships in tslateman-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Answers one question: how do I get this under test without changing it first? Feathers' definition is operational and has nothing to do with age — legacy code is code without tests. Code without tests cannot be changed safely, and code that cannot be changed safely is where every risky change ends up.
This skill produces a green baseline over behavior that nothing currently pins down. It never improves that behavior; the improvement comes after, through refactor or tidy.
refactor, or tidy for smaller moves.test-first.testing.maintainability.To change code safely you need tests. To put tests around it you usually have to change it. That circle is the whole problem, and the way out is to make the smallest, most conservative change that creates a place to test from — accepting a worse design temporarily to get the safety that lets you fix the design properly.
The order is fixed: cover, then change. Never improve on the way in.
A characterization test records what the code does, not what it should do. It is a description, not a specification, and it preserves bugs deliberately — the bug may be load-bearing, and you are not fixing it yet.
The mechanical procedure, which requires no understanding of the code:
You now have a green suite over the current behavior without having read the implementation closely. Where the recorded behavior is obviously wrong, note it as a finding and leave it green. Fixing it is a separate, later, deliberate change with its own test.
Name these tests for what they pin, not for correctness: records_zero_balance_returns_none, never test_handles_zero_balance_correctly.
A seam is a place where behavior can be altered without editing in that place. Every seam has an enabling point — where the choice of behavior is made. No seam, no test harness.
| Seam type | Alter behavior at | Enabling point |
|---|---|---|
| Object | Override a method in a subclass or substitute an implementation | Where the instance is chosen |
| Link | Swap what the build or runtime resolves the name to | Build config, path, module resolution |
| Preprocessing | Replace text before compilation | Macro or include configuration |
Object seams are the ones to reach for. Link and preprocessing seams work when you truly cannot alter the source, and they are harder to see from the code, which makes them harder for the next reader.
When the surrounding code cannot be brought under test cheaply, do not change it. Add beside it.
The cost is honest and worth naming: sprouting leaves the untested mass untested and adds a seam that looks arbitrary until someone reads why. Take it when covering the host is genuinely out of budget, and say so.
Four common blockers and the standard moves:
Subclass and Override Method is the blunt instrument that works when nothing else does — subclass the target in the test and stub the one method blocking you. It is ugly, it is temporary, and it beats not testing.
When the code is opaque, two cheap tools before any edit:
test-first for new behavior, refactor or tidy for structure.-0.5 where the docstring promises 0, and the instinct is to write assert result == 0 and repair the code. That is a silent behavior change under cover of adding tests. Record -0.5, note the discrepancy, move on.evals/already-covered-skip-characterization/criteria.json (opens in a new tab)evals/already-covered-skip-characterization/resources/coupon.py (opens in a new tab)evals/already-covered-skip-characterization/resources/test_coupon.py (opens in a new tab)evals/already-covered-skip-characterization/scenario.json (opens in a new tab)evals/already-covered-skip-characterization/task.md (opens in a new tab)evals/characterize-before-change/criteria.json (opens in a new tab)evals/characterize-before-change/resources/pricing.py (opens in a new tab)evals/characterize-before-change/scenario.json (opens in a new tab)evals/characterize-before-change/task.md (opens in a new tab)evals/sprout-into-untestable-class/criteria.json (opens in a new tab)evals/sprout-into-untestable-class/resources/notifier.py (opens in a new tab)evals/sprout-into-untestable-class/scenario.json (opens in a new tab)evals/sprout-into-untestable-class/task.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
tslateman-skills@tslateman is listed by tslateman/claude-plugins — review the source before installing
npx claudepluginhub tslateman/claude-plugins --plugin tslateman-skillsOther plugins' skills for the same job
61 skills in this plugin
/adrGenerate Architecture Decision Records that capture the reasoning behind technical decisions. Use when the user asks to "create an ADR", "document a decision", "record why we chose X", or discusses architectural trade-offs worth preserving./arenaSpawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape./automagic-problem-discoveryAudit a workspace for recurring friction, pick the highest-leverage one, and build the automation that removes it. Use when the user asks "what should I automate", "what's wasting my time", "find the friction in my workflow", wants a self-improvement pass over their own tooling, or runs this on a recurring loop.