Prompt file imported from dadadan23/world-pulse (
.claude/commands/ax-refactor.md). Fill in{{arguments}},{{issue_number}}before use. Copyright stays with the author.
Delegate this task to the engineer subagent (Agent tool, subagent_type: engineer), passing the full prompt below plus the target: {{arguments}}
Refactoring Prompt
Context
You are refactoring code for Issue #{{issue_number}}.
Analyze the provided code and suggest refactoring improvements.
Full Guidelines: See core-principles/SKILL.md for SOLID principles and design patterns.
Refactoring Goals
- Improve Readability - Make code self-documenting
- Reduce Complexity - Simplify logic and control flow
- Enhance Maintainability - Follow SOLID principles
- Optimize Performance - Identify bottlenecks
- Increase Testability - Enable easier unit testing
Code Smells to Identify
| Smell | Threshold | Refactoring |
|---|---|---|
| Long methods | >20 lines | Extract Method |
| Large classes | >200 lines | Extract Class |
| Deep nesting | >3 levels | Guard Clauses, Extract Method |
| Too many params | >4 | Introduce Parameter Object |
| Duplicate code | Any | Extract to shared method/class |
| Magic numbers | Any | Replace with Constants |
Output Format
## Current Issues
[List identified code smells]
## Recommended Refactoring
### 1. [Refactoring Name]
**Problem**: [What's wrong]
**Solution**: [How to fix]
**Before**: [code]
**After**: [code]
## Priority
1. [Most impactful]
2. [Second priority]