Cleanup Workflow
When this applies
Section titled “When this applies”Use 401-cleanup when the code already changed and now needs a focused cleanup pass. Each run must target exactly one target type: source cleanup or test cleanup. Never mix both in the same pass.
If the immediate problem is a failing automated test and you do not yet know whether the right fix belongs in the test or the product, use 402-test-correction instead.
Two target paths
Section titled “Two target paths”- Source-only cleanup: clean up changed source files — remove duplication, clarify naming, reduce complexity. Does not touch test files.
- Test-only cleanup: tidy changed test files — reduce redundancy, improve readability, fix broken assertions. Cannot add new coverage, new scenarios, or new test files.
Example prompt sequence
Section titled “Example prompt sequence”Prompt sequence
Run 401 for staged source changes What to watch for
Section titled “What to watch for”- Choose one target type only.
- If the changed set mixes source and tests, pick one side before
401can begin. - Keep the cleanup boundary explicit.
- Test cleanup cannot add new coverage, new scenarios, or new test files.
- Treat broader refactors as a separate decision.