Refactor
Checklist
- For large refactors, run review (clean-code pass) on scope first
- Read all code in scope
- Note: duplication, naming, coupling, complexity, inconsistent patterns
- Propose changes with rationale — wait for approval
- Implement — no intentional behavior change
- Run existing tests and build
- Report: what improved, what you left alone and why
Boundaries
- Not the right tool for new features — use plan + implement
- Not for framework upgrades or breaking API changes — say so; get approval for a migration pass
- Prefer mechanical refactors (rename symbol, extract function) in small commits
- Limit blast radius; split large refactors across steps if the user agrees
If behavior must change
Say so explicitly and get approval — then treat as implement, not refactor.
Related skills
- test — prove behavior unchanged
- review — before merge
- plan — when refactor scope is large or unclear