refactoring-patterns
Installation
SKILL.md
Refactoring Patterns
Safe techniques for restructuring code without changing its behavior. Every refactoring follows: test green -> refactor -> test green.
Golden Rule
Never refactor and change behavior in the same commit. Refactoring = same behavior, different structure. Feature work = different behavior. Mixing them makes bugs untraceable.
Pre-Refactoring Checklist
Before any refactoring:
- Tests exist and pass for the code being refactored
- You can describe what the code does WITHOUT reading it line by line
- The refactoring has a clear motivation (not "it could be cleaner")
- The scope is bounded — you know exactly which files/functions change