refactoring
Installation
SKILL.md
Refactoring with Functional Core, Imperative Shell
Extract pure functions before refactoring. Never refactor code that mixes logic with side effects.
When to Use
- User asks to "refactor", "consolidate", "extract", or "reduce duplication"
- Test coverage requested for hooks, components, or code with I/O
- Code review reveals logic buried in side-effect-heavy code
Core Pattern
1. ANALYZE → Identify pure logic vs side effects
2. EXTRACT → Move pure logic to utils/ as pure functions
3. TEST → Write output-based tests for extracted functions
4. REFACTOR → Modify imperative shell (now thin wrapper)