code-refactoring-patterns
Installation
SKILL.md
Code Refactoring Patterns
A comprehensive guide to refactoring code systematically while maintaining functionality and improving quality.
When to Refactor
- Code smells detected (duplicated code, long functions, etc.)
- Before adding new features to complex areas
- After understanding improves ("now I see a better way")
- When tests are in place
- Performance optimization needed
Refactoring Rules
- Never refactor without tests: Write tests first if they don't exist
- Small steps: Make one change at a time
- Run tests after each change: Ensure nothing breaks
- Commit often: Each working refactor is a commit
- Don't mix refactoring with feature work: Separate concerns