refactoring
Refactoring
Apply specific, named, behavior-preserving refactoring moves — one at a time, with tests passing before and after each move.
"Make each refactoring step as small as possible, so that you can always see the program working." — Martin Fowler
Skill workflow — refactoring follows from audit and precedes patterns:
clean-code or techdebt (identify what needs changing) → refactoring (apply the moves) → design-patterns (apply a pattern if one is now appropriate)
Note: This skill covers the execution of specific moves. For planning a larger structural change — choosing strategy, mapping blast radius, breaking into safe commits — use
refactoring-planinstead.
Philosophy
Refactoring is not rewriting. It is a sequence of small, mechanical, behavior-preserving transformations. Each step:
- Leaves the code working (tests pass)
- Is independently understandable
- Moves toward better structure