Refactor Command
When to Use
- •Evaluating if refactoring is justified
- •Before making structural code changes
- •Assessing net complexity impact
Required Questions
- •What concrete problem does this solve?
- •Is there a simpler fix?
- •Can we DELETE instead of reorganize?
- •Net complexity change?
- •Real problem or imagined?
Red Flags (Reject)
- •"More flexible"
- •"Cleaner"
- •"Best practices"
- •No concrete problem
- •"Might need later"
Green Flags (May Proceed)
- •Pattern emerged 3+ times (Rule of Three)
- •Clear bugs from current structure
- •Fewer lines after refactor
- •Deletion opportunity
Output Format
code
REFACTOR: [Area] Problem: [Specific, concrete] Change: [What] Before: [Brief] After: [Brief] Net: +X / -Y lines Risk: [Assessment]
Rules
- •Require evidence of actual pain
- •Prefer deletion over reorganization
- •Small incremental changes
- •Don't refactor while fixing bugs
Council Review
Major refactors may need council review: modules/process/council/
Reference
- •PRESET:
AgentAssets/modules/commands/refactor/PRESET.md