From amplify
Analyzes codebases or module namespaces for simplification opportunities like dead code, shallow abstractions, misplaced concerns, unnecessary indirection, and complected state. Produces classified report with recommended actions. For 'simplify this system', 'reduce complexity', or 'find dead code' requests.
How this skill is triggered — by the user, by Claude, or both
Slash command
/amplify:system-simplifierThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze a codebase namespace for structural simplification opportunities. Produce a classified report of findings with recommended actions. Hand off to `create-plan` for planning and `execute-plan` for execution.
Analyze a codebase namespace for structural simplification opportunities. Produce a classified report of findings with recommended actions. Hand off to create-plan for planning and execute-plan for execution.
Read references/principles.md now. It contains the design principles that drive every recommendation.
Determine what to analyze. Ask the user if unclear.
lib/my_app/billing/)Before proposing changes, understand what exists.
Module census: List every module in the namespace with line counts.
find lib/path -name '*.ex' -exec wc -l {} + | sort -n
Dependency graph: For each module, grep for who imports, aliases, or calls it.
grep -r 'alias MyApp.Billing' lib/ --include='*.ex' -l
Dead code scan: Find modules, functions, or fields with no callers.
# Elixir-first: use compiler-aware references before text search
mix xref callers MyApp.Billing
mix xref graph --label compile
# Supplement with text search for dynamic callsites/tests
grep -r 'ModuleName.function_name' lib/ test/ --include='*.ex' --include='*.exs' -l
Then check for dynamic usage that static scans can miss:
apply/3, Module.concat/2, and runtime dispatchStruct field audit: For each struct, check which fields are actually read.
grep -r 'ctx\.field_name\|:field_name' lib/ --include='*.ex' -l
Categorize each finding using the complexity taxonomy:
| Category | Signal | Action |
|---|---|---|
| Dead code | No callers in lib/ or test/ | Delete |
| Write-only fields | Set but never read | Delete |
| Shallow module | 1-2 functions, single caller | Inline into caller |
| Pass-through function | Wraps another call with no added value | Inline or delete |
| Misplaced concern | Function lives far from its only consumers | Move to natural owner |
| Unnecessary indirection | Intermediate data structure rebuilt from source | Derive on demand |
| Nested state | Sub-struct accessed through parent everywhere | Flatten into parent |
| God module | Mixed responsibilities and frequent unrelated edits (line count is a signal, not a verdict) | Split by responsibility seams |
| Synthetic compatibility | Adapter maps between old and new shapes | Delete old shape |
| Dead configuration | Config keys read but never affect behavior | Delete |
Present findings grouped by category. For each finding:
principles.md)Use this compact format:
- Finding: <short title>
What: <module/function/field>
Why: <violated principle>
Evidence: <xref/grep/code refs>
Action: <delete|inline|move|flatten|extract>
Risk: <low|medium|high>
Confidence: <high|medium|low>
Blast radius: <estimated files/modules>
Order the report by risk: low-risk findings first (easy wins), high-risk last.
Recommended phase ordering when the user is ready to plan:
After presenting findings, suggest the user run create-plan to turn the report into an executable plan, and execute-plan to work through it.
These patterns are complexity hotspots worth investigating:
create-plan)execute-plan)code-simplifier)npx claudepluginhub wunki/amplify --plugin ask-questions-if-underspecifiedAnalyzes and simplifies existing implementations to reduce complexity, improve maintainability, and enhance scalability. Use when users ask to simplify code, reduce complexity, refactor for readability, or reduce technical debt.
Reviews recently implemented code for reuse opportunities, quality issues, and efficiency problems. Dispatches parallel reviewers, applies user-approved fixes with test verification, and generates a structured simplification report.
Scans the entire codebase for over-engineering: dead code, stdlib replacements, native alternatives, YAGNI abstractions, and bloat. Produces a ranked list of what to delete or simplify.