Complexity Mitigator
Intent
Reduce understanding cost in existing code while preserving essential domain
meaning. This skill is a read-only routing rail and analysis preflight, not a
delivery owner.
FACTORING -> WINNOWING
- Factor the code into responsibilities, states, effects, decisions, and
boundaries.
- Retain essential domain factors.
- Expose specification-risk factors before refactoring.
- Remove, collapse, rename, localize, or delegate incidental factors.
- Route repeated semantic distinctions or causal review pressure to
$review-fold and $actuating.
Activation
Use for hard-to-follow existing code, deep nesting, boolean soup, mixed
parse/validate/decide/effect behavior, cross-file hops, hidden state, ordering
dependencies, opaque names, and review stalls caused by comprehension.
Handoff instead:
- broad framework or layer tax ->
$reduce;
- unclassified review evidence ->
$review-fold;
- classified owner-boundary pressure ->
$actuating;
- illegal states or invariant ownership ->
$invariant-ace;
- missing essential structural shape ->
$universalist;
- implementation ->
$actuating or the owning workflow.
Workflow
- Choose the slice: entry point, inputs, outputs, state, effects, and boundary.
- Factor it into responsibilities, decisions, state, effects, external
obligations, and proof surfaces.
- Classify each factor as
essential, incidental, mixed, or spec-risk.
- Identify duplicated, dominated, subsumed, vestigial, pass-through, or
misplaced factors.
- Preserve essential factors and unresolved specification risk.
- Winnow in this order: delegate, flatten, rename, localize, collapse, then
extract only after stable repetition is evidenced.
- State the recomposition rule and smallest proof signal.
- Return a handoff; do not implement.
Actuating composition
Within Actuating, the checked-in complexity review lens
owns the lane's scope and return shape. Its focus is unnecessary correctness
machinery and duplicate semantic ownership, not the full standalone comprehension
preflight. Return the independently maintained truth, accepted obligation, and
evidence; distinguish competing owners from derived guards and independent oracles.
Keep grounded nonblocking opportunities separate from established violations. Do not select a repair, launch companion
reviews, or emit a second preflight, evidence table, or proposed-repair agenda.
Review Fold adjudicates and Actuating owns the construction decision. This section
takes precedence over standalone workflow, routing, and output only within
Actuating. Standalone behavior is unchanged.
Output
Complexity preflight:
- whole:
- dominant cost:
- factorization:
- retain:
- remove/collapse/delegate:
- unresolved specification risk:
- recomposition:
- proof:
- handoff:
Guardrails
- Do not edit files or commit.
- Do not select architecture, review credit, mutation, or closure.
- Do not confuse fewer lines with lower understanding cost.
- Do not delete essential policy or unresolved external obligations.
- Do not extract abstractions before stable shape is visible.
- If behavior is unclear, request an executable learning surface such as an
example matrix, contract test, fixture set, or state table.
1---2name: complexity-mitigator3description: Existing-code comprehension and local winnowing preflight. Use for simplify/refactor/clean up/untangle, nested branches, boolean soup, opaque names, mixed responsibilities, cross-file state, or review stalls. Factor the local whole, separate essential/incidental/specification-risk factors, winnow dominated or duplicated factors, and emit the smallest clarity cut. Not for broad architectural layer removal, kernel quotienting, invariant remediation, or greenfield planning.4---56# Complexity Mitigator78## Intent910Reduce understanding cost in existing code while preserving essential domain11meaning. This skill is a read-only routing rail and analysis preflight, not a12delivery owner.1314```text15FACTORING -> WINNOWING16```1718- Factor the code into responsibilities, states, effects, decisions, and19 boundaries.20- Retain essential domain factors.21- Expose specification-risk factors before refactoring.22- Remove, collapse, rename, localize, or delegate incidental factors.23- Route repeated semantic distinctions or causal review pressure to24 `$review-fold` and `$actuating`.2526## Activation2728Use for hard-to-follow existing code, deep nesting, boolean soup, mixed29parse/validate/decide/effect behavior, cross-file hops, hidden state, ordering30dependencies, opaque names, and review stalls caused by comprehension.3132Handoff instead:3334- broad framework or layer tax -> `$reduce`;35- unclassified review evidence -> `$review-fold`;36- classified owner-boundary pressure -> `$actuating`;37- illegal states or invariant ownership -> `$invariant-ace`;38- missing essential structural shape -> `$universalist`;39- implementation -> `$actuating` or the owning workflow.4041## Workflow42431. Choose the slice: entry point, inputs, outputs, state, effects, and boundary.442. Factor it into responsibilities, decisions, state, effects, external45 obligations, and proof surfaces.463. Classify each factor as `essential`, `incidental`, `mixed`, or `spec-risk`.474. Identify duplicated, dominated, subsumed, vestigial, pass-through, or48 misplaced factors.495. Preserve essential factors and unresolved specification risk.506. Winnow in this order: delegate, flatten, rename, localize, collapse, then51 extract only after stable repetition is evidenced.527. State the recomposition rule and smallest proof signal.538. Return a handoff; do not implement.5455## Actuating composition5657Within Actuating, the checked-in [complexity review lens](../actuating/references/lenses/complexity-review.md)58owns the lane's scope and return shape. Its focus is unnecessary correctness59machinery and duplicate semantic ownership, not the full standalone comprehension60preflight. Return the independently maintained truth, accepted obligation, and61evidence; distinguish competing owners from derived guards and independent oracles.62Keep grounded nonblocking opportunities separate from established violations. Do not select a repair, launch companion63reviews, or emit a second preflight, evidence table, or proposed-repair agenda.64Review Fold adjudicates and Actuating owns the construction decision. This section65takes precedence over standalone workflow, routing, and output only within66Actuating. Standalone behavior is unchanged.6768## Output6970```text71Complexity preflight:72- whole:73- dominant cost:74- factorization:75- retain:76- remove/collapse/delegate:77- unresolved specification risk:78- recomposition:79- proof:80- handoff:81```8283## Guardrails8485- Do not edit files or commit.86- Do not select architecture, review credit, mutation, or closure.87- Do not confuse fewer lines with lower understanding cost.88- Do not delete essential policy or unresolved external obligations.89- Do not extract abstractions before stable shape is visible.90- If behavior is unclear, request an executable learning surface such as an91 example matrix, contract test, fixture set, or state table.