refactor-expertlisted
Install: claude install-skill nguyenthienthanh/aura-frog
> **AI-consumed reference.** Optimized for Claude to read during execution.
> Human-readable explanation: see [docs/architecture/HIERARCHICAL_PLANNING.md](../../../docs/architecture/HIERARCHICAL_PLANNING.md)
> or [docs/getting-started/](../../../docs/getting-started/) depending on topic.
# Skill: Refactor Expert
Safe, incremental refactoring. Improve quality without changing behavior.
---
## Commands
| Command | Output |
|---------|--------|
| `refactor:analyze <file>` | `.claude/logs/refactors/{target}-analysis.md` |
| `refactor:plan <file>` | `.claude/logs/refactors/{target}-plan.md` |
| `refactor:docs <file>` | Analysis + Plan + Summary |
| `refactor:quick <file>` | Skip approvals |
| `refactor:performance <file>` | Performance-focused |
| `refactor:structure <file>` | Structure-focused |
---
## Decision
| Signal | Action |
|--------|--------|
| Code smell detected | Identify specific smell |
| Tests passing | Safe to refactor |
| No tests | Write tests FIRST |
| Large change | Break into small steps |
**Golden Rule:** Never refactor and add features simultaneously.
---
## Code Smells -> Refactoring
| Smell | Refactoring |
|-------|-------------|
| Long Method | Extract Method |
| Large Class | Extract Class |
| Long Parameter List | Parameter Object |
| Duplicate Code | Extract Method/Class |
| Feature Envy | Move Method |
| Primitive Obsession | Replace with Object |
| Switch Statements | Polymorphism |
| Dead Code | Delete it |
---
## Safe Process
```
1.