refactor
Refactor
Purpose
This skill restructures existing code to make it cleaner, simpler, or easier to change — without altering what the code does. It exists to close a gap in the rest of the suite: tasks-to-code and code-review enforce "no gold-plating," so genuine improvements get deferred into decisions.md and retro.md under Future Opportunities, where they pile up with no skill to execute them safely. This is that skill.
Refactoring is the disciplined counterpart to gold-plating. Gold-plating adds unrequested behavior mid-task and risks regressions. Refactoring changes structure only, is guarded by tests at every step, and is done deliberately as its own unit of work — never smuggled into a feature or a bug fix.
The Contract
This skill makes one promise, and the whole workflow exists to keep it:
Tests stay green, behavior unchanged.
Concretely, when a refactor is complete: