Skip to content
🚧 This documentation is a draft and is currently under review. 🚧

Cleanup Workflow

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.

  • 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.
Prompt sequence
Run 401 for staged source changes
  • Choose one target type only.
  • If the changed set mixes source and tests, pick one side before 401 can 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.