dry-refactor
Installation
SKILL.md
DRY Refactoring
Process
- Identify - Exact copies, similar patterns, parallel hierarchies, naming patterns (
data1/data2,handleXClick) - Analyze - Coupling, cohesion, frequency (Rule of Three: wait for 3+ occurrences), volatility
- Refactor - Choose technique below, extract incrementally, test after each step
Techniques
Extract Function - Same logic in multiple places
getFullName(user: User) => `${user.firstName} ${user.lastName}`
Extract Variable - Repeated expression