| name | simplify |
| description | Simplify code or a patch by removing dead code, duplicated facts, redundant abstractions, excess state, and unjustified compatibility paths while preserving required behavior. Use for cleanup, deduplication, reducing LOC or complexity, deepening modules, or narrowing over-generalized designs. |
Simplify
Set the boundary
Treat required behavior, public contracts, ownership, permissions, data
migrations, and cross-surface compatibility as hard constraints. Read the root
AGENTS.md, inspect the worktree, and record the baseline in the task audit.
Optimize in this order:
- Remove concepts, states, branches, and source lines.
- Derive duplicated facts from one authoritative source.
- Merge abstractions that split one invariant or workflow.
- Generalize only around demonstrated variation.
Moving code into helpers or reformatting it is not simplification.
Find excess
- Search declarations, production consumers, tests, docs, build files, and
history before calling code dead.
- Treat a duplicated fact as a missing single source of truth.
- Treat one-mode registries, callbacks, wrappers, and fallbacks as candidates
for deletion or narrowing.
- Treat forwarding-only interfaces as shallow modules; move policy and
validation behind a smaller boundary.
- Keep compatibility paths only when a current requirement depends on them.
Classify each candidate as delete, derive, merge, deepen,
narrow, or keep. Choose the coherent option that removes the most
concepts with the fewest new rules.
Change safely
- For review-only requests, stop with evidence and a reduction proposal.
- Otherwise, apply the smallest behavior-preserving reduction.
- Remove orphaned imports, types, configuration, tests, and documentation with
the deleted model.