Command
Add Regression Test
Writes a test that fails on the bug you describe, proves it fails, then confirms it passes once the fix is in.
11. Restate the bug as input, expected result and actual result. If any of the three is unclear, ask one question and wait.
22. Find the code responsible and the nearest existing test file. Copy its naming, fixtures and assertion style. Do not add a new framework.
33. Write the smallest test that reproduces the bug at the lowest level possible (unit before integration). Use a name that states the behavior, not the ticket number alone.
44. Run it before any fix. It must fail, and the failure message must show the bug itself, not a typo or missing import. If it passes, the bug is not reproduced: say so and investigate.
55. If a fix is not in yet, show the proposed fix and ask before editing source. If it is already in, check out the previous version of the file with `git stash` or `git show` to confirm the test fails there.
Claude CodeCodex
Add Regression Test
CommandTesting
Free