/agent-workflow-amplifiers:simplify [target] [--apply] [--all]from agent-workflow-amplifiers
Discovers incidental complexity, duplication, and dead code in a codebase and produces a ranked, behavior-preserving reduction plan — optionally applying safe changes.
Ships in agent-workflow-amplifiers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
/contract
/simplify is a discovery-and-prioritization skill, not a correctness auditor (that is /review's job) and not a blind executor (that is /refactor's job). It answers: what incidental complexity, duplication, and dead weight exists in this code, and what is safe to remove? Default mode is read-only: a ranked reduction plan is emitted but nothing is changed. Writes only happen when --apply is explicitly passed.
Scope is diff-bounded by default (git diff origin/main, or working-tree/HEAD if no remote). Pass --all for a whole-repo sweep (where duplication and dead-code analysis pay off most). Pass an explicit [target] path or PR reference to override both. Code with no test coverage is safe to analyze but must never be auto-applied — the skill surfaces that gap and recommends /simplify [target] --all after adding tests, or produces the plan and stops.
| Argument | Effect |
|---|---|
| (none) | Scope = git diff origin/main (working-tree fallback) |
[target] | Explicit path, glob, or PR ref |
--all | Whole-repo sweep; excludes node_modules/, dist/, generated files |
--apply | Opt-in write mode; default is read-only plan |
Parse arguments before dispatching Wave 1. Resolve scope to a concrete file list or diff stat and attach it to every sub-agent prompt.
Dispatch all four lenses simultaneously as research-agent sub-agents. All are strictly read-only — no writes, no installs that modify package.json. Optional tooling (jscpd, knip) is an accelerant only; degrade to grep/structural reasoning when absent or network-gated.
Find exact and near-duplicate logic blocks across modules within scope. Optionally seed with:
npx jscpd <scope> --reporters json --silent
If jscpd is absent, use grep for literal repetition and structural reasoning for semantic clones. Output: clone clusters with file:line ranges, estimated token overlap, and a suggested extraction site.
Find module-graph-dead exports, unreachable branches, and obsolete feature flags — beyond what tsc --noEmit --noUnusedLocals already catches. Optionally seed with:
npx knip --reporter json
MANDATORY GROUNDING: every "X is unused/dead" claim MUST carry:
file:line citation for the symbol.Dynamic imports, reflection, string-keyed access, and barrel re-exports are common false-positive vectors. Never assert dead code without grounding. Flag uncertain cases as POSSIBLE-DEAD rather than DEAD.
Identify over-long functions (>40 lines), deep nesting (>3 levels), boolean-flag parameters, primitive obsession, and sprawling switch/if chains. The target repo has NO ESLint — this lens is pure agent reasoning over the code, not lint output. Rank by cyclomatic complexity estimate × call-site frequency. Output: hotspot list with file:line, smell label, and a plain-language refactor suggestion.
Find code that reimplements an existing helper, sits at the wrong layer (leaky abstraction, unnecessary wrapper), or is a thin pass-through with no added value. Cross-reference the project's existing utilities before flagging. Output: reuse candidates with file:line, what existing construct could replace them, and estimated call-site count.
| # | Location (file:line) | Smell | Proposed simplification | Risk note | Behavior-preservation note |
|---|
In default (read-only) mode: STOP here. Print the plan and exit.
--apply is passed)Before any write, verify the test suite is green:
pnpm lint && pnpm test
If the gate is red before any change, abort apply and report. Do not attempt to fix pre-existing failures.
Delegation decision (per ranked item, high-to-low):
/refactor if available. /refactor handles DAG-layered, worktree-isolated parallel application with a hard test gate at each layer boundary and a behavioral diff. Pass the reduction plan item as the refactor spec./refactor NOT available, OR single-site local simplifications: apply directly inside a git worktree. One change at a time; run pnpm lint && pnpm test after each. On regression → route to /diagnose; revert the change; continue with remaining items.On full success, chain to /ship for commit + PR.
node_modules/, dist/, vendored code, and auto-generated files from all analysis.jscpd, knip) must not modify package.json or lock files — use npx with no persistent side effects.--all — avoids signal-drowning noise on large codebases.| Failure mode | Mitigation |
|---|---|
| Over-DRYing / wrong abstraction | Sandi-Metz guard (see Synthesis step 2) |
| False dead-code positives | Mandatory grounding rule on lens (b) |
| Behavior change disguised as cleanup | Pre/post test gate; worktree isolation |
| Scope creep on large repos | Diff-scope default; --all is explicit opt-in |
/refactor — multi-site mechanical apply/ship — commit + PR after successful apply/diagnose — when an applied simplification breaks a testWhat SKILL.md sets; muted values are Claude Code's defaults
Reduce complexity, find duplicates, or remove dead code.
Three short reads, in order
code-simplification, refactoring, dead-code, duplication, complexity
npx claudepluginhub griffinwork40/agent-framework --plugin agent-workflow-amplifiers25 skills in this plugin
/agentifyBootstraps a dispatchable Claude sub-agent skill for every coding agent CLI installed on this machine (codex, aider, cursor, etc.). Use when the user wants to delegate tasks to locally-installed agent CLIs or expand the plugin's agent fleet./appmapMap a web UI and generate a Claude automation skill via parallel reconnaissance, synthesis, and iterative validation./automateSet up a scheduled headless Claude run that sends summaries to Telegram. Use when the user wants to automate a recurring task via launchd (macOS) with push-notified results./contractReference convention for sub-agent I/O schemas. Loaded by orchestrator skills via /contract and into agents via the `skills:` field./devils-advocateAdversarially critique a proposal by generating alternatives. Dispatches 3 parallel critics (pragmatist, paranoid, architect lenses) — each invents one alternative approach — then a synthesis step ranks all 4 options and recommends the top choice. When the proposal was authored by someone other than the agent (inherited plan, someone else's PR, external review), a 4th steelman critic runs in the same parallel wave and strengthens the original first, so it is judged at its strongest rather than its weakest. Use when a plan, fix, scoping, decomposition, or named recommendation will drive decisions and you want structured alternative-generation before committing. Complements /shadow-verify — that skill re-derives factual claims; this one critiques whether the chosen approach itself is best./diagnoseParallel root-cause analysis for bugs and failing tests. Use when a test fails, a bug is reported, or behavior is unexplained — dispatches sub-agents to form and validate hypotheses in isolated worktrees.Other plugins' skills for the same job