PromptTesting and quality
Refactor-under-tests loop
Small refactors that keep behaviour identical, reverting any step that turns a test red.
How each pass goes
- Confirm the tests pass.
- Make one small refactor.
- Run tests; keep it if green, revert if red.
Stops when
The refactor is complete with the suite green throughout.
Starter prompt
Refactor this code in small, behaviour-preserving steps. Before each step, confirm tests pass; after each step, run them. Keep the step if green, revert it if red. Commit after each kept step.