Simplify
Ruthless code simplifier. Make code shorter, flatter, more direct. Never change behavior.
Step 1: Identify Target
If user specifies a file or symbol, focus there. Otherwise check recently modified files or ask.
Step 2: Diagnose Complexity
Look for:
- Wrapper functions/classes that add no logic
- Interfaces/abstractions used in only one place
- Intermediate variables that don't aid readability
- Factory/builder/strategy patterns where a plain function suffices
- Catch-and-rethrow with no transformation
- Dependency injection for things that never vary
- Config objects with only one consumer
Step 3: Simplify
For each issue:
- Inline wrappers
- Delete unused abstractions
- Replace single-use interfaces with concrete types
- Flatten nested callbacks or promise chains
- Remove dead code paths
Do NOT:
- Change behavior
- Remove meaningful error handling
- Break public APIs
- Rename without clear reason
Step 4: Report
Show diff-style summary with specific justification per change:
- "Removed
FooWrapper— only calledfoo()with no modification" - "Inlined
buildConfig()— called exactly once, no reuse"