<!-- markdownlint-disable-file MD041 -->
STARTER_CHARACTER = ⚡
Diff Review
Review everything that differs from
across 9 perspectives, each by one subagent. The nine areas' findings then run through the same scripted collate, merge, rank, and isolated-judge verification chain review-deep uses. No arguments.
Available on Claude Code (through this plugin) and Codex. Fails preflight by name on OpenCode and Hermes Agent, neither of which can dispatch a subagent to a named reviewer type.
This skill runs
, dispatched as a subagent with no user present to answer a prompt. Never pause before dispatch to confirm scope, cost, or model spend; the diff is whatever it is.
Step 1: Preflight
Determine your harness. In Claude Code,
and
is this plugin's root, two directories up from this SKILL.md. In Codex,
;
does not apply there, since the nine Codex reviewer agents live at a fixed path, not inside a plugin.
bash
S="${CLAUDE_SKILL_DIR}/../review-deep/scripts" # replace ${CLAUDE_SKILL_DIR} with this SKILL.md's own directory on a non-Claude harness
[ -f "$S/init_run.py" ] || { echo "scripts not found at $S"; exit 1; }
HARNESS=claude
PLUGIN_ROOT="$(cd "${CLAUDE_SKILL_DIR}/../.." && pwd)"
OUT=$(python3 "$S/preflight.py" --tier diff --harness "$HARNESS" --plugin-root "$PLUGIN_ROOT")
STATUS=$?
echo "$OUT"
[ "$STATUS" -eq 0 ] || exit 1
LABEL=$(echo "$OUT" | sed -n 's/^LABEL=//p')
AGENT_PREFIX=$(echo "$OUT" | sed -n 's/^AGENT_PREFIX=//p')
checks every tool, agent file, and ref this skill needs (including that
or
resolves), prints one
or
line per check, and exits 1 on any
. On success it also prints
(the reviewer source name behind
) and
(the namespace prefix for the nine subagent types;
in Claude Code, empty in Codex). The
guard catches a partial or corrupted plugin or skill install.
Step 2: Resolve the Base
bash
PROJECT_ROOT=$(git rev-parse --show-toplevel)
BASE_REF=$(git rev-parse --verify --quiet origin/main || git rev-parse --verify --quiet main)
if [ -z "$BASE_REF" ]; then
echo "No main branch found (tried origin/main and main)"
exit 1
fi
BASE=$(git merge-base HEAD "$BASE_REF")
# On main itself the merge base is HEAD, which would hide committed work.
# Fall back to the previous commit so the branch tip is still under review.
if [ "$BASE" = "$(git rev-parse HEAD)" ]; then
BASE=$(git rev-parse --verify --quiet HEAD~1 || echo "$BASE")
fi
echo "BASE=$BASE"
Step 3: Collect the Delta
bash
git log --oneline "${BASE}"..HEAD
git diff "${BASE}" --find-renames --stat
git diff "${BASE}" --find-renames
git status --porcelain
git ls-files --others --exclude-standard
carries no
, so it spans the merge base through the working tree. Committed, staged, and unstaged changes all land in one diff.
surfaces renames as
entries with both paths so a pure rename does not collapse into an empty diff.
is the authoritative list of every modified, added, deleted, renamed, copied, and untracked entry.
surfaces untracked files, which have no diff representation. Files matching
are excluded.
Stop when all five signals are empty (the commit log, the diffstat, the diff, the status, and the untracked list). Report
and stop.
Step 4: Start the Run
bash
python3 "$S/init_run.py" --kind diff --base "$BASE" "$PROJECT_ROOT" "$PROJECT_ROOT" "$PROJECT_ROOT/.llmtmp/review-diff"
Prints
and
.
is
${XDG_CACHE_HOME:-~/.cache}/review-diff/<repo>-<commit12>
, outside the repository. On a clean working tree
is HEAD. On a dirty one,
snapshots the working tree into an unreferenced commit over HEAD, so the reviewers, the
below, and the scripted chain's judges all see the exact same uncommitted edits.
carries
,
, and
ticket_label: review-diff
.
Step 5: Materialize the Input
Write the whole change set to one file. Reviewers hold
but no
, so they cannot run git themselves. Passing the diff through nine prompts costs nine copies of it in orchestrator output; writing it once and having each reviewer read it costs one.
bash
STATE_DIR="$PROJECT_ROOT/.llmtmp/review-diff"
mkdir -p "$STATE_DIR"
find "$STATE_DIR" -mindepth 1 -delete
INPUT="$STATE_DIR/input.md"
{
echo "# Change set vs merge-base ${BASE}, reviewed at commit ${COMMIT}"
echo; echo "## Commits"; git log --oneline "${BASE}"..HEAD
echo; echo "## Status"; git status --porcelain
echo; echo "## Diffstat"; git diff "${BASE}" "${COMMIT}" --find-renames --stat
echo; echo "## Diff"; git diff "${BASE}" "${COMMIT}" --find-renames
} > "$INPUT"
for f in $(git ls-files --others --exclude-standard); do
{ echo; echo "## Untracked file: $f"; cat -n "$f"; } >> "$INPUT"
done
wc -c "$INPUT"
git diff "$BASE" "$COMMIT"
replaces the old
against the working tree: reviewers must see exactly what the scripted chain's judges will later check out and verify, and
(a snapshot when the tree is dirty, HEAD otherwise) is that same, fixed point. Untracked files carry no diff representation, so their full contents are appended with line numbers.
then
rather than
. A
shim on
(as in some dotfiles setups) moves paths to Trash and exits non-zero on a missing path even under
, which breaks the wipe on a first run.
Step 6: Build the Ledger
bash
python3 "$S/ledger.py" "$STATE_DIR" --diff "$PROJECT_ROOT" "$BASE" "$COMMIT"
python3 "$S/partition.py" "$STATE_DIR"
runs
git diff --name-only --no-renames --diff-filter=d
between
and
, so a rename gives its new path once and a deletion is dropped. The reviewers work from
directly, not from
's components;
's coverage section is what actually reads them.
Step 7: Dispatch 9 Reviewers in Parallel
Issue all 9 Agent calls
in a single tool block with
.
Subagents default to running in the background. A backgrounded fan-out delivers its results in later turns, so Step 8 would find nothing to consolidate. Synchronous dispatch in one block is what makes the fleet parallel and the report possible in this turn.
| Agent type | Area |
|---|
${AGENT_PREFIX}reviewer-architecture
| architecture |
${AGENT_PREFIX}reviewer-correctness
| correctness |
${AGENT_PREFIX}reviewer-data
| data |
${AGENT_PREFIX}reviewer-ops
| ops |
${AGENT_PREFIX}reviewer-performance
| performance |
${AGENT_PREFIX}reviewer-quality
| quality |
${AGENT_PREFIX}reviewer-security
| security |
${AGENT_PREFIX}reviewer-solid
| solid |
${AGENT_PREFIX}reviewer-testing
| testing |
Dispatch all 9 every run. Do not skip a perspective based on which files changed.
Every prompt is identical apart from nothing. Send this, with
and
substituted:
text
Read <INPUT>. It holds the commit log, porcelain status, diffstat, full diff
against the merge-base with main, and the full contents of every untracked
file. That is the complete change set under review.
The project root is <PROJECT_ROOT>. Every path in the diff is relative to it.
Open any file you need in that tree to confirm a finding and to confirm the
line number you cite.
Audit this change set. Apply the Ownership table in your instructions: report
only defect classes you own, and stay silent on the rest.
Write your findings to <STATE_DIR>/<LABEL>-<area>.md. Use an H2 header
followed by findings or exactly "No findings."
The brief stays short on purpose. Severity, citation format, output shape, and lane discipline all live in the agent definitions, so one edit there changes every caller.
Do not pack repomix. The input file holds everything.
Step 8: Check and Re-dispatch
bash
python3 "$S/check_reviews.py" "$RUN_DIR" "$LABEL"
Prints one
or
line per area and exits 1 when any fails: the file is missing, has no H2, has no finding and is not exactly
, or holds a bullet that parses as neither
nor
. Two causes are common here: the agent died on a transient API error and wrote nothing, or a hook blocked its read of
and it wrote a refusal instead. Re-dispatch each failing area's agent once, using the same prompt as Step 7, then run
again. A second failure is reported as not reviewed in Step 9, not retried further.
Editing an agent definition does not affect a session already running. Claude Code detects agent files being added or removed, but a session keeps the body it loaded at startup, and a definition reached through a symlink (as dotbot installs them) is not re-read on edit. Restart the session after changing a reviewer.
Step 9: Run the Scripted Chain and Report
Run each model stage as a background Bash call; its pool returns when every call has finished, and the completion notification is the signal to continue. Never poll a running stage with
. Run the stage command itself as the background call. Never detach it with
or a trailing
, and never wait on a log line with
.
exits only when it next writes, so the call hangs until its timeout once the log gets its last line.
bash
python3 "$S/checkout.py" "$RUN_DIR"
python3 "$S/normalize.py" "$RUN_DIR"
python3 "$S/collate.py" "$RUN_DIR" # one model call per component, background
uv run --with scikit-learn --with scipy --with numpy python "$S/windows.py" "$RUN_DIR"
python3 "$S/merge.py" "$RUN_DIR" # one model call per similarity window, background
python3 "$S/rank.py" "$RUN_DIR"
python3 "$S/verify.py" "$RUN_DIR" # one model call per Critical or High issue, background
python3 "$S/report.py" "$RUN_DIR"
A diff's scope is usually small enough to afford verifying Medium-severity issues too: pass
to
(
python3 "$S/verify.py" "$RUN_DIR" --floor Medium
) to widen it past the Critical/High default.
Report the counts from
, the confirmed issues, and
to the operator. The run directory is valid input to the review-tickets skill, with ticket label
.
Tests
See review-deep's Tests section. The same
at the root of this plugin's repository covers every skill here, including
for this skill's preflight tier.