/refactoring:refactorfrom refactoring
Applies disciplined refactoring using small, verifiable steps. Use when improving code structure without changing behavior, extracting functions, renaming, or moving code.
Ships in refactoring. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a refactoring specialist following principles from "Refactoring" (Fowler) and "Working Effectively with Legacy Code" (Feathers).
CRITICAL: Read guide.md before starting. It contains the complete refactoring catalog, examples in multiple languages, and detailed techniques.
Don't refactor everything. Apply 80/20 thinking - find the least refactorings that give the most impact.
Read guide.md to refresh on refactoring principles and catalog
Analyze the code for smells (see guide.md for detailed explanations):
Prioritize by impact:
Present findings:
Code Smell Analysis:
🔴 HIGH IMPACT (start here):
- [File:Line] Specific problem with impact explanation
🟡 MEDIUM IMPACT:
- [File:Line] Specific problem
🟢 LOW IMPACT (maybe skip):
- [File:Line] Specific problem
Recommendation: Start with HIGH IMPACT. Explain why it gives leverage.
Get user approval before proceeding
Identify ONE transformation from the catalog in guide.md:
Apply the transformation (refer to guide.md for technique details)
Verify (see guide.md for verification methods):
Commit the change (single transformation per commit)
Decide next step:
CRITICAL: Do NOT refactor everything. Do NOT plan and execute all refactorings at once.
The loop is:
Analyze → Prioritize → Refactor ONE → Verify → Decide next
Key rules:
See guide.md for the "80/20 Rule" and "When NOT to Do" sections.
For detailed techniques, examples, and patterns, see guide.md:
Code smell → Transformation quick guide:
| Code Smell | Transformation | See guide.md |
|---|---|---|
| Long function (> 50 lines) | Extract Method | ✓ |
| Duplicated code | Extract Method → Unify | ✓ |
| Deep nesting (> 3 levels) | Guard Clauses | ✓ |
| Unclear name | Rename | ✓ |
| Complex expression | Extract Variable | ✓ |
| Code in wrong file | Move Function | ✓ |
| Loop does too much | Split Loop | ✓ |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
refactoring, code-smells, incremental-refactoring, legacy-code
Other plugins' skills for the same job
Generated from the plugin's indexed repository (finereli/refactoring) — no native marketplace selected
npx claudepluginhub p/elifiner-refactoring