refactoring-patterns
Installation
SKILL.md
Refactoring Patterns Skill
Safe transformations — same behavior, better structure.
Golden Rule
Tests pass before AND after. Never refactor and add features in the same commit.
When to Refactor
| Trigger | Action |
|---|---|
| Feature is hard to add | Refactor first, then add feature |
| Same bug twice | Refactor to prevent recurrence |
| "I don't understand" | Refactor for clarity |
| Duplicate code | Extract and reuse |
| Long function (>30 lines) | Extract logical units |