Bring test coverage to a legacy module
Characterise what existing code actually does before changing it.
What this prompt helps you do
Characterisation tests capturing current behaviour, including the behaviour that looks like a bug.
When to use it
A legacy module needs changing and has no tests describing its behaviour.
What to prepare
The goal, relevant source material, constraints, examples, and the decision or action this should support.
How to get a strong result
Capture current behaviour including the wrong parts; a characterisation test that fixes bugs cannot detect regressions.
How to use this prompt
Replace each placeholder with accurate context. Paste the complete prompt into Claude, review the response critically, resolve important questions, and use it as a considered input to the next decision—not as an unchecked final answer.