Refactoring
Small, behavior-preserving steps — suite green after each one.
- Cover first: add characterization tests around the code you will touch.
- Rename for intent (variables, functions, files) before restructuring.
- Extract pure logic out of I/O shells; shrink functions until each does one thing.
- Delete dead code outright instead of commenting it out; git remembers.
- No behavior changes mixed into a refactor commit — say which commits are pure moves.
- Update callers, docs, and skills that describe the old shape. If a step breaks tests, revert that step only and try a smaller one.