| name | simplify |
| description | Analyze code for simplification opportunities. Use when user says "simplify", "reduce complexity", "clean up code", "remove duplication", "too complicated", or wants to reduce technical debt. |
simplify
Find and apply simplification opportunities in the codebase or a specific area.
Instructions
- Identify the scope - specific files, a module, or a broader area
- Analyze the code looking for:
- Duplicate code that can be extracted into shared functions
- Dead code that is never called or referenced
- Over-abstraction where indirection adds complexity without value
- Unnecessary wrappers around simple operations
- Complex conditionals that can be flattened or simplified
- Unused dependencies or imports
- Prioritize by impact: prefer changes that remove the most code with the least risk
- Present findings to the user before making changes
- Apply changes incrementally - one simplification at a time
- Run
superpowers:requesting-code-review after changes to verify quality
Principles
- Three similar lines of code is better than a premature abstraction
- Only simplify what exists - don't redesign for hypothetical futures
- Removing code is the best simplification
- If a "simplification" makes the code harder to understand, it's not simpler
Examples
Simplify a specific module
User: /simplify the secmaster sync code
Claude: Analyzing ssmd/internal/secmaster/...
Found 3 opportunities:
1. bulkUpsertEvents and bulkUpsertMarkets share 80% identical batching logic - extract shared batchInsert helper
2. Dead code: unused formatMarketName function (removed in refactor but never deleted)
3. Three separate error-wrapping patterns - standardize on one
Broad codebase scan
User: /simplify
Claude: What area should I focus on? (specific files, a module, or the whole project?)