refactoring-patterns
Installation
SKILL.md
Refactoring Patterns: Operations & Techniques
A focused guide to the seven most impactful refactoring operations. Unlike code bloaters (which are smells to avoid), these are techniques you actively apply to improve design, clarity, and maintainability.
Pattern #1: Extract Method / Extract Function
What It Is
Pull out a section of code into a separate, named method/function. This is the most frequent refactoring operation.
When to Use
- Code section has a clear, single purpose but is buried in a larger method
- Same logic appears in multiple places (extract once, reuse everywhere)
- Method has complex local variables and you want to isolate them
- You want to test a section in isolation
- Code comment describes what a section does — that's a candidate for extraction