Simplify recently-changed code
One quality pass over the code changed this session: read-only sub-agents surface code smells, you apply the ones worth applying. Not a loop: one pass, done. Correctness (crashes, data loss, contract changes) is harden-code's job; this skill is simplicity only. If nothing changed, ask which scope to use.
The bar is simplicity. The goal is clear, clean-cut features built on the codebase's established patterns, not bells and whistles, and no scaffolding for features that don't exist yet. If a simpler shape does the same job, or an existing pattern already covers it, that's the finding.
Smells to surface
- Dead code: unused functions, unreachable branches, orphaned exports, commented-out blocks.
- Duplicate code: the same logic in two places, near-duplicate functions, repeated validation.
- Data clumps: the same field group or shape redeclared inline across files that should be one shared type/schema.
- Misplaced responsibility: logic in the wrong layer (business rules in transport, validation in storage, presentation in domain models); anything that violates the separation of concerns
CLAUDE.md defines.
- Speculative generality: abstraction, indirection, or config built for a future that hasn't arrived (per
CLAUDE.md's restraint rule).
Leave alone: bugs, crashes, data loss (note them for harden-code, don't fix here); behavior-changing performance tweaks; and nits the formatter already handles.
Process
- Scope: the files changed this session (ask if you can't tell reliably).
- Partition: group them into cohesive slices, one per import neighborhood or feature path; one sub-agent per slice.
- Dispatch in parallel: read-only sub-agents, each given its file list and slice name, each returning findings as
file:line · smell · suggested fix. They advise; they never edit.
- Adversarial variant (agent team): when agent teams are enabled, run this as a team of QA skeptics instead. Each teammate owns a slice, argues that its code isn't earning its keep (is this abstraction premature, does this deviate from an established pattern, is this bell-and-whistle wanted by an actual feature), and teammates cross-examine each other before reporting. A smell that survives the challenge is worth applying.
- Triage: apply a finding only if it simplifies and preserves behavior. Skip anything that changes behavior, contradicts
CLAUDE.md conventions, or doesn't survive your own scrutiny, each skip with a one-line reason.
- Apply the survivors yourself: you have the context, don't delegate to a fixer.
- Report, per slice: audited, found, applied, skipped and why.
1---2name: simplify-code3description: Sweeps the code changed this session for code smells (dead code, duplication, data clumps, misplaced responsibility, speculative generality) by spawning read-only sub-agents in parallel, then applies the fixes that simplify without changing behavior. One pass, not a loop; correctness belongs to harden-code. Use after a refactor or feature, or when the user says "simplify", "clean up", or "code quality pass".4---56# Simplify recently-changed code78One quality pass over the code changed this session: read-only sub-agents surface code smells, you apply the ones worth applying. **Not a loop**: one pass, done. Correctness (crashes, data loss, contract changes) is `harden-code`'s job; this skill is simplicity only. If nothing changed, ask which scope to use.910**The bar is simplicity.** The goal is clear, clean-cut features built on the codebase's established patterns, not bells and whistles, and no scaffolding for features that don't exist yet. If a simpler shape does the same job, or an existing pattern already covers it, that's the finding.1112## Smells to surface1314- **Dead code**: unused functions, unreachable branches, orphaned exports, commented-out blocks.15- **Duplicate code**: the same logic in two places, near-duplicate functions, repeated validation.16- **Data clumps**: the same field group or shape redeclared inline across files that should be one shared type/schema.17- **Misplaced responsibility**: logic in the wrong layer (business rules in transport, validation in storage, presentation in domain models); anything that violates the separation of concerns `CLAUDE.md` defines.18- **Speculative generality**: abstraction, indirection, or config built for a future that hasn't arrived (per `CLAUDE.md`'s restraint rule).1920Leave alone: bugs, crashes, data loss (note them for `harden-code`, don't fix here); behavior-changing performance tweaks; and nits the formatter already handles.2122## Process23241. **Scope**: the files changed this session (ask if you can't tell reliably).252. **Partition**: group them into cohesive slices, one per import neighborhood or feature path; one sub-agent per slice.263. **Dispatch in parallel**: read-only sub-agents, each given its file list and slice name, each returning findings as `file:line · smell · suggested fix`. They advise; they never edit.27 - **Adversarial variant (agent team):** when agent teams are enabled, run this as a team of QA skeptics instead. Each teammate owns a slice, argues that its code isn't earning its keep (is this abstraction premature, does this deviate from an established pattern, is this bell-and-whistle wanted by an actual feature), and teammates cross-examine each other before reporting. A smell that survives the challenge is worth applying.284. **Triage**: apply a finding only if it simplifies **and** preserves behavior. Skip anything that changes behavior, contradicts `CLAUDE.md` conventions, or doesn't survive your own scrutiny, each skip with a one-line reason.295. **Apply the survivors yourself**: you have the context, don't delegate to a fixer.306. **Report**, per slice: audited, found, applied, skipped and why.