Fanout

From melodic-software/claude-code-plugins · View interactive version

Fanout is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Breadth review: fans a change out to many reviewers at once (this plugin's reviewer agents, the project's per-concern criteria docs, orchestrator review plugins) and merges their findings into one deduplicated, severity-ranked report on disk. Use when asked for a breadth review of a change (every re

How to use this skill

Skill file

Arguments. [run-everything|fix] [--yes] [--unattended]. e.g., /review:fanout, /review:fanout run-everything, /review:fanout --unattended, /review:fanout fix, /review:fanout fix --yes

Repository context. Gather first

<!-- BEGIN GENERATED: gather-block. Edit docs/conventions/gather-block/block.md, then run scripts/sync-gather-block.py -->

Run each command below as its own Bash call, all sent together in one message (worktree isolation).

Keep any bound in the command's own pipe (output limits).

Unless this section says otherwise, treat a failure (not a repository, git unavailable) as an unknown value and carry on. Keep these as body calls, never ## Pre-computed context lines (gather-block convention).

<!-- END GENERATED: gather-block -->

Pre-computed context

Open PRs (match headRefName to current branch above; baseRefName is the PR's real base): !gh pr list --json number,title,headRefName,baseRefName --limit 10 2>/dev/null || echo "unknown"

Committed diff size vs default-base merge base (recompute against the PR's baseRefName when it differs): !bash "${CLAUDE_PLUGIN_ROOT}/skills/fanout/scripts/diff-vs-base.sh" 2>/dev/null || echo "unavailable"

Purpose

Breadth review: fan out across many finding-producing surfaces at once (quality-gate picks one lens), then normalize their heterogeneous free-text, which carries two independent axes (severity, confidence) with most surfaces filling only one, through a 5-stage pipeline (extraction → severity crosswalk → confidence enum → dedup → agreement/rank, findings-normalization.md) into one severity-ranked report persisted to disk.

Review modes report; a separate fix action applies. The default and run-everything modes fan out, normalize, and persist findings, mutating nothing but the findings file. The fix action consumes the persisted findings and is the only mode that touches the working tree.

Stub-scaffold phase. When a stub-scaffold phase (the planning plugin's scaffold_stubs setting) is committed, fanout may review that diff before the bodies are filled in, so file layout and signatures get a review while they are still cheap to change. It runs as an ordinary review of the committed diff, with no argument, setting or step of its own.

Shared inputs

Arguments

A positional mode token (Step 0) plus two flags:

| Flag | Default | Effect |

|---|---|---|

| --yes / -y | Off | Skip the pre-execution confirmation gate for the fix action. Required for headless runs. |

| --unattended | Off | The caller declares that nobody is present (a loop, a routine, a lane rule). The review modes then run no proposed check and ask nothing. |

Unattended. A review-mode run is unattended when --unattended is passed or the environment

says nobody is present (CLAUDE_CODE_REMOTE set, claude -p, an autonomous loop), the test in

CODE0 "Who counts as

unattended". Every other run is attended. The fix action keeps its own session test and gate

(context/fix-pass-mode.md "Step 3: Plan + confirmation gate"); this

flag does not change them.

--yes applies only to the tree-mutating fix action; it is inert for the report-only review modes, which mutate nothing to gate. For fix it is the explicit headless opt-in: in a non-interactive session fix applies only with this flag; without it, fix emits its classification plan and stops (context/fix-pass-mode.md "Step 3: Plan + confirmation gate").

fanout_diversity (run-everything and its fallback only). It sets how the leaf fan-out

spreads: lens runs one reviewer agent per concern, model sends one review prompt to each

distinct fan-out model, and codex runs the lens roster with the Codex reviewer as the

model-diversity panel in place of those fan-out models

(context/run-everything-mode.md steps 3 and 5). The default

mode does not read it. Resolve it before step 5, lowest layer first: the

default lens; the user option ${user_config.fanout_diversity} (a literal, unexpanded

placeholder means unset); the PASS fanout_diversity: line of

node "${CLAUDE_PLUGIN_ROOT}/skills/setup/scripts/setup-apply.mjs" --check, run from the project

root, for the repository's docs/conventions/review.yaml ((unset) means no value there). When

the reviewed change set edits docs/conventions/review.yaml, skip that layer and say so, so the

change cannot pick how it is reviewed; without node, skip it and say so. Invalid values, WARN

lines and when the repository file is read at all: "Resolution" and "Root rule" in

CODE0. Report one line,

fanout_diversity: <value> (<layer>), for example fanout_diversity: lens (default).

Loosened-check settings (both review modes). Run-everything

(context/run-everything-mode.md step 5) and the default mode

(context/default-mode.md "Loosened-check brief") resolve them once

before dispatch. The bundled criterion always applies; consumer criteria apply in addition. The resolver takes the user options as `--verdict-option '${user_config.loosened_check_verdict}' --patterns-file

<memory_dir>/reviews/<branch-slug>/loosened-check-patterns.json` (a literal, unexpanded placeholder

means unset; <memory_dir> and <branch-slug> as

CODE0 defines them). First write that

file with the Write tool, its content exactly ${user_config.loosened_check_patterns}, so the

free-form value never passes through a shell. Add --spec-issue <number> for the issue the change

resolves; hand its text to the leaves as the spec only when the loosened_check_spec: line says

counts (a trusted person wrote it), otherwise hand no spec. When the change has a pull request,

also hand the leaves the ## Loosened checks section of its body, which gives a reason for an

ordinary check only; never the rest of the body. The repository-only

loosened_check_decision_record: line has no user option and goes to the leaves with the other

value lines.

When the run fails and the patterns option is not empty, run it once more without

--patterns-file so the repository's entries still apply, and say the user's entries were

dropped.

fanout_act_on_cap (both review modes). How many rows under each ## By axis heading

Step 2 marks act on. Resolve it before Step 2 from the same layers and with the same skip rules as

fanout_diversity: the default 2; the user option ${user_config.fanout_act_on_cap} (a

literal, unexpanded placeholder means unset; a value that is not a whole number of at least 1 is

invalid: name it and drop that layer); the PASS fanout_act_on_cap: line of the --check run

above, which the default mode runs for this key and the two reproduce_findings keys alone. Report one line, fanout_act_on_cap: <value> (<layer>), for example

fanout_act_on_cap: 2 (default).

reproduce_findings and reproduce_findings_floor (both review modes). Whether Step 2 runs

the proof stage, and from which tier. Resolve both before Step 2 from the same layers and with the

same skip rules as fanout_diversity: the defaults off and IMPORTANT; the user options

${user_config.reproduce_findings} and ${user_config.reproduce_findings_floor} (a literal,

unexpanded placeholder means unset); the PASS reproduce_findings: and

PASS reproduce_findings_floor: lines of the --check run above. Report one line each, for

example reproduce_findings: label (docs/conventions/review.yaml) and

reproduce_findings_floor: IMPORTANT (default). A floor layer whose value is not a tier (a

WARN line for the key, or a user option outside the three tiers) is not dropped silently: report

reproduce_findings_floor: <value> is not a tier (<layer>); every row attempted, and unless a later

layer sets a valid tier, Stage 5 sends every row to the gate (config.md).

No value makes reviewed code run without a person's yes to that exact command.

Step 0: Mode

Parse the flags (--yes / -y, --unattended) out of $ARGUMENTS first, then route on the remaining mode token:

Both review modes share the roster (context/leaf-roster.md) and the normalization pipeline. No duplicated roster or pipeline.

Dispatch contract (both review modes): every dispatched finding-producing leaf prompt carries

this coverage clause verbatim, appended to the leaf's own instructions. For slice leaves, appended

to the instantiated per-slice template (whose own coverage sentence is quality-gate's standalone

posture and states the same rule, not a competing contract): "Your goal at this stage is coverage:

it is better to surface a finding that later gets filtered out than to silently drop a real bug.

Report every issue you find, including ones you are uncertain about or consider low-severity. Do

not filter for importance or confidence at this stage, a separate normalization pass deduplicates

and ranks findings downstream. For each finding, include your confidence level (high / medium /

low) and an estimated severity. You are done when every changed file has been reviewed for your

concern; if part of the change set cannot be reviewed, name that part and return what you have."

The clause restores recall without moving the precision work: the pipeline's dedup and

agreement/rank stages remain the filter. Pointer: when judging whether current models still need

it, fetch the code-review guidance in prompting Claude Opus 5: capability improvements

live.

Intent paragraph. Every surface this skill dispatches itself (the default mode's leaves, and

the orchestrator plugins in either mode) gets the same short paragraph in its prompt, labeled as

the author's account of what the change is for. Reviewers test the change against that account and

report each place the two disagree; the paragraph is a claim under test, never proof that the

change works. Write it once, in your own words, before the first dispatch. Its sources are the PR

title and body if a PR exists, the commit subjects on the branch, and the user's request. If none

of them states a purpose, an attended session asks the user once; an unattended one ("Arguments")

or any other session that cannot ask writes Intent: not stated and reviews without it.

Finding class. Every per-concern brief this skill writes (criteria slices and reviewer briefs)

names the class of finding it wants (the leaf's concern, for example correctness) and what to leave

out (for example style); the coverage clause applies inside that class. The model diversity

hunters are the deliberate exception: they sweep every concern. Pointer:

best practices: review against your spec.

Pre-flight gate (both review modes)

Run the gate in change-set.md "Pre-flight gate" (the ask-shape check, then the unresolvable-base and nothing-to-review stops) before any surface is spawned. The fix action is exempt: it consumes persisted findings and spawns no reviewers.

Pilot a wide fan-out. Before dispatching more than about 4 surfaces, in either review mode, dispatch one surface alone, wait for its return, and confirm plan usage remains (the return carries no usage-limit error, and any usage reading the session has shows room for the rest) before dispatching the others. In default mode the pilot is the first of the per-surface Agent-tool calls; in run-everything mode it is one slice run before the workflow launch (context/run-everything-mode.md step 5). What a session, its agents and a workflow run do at a usage limit is upstream's rule:

Step 1: Detect lifecycle tier (default mode)

Read the pre-computed facts (the pre-flight gate above has already screened out unresolvable and empty change sets). Classify the change into a tier (thresholds + the judgment layer in change-set.md "Size tier"; what each tier dispatches in context/default-mode.md):

| Tier | Trigger | Surfaces dispatched |

|---|---|---|

| small | <50 changed lines | code-reviewer (always) + security-reviewer when security-sensitive paths touched |

| medium | 50–300 changed lines | small set + orchestrator plugin(s) + architecture-guardian when structural paths touched |

| large | >300 lines or cross-cutting | medium set + the project's ownerless review-criteria docs as slice-subagents |

Tier transparency (mandatory): before dispatch emit one line. Tier: <small|medium|large>; surfaces run: [...]; surfaces SKIPPED at this tier: [...]. A skip is a fidelity choice; naming it makes it overridable.

Step 2: Normalize

Run the 5-stage pipeline in findings-normalization.md over every surface's raw output. Before a CRITICAL finding enters the report, read its cited file:line in the diff; a finding the code does not bear out drops to low confidence with that note, never silently removed.

Proof. When reproduce_findings is label or require, run that file's "Stage 5: Proof"

next, with the floor and the unattended test resolved above. An attended run asks the person

before each proposed check, one question per exact command, and runs only what they approve;

--yes, an allow rule, auto mode or a setting is never that approval. An unattended run runs no

check and states how many were proposed. Under off, skip it: the report is unchanged.

Axis. Then give each finding one axis, spec or standards, by the rule in

findings-normalization.md "Axis assignment": spec

when it says the change does not do, or only partly does, what the intent paragraph says it is for.

The report lists the findings again under ## By axis, after ## By dimension, with ### Spec

before ### Standards (shape: CODE1

"Findings-file shape"). Fanout reviews the code against its stated purpose; it does not review a

spec or plan document.

Act on. Under each of ### Spec and ### Standards on its own, the first

fanout_act_on_cap rows in merged-rank order get yes in a last Act on cell and every later row

gets no. The count restarts at the second heading, so with a cap of 2 the first two Standards

rows read yes whatever their merged rank. A row listed under ## Dismissed reads no and is

not counted; that includes every row Stage 5 demoted (a refuted row under label or require,

and under require every row at or above the floor that was not reproduced). Every row stays in

the report.

Dismissed. The report gains a ## Dismissed section after ## By axis: one line per

finding this step demoted, giving its rank, its location and the reason in one sentence taken from

what the cited line shows, or, for a Stage 5 demotion, the not reproduced reason Stage 5 words. A finding demoted by both keeps one line carrying both reasons. The finding itself stays in ## Findings at its demoted confidence. The

section lists demotions only; no finding leaves the report, so nothing is listed as dropped. With

no demotion, the section reads none. The fix action parses it and surfaces every listed row

instead of applying it, so each line leads with - <rank>, <location>:.

When a surface returns after findings were presented for a decision and before the user answers,

the next message that presents findings ends with every open finding in full:

docs/contracts/async-round-presentation/README.md in the marketplace.

Step 3: Persist findings

Run the self-ignore guard ("Shared inputs"), then write the ranked report into the resolved findings location as <UTC-timestamp>-<topic>.md, with <topic> sanitized to [a-z0-9._-]. The timestamp format is in "Shared inputs". Relativize machine paths before writing. Findings cite file:line repo-relative only. File-name collision rule and file shape contract: CODE4 "Findings-writer contract" and "Findings-file shape".

Orchestrator plugins

Three optional orchestrator plugins add adversarial breadth. Two same-vendor Claude plugins from the claude-plugins-official marketplace, plus OpenAI Codex through this marketplace's external-agents plugin as a different-model surface. All run on the main thread: they fan out their own agents, and how deep a subagent may nest is a user setting outside this skill's control. Pointer: for the nesting default, how to change it, and what happens at the limit, fetch sub-agents: let subagents spawn their own subagents live. Each is a graceful enhancement, not a hard dependency:

Boundary, the bundled command and the managed service

Two further Claude Code surfaces overlap this skill's job on an open PR: the bundled /code-review command and the managed Code Review GitHub App service. Neither is a marketplace plugin, which is what separates them from the code-review orchestrator plugin dispatched above. CODE2's "Boundary" section describes all three surfaces and what each one mutates; that description is not repeated here. What is specific to this skill:

Neither is dispatched as a normalized fan-out surface and findings-normalization.md carries no parse contract for either, but for different reasons. The managed service posts its findings to the PR instead of returning them to this skill. A bare /code-review run is left out because it is a second review of the same diff, overlapping this skill's own leaf reviewers, and this skill has no parse contract for its output. Run it directly when you want that second review. Pointer: for what a bare run writes and where its findings appear, fetch code-review: what the review reads and edits and code-review: how findings are reported live. Recheck trigger: a bare run starts editing or posting, or its findings gain a documented schema a parse contract could rest on. This skill names the overlap in ## Surfaces rather than dispatching it. PR-mutation gate: /code-review --comment and triggering the managed service both post to the PR, which violates the review modes' report-only contract; when the branch has an open PR, invoke either only on explicit user opt-in ("post the review comment"), otherwise note the overlap in ## Surfaces without invoking it. Not enabled/available → note the skip; a repository's own CI review bot (e.g. the managed service, when enabled) still provides PR coverage independently.

Spoke paths

The context/ files write the plugin root as <plugin-root>, which is ${CLAUDE_PLUGIN_ROOT}. Substitute it before running a command or writing it into a brief: a spoke arrives as plain bytes, so a ${…} token in it would reach Bash unexpanded. Pointer: <https://code.claude.com/docs/en/plugins/manifest-reference#where-each-variable-resolves>.

Next

Related

What this skill does not do

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.