Test writer for untested legacy code
An agent reads an untested module, writes characterization tests that lock in current behavior, and runs them until they pass.
CodingTestingRefactoring
Tools
- Cursor
- Claude Code
How to set it up
- 1Pick one module with no tests.
- 2Ask the agent to write tests describing what the code does today, not what it should do.
- 3Have it run the test suite and fix the tests (not the code) until green.
- 4Review the tests, commit them, then refactor with a safety net.
Get new agent playbooks by email