**Purpose:** Refactor code with structured workflow (analyze → plan → test → refactor → verify)
/plugin marketplace add nguyenthienthanh/ccpm-team-agents/plugin install nguyenthienthanh-aura-frog-aura-frog-2@nguyenthienthanh/ccpm-team-agentsPurpose: Refactor code with structured workflow (analyze → plan → test → refactor → verify) Category: Code Improvement
refactor <file>
refactor <description>
refactor:component <component-file>
refactor:performance <file>
refactor:analyze <file> # Analysis only
refactor:plan <file> # Plan only
phases[5]{phase,action,output}:
1. Analyze,"Measure quality + identify smells","analysis.md"
2. Plan,"Design refactoring approach","plan.md"
3. Test,"Add tests for current behavior","tests"
4. Refactor,"Apply changes incrementally","refactored code"
5. Verify,"Run tests + measure improvement","report.md"
Metrics collected:
Output: .claude/logs/refactors/{target}-analysis.md
Considerations:
Output: .claude/logs/refactors/{target}-plan.md
types[6]{type,when,example}:
Extract,"Long function/component","Extract helper functions"
Rename,"Unclear naming","Rename for clarity"
Move,"Wrong location","Move to appropriate module"
Simplify,"Over-complex logic","Reduce nesting, early returns"
Compose,"Repeated patterns","Create reusable abstraction"
Performance,"Slow code","Optimize algorithms, memoize"
| Command | Purpose |
|---|---|
refactor <file> | Full refactoring workflow |
refactor:analyze | Analysis document only |
refactor:plan | Implementation plan only |
refactor:component | React/Vue component refactor |
refactor:performance | Performance-focused refactor |
Template: templates/refactor-analysis.md
Version: 2.0.0
/refactorImplementa refactorización de código segura y gradual, evalúa cuantitativamente la adherencia a los principios SOLID. Visualiza la deuda técnica y clarifica las prioridades de mejora.