review-pipeline
Multi-stage iterative review pipeline across all active worktree branches
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Multi-stage iterative review pipeline across all active worktree branches
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Post-merge integration gate — cleanup, build, test, verify issues, update memory
Post-merge integration gate — cleanup, build, test, verify issues, update memory
Multi-stage iterative review pipeline across all active worktree branches
| name | review-pipeline |
| description | Multi-stage iterative review pipeline across all active worktree branches |
| user-invokable | true |
Run an iterative review pipeline on active worktree branches. Repeats until zero P0s and P1s remain or the iteration limit is reached.
This is the ONLY review mechanism. Do not substitute with ad-hoc
self-review agents, custom subagents, or any improvised review approach.
The standalone /self-review and /codex-review skills have been merged
into this single pipeline. When the user says "review", "run reviews",
or any variation, invoke THIS skill.
The non-interactive heart of each review round — discover branches →
two-LLM-family review → consolidate — is the review-core Workflow
(.claude/workflows/review-core.js), which runs the shared
dual-family-review engine. This skill is the orchestrator: it invokes
review-core once per round and owns everything interactive or
state-changing (the user gates, fixes, pushes, the Copilot phase, merges,
and issue-filing).
Why this split — and why the gates live here, not in the workflow:
review-core, every reviewer
(Claude finder, Codex finder, and every cross-family verifier) emits the
same schema; cross-confirmation and dedup are deterministic JS, not the
main agent eyeballing prose. Claude and Codex findings come back in one
shape every round.review-core invoked between them.Invoking review-core from this skill is the sanctioned Workflow opt-in
(a skill whose instructions call the Workflow tool).
review-core auto-discovers all .claude/worktrees/*/
branches diverged from main.branches: ["<name>"].--skip-codex: pass skipCodex: true (single-LLM-family; every P0/P1
finding returns as NEEDS-VERIFICATION — P2s are single-family-reported either way).Track the current round number and report it in each consolidation
(e.g., "Review Round 2 of 4"). Pass it to review-core as round: N.
review-core (one round)Call the Workflow tool:
Workflow(name="review-core", args={
round: <N>, // 1 on the first round
base: "main",
branches: <["branch"] | omit to auto-discover>,
skipCodex: <true if --skip-codex>,
priorFindings: <prev round's findings, or omit on round 1>, // see Step 5
})
review-core runs in the background and returns a structured payload:
{ meta: { round, base, repoRoot, headSha, codexUsable, sammyRoot, isWorktree },
mergeOrder: ["branch", ...], // smallest-diff-first; parallel-safe if no overlap
overlaps: [{ a, b, sharedFiles[] }],
perBranch: [{ branch, crates, claudeAssessment, codexAssessment, tierCounts,
verifiedP0[], verifiedP1[], needsVerification[], refuted[],
p2s[] (each with .disposition: fix-now|defer), circular[], recurring[] }],
deferredP2s: [...], // P2s outside the changed crates (Step 9)
counts: { branches, verifiedP0, verifiedP1, needsVerification, refuted, p2, recurring } }
Each VERIFIED / NEEDS-VERIFICATION / REFUTED finding carries status (VERIFIED
= ≥2 LLM families agreed; NEEDS-VERIFICATION = single-family / split / codex
unavailable; REFUTED = cross-family refuted); born-P2 findings (p2s) carry a
disposition rather than a status. All findings carry file, line, claim,
reasoning, primarySource, suggestedFix, confidence, and recurring
(matched a prior round).
Codex note: review-core runs Codex as the second family via the engine.
If meta.codexUsable is false (codex absent / --skip-codex), the round is
single-family and every P0/P1 finding is NEEDS-VERIFICATION (P2s are
single-family-reported either way) — say so. If codex was
expected but consistently fails, check codex --version / upgrade
(brew upgrade codex or npm i -g @openai/codex@latest); do not work around
with model overrides. Codex is supplementary, not blocking.
Render the returned payload as a consistent per-branch report:
.disposition / tier) — the
workflow proposes fix-now / defer / dismiss; the user decides:
deferredP2s).mergeOrder (+ any overlaps).recurring reappeared after a prior
"fix" — flag it explicitly; the user must decide the approach.circular[] entry
(its note, file:line, family) — a test whose oracle may mirror buggy
behaviour is a HIGH-PRIORITY signal the engine computes but the gate must not
silently drop.If the PR's purpose is P2 burndown / tech-debt reduction, "Defer" is
restricted to a different crate or subsystem than the one being fixed.
review-core already marks same-crate P2s disposition: fix-now; honor that —
do not defer same-crate P2s, or debt accrues faster than it is paid down.
Consolidation gate — present the report, then apply the fix-all default. Per CLAUDE.md ("Finding disposition: fix ALL by default"), the standing disposition is to fix EVERY P0/P1/P2 finding; deferring to a GitHub issue is the rare exception requiring an explicit engineering reason. Present the full consolidation for transparency, then proceed to Step 3 fixing all findings — do not ask the user to pick a subset. STOP for user input only when a finding looks like a false positive the user should adjudicate, or when a fix would require a genuine scope decision (different subsystem, breaking contract).
Launch one fix subagent per worktree
in parallel, using .claude/templates/fix-subagent-prompt.md (it encodes
the DRY pre-step and no-scope-dodging rules). Each fix agent must:
cargo fmt --all.cargo clippy --workspace --exclude nereids-python --all-targets -- -D warnings.cargo test --workspace --exclude nereids-python.pixi run test-python — cargo test cannot catch
pytest.approx baseline regressions.scripts/worktree-commit.sh <worktree-name> "<msg>" [files]
(GPG-signed).After all fix agents complete:
git status.cargo check after any rebase before push.git push origin {branch}.After pushing, decide. "Blocking findings" this round =
counts.verifiedP0 + counts.verifiedP1 + counts.needsVerification — i.e. every
VERIFIED and NEEDS-VERIFICATION P0/P1. NEEDS-VERIFICATION findings (single
LLM family / split vote / codex unavailable) BLOCK exactly like VERIFIED ones;
they must be fixed or explicitly user-dismissed before push. (P2s never block.)
priorFindings = this round's findings (each as
{branch, file, line, title}) so review-core tags RECURRING.Why bind to NEEDS-VERIFICATION: P0 is the engine's must-fix tier, and in
--skip-codex single-family mode every P0/P1 lands in NEEDS-VERIFICATION
(verifiedP0/verifiedP1 are 0). Gating on verified counts alone would let
un-cross-verified P0s pass.
Re-run between rounds, not just once. File overlap can appear mid-pipeline
(a fix lands in a file another branch also touches); the fresh mergeOrder
each round reflects this.
After Phase A completes (zero P0s/P1s) and branches are pushed:
Inform the user Phase A is complete and branches are pushed. Ask them to trigger Copilot review on GitHub. STOP and wait.
When the user says Copilot reviews are in, fetch comments:
pixi run copilot-reviews {pr_numbers...} --dedup
Classify each Copilot comment as P1 or P2.
Decision criteria:
Dismiss Copilot comments that rehash already-addressed issues or flag impossible edge cases.
Present the Copilot resolution summary to the user.
MANDATORY: End your turn here and wait for user approval.
Present a concise summary table:
### Pre-Merge Summary — Batch {name}
| PR | Branch | Issue | Key Changes | Review Status |
|----|--------|-------|-------------|---------------|
| #{n} | {branch} | #{issue} | {1-line summary} | Phase A ✓ Phase B ✓ |
**Merge order**: {from review-core's top-level mergeOrder}
**Review rounds**: Phase A: {N} round(s), Phase B: {N} Copilot comment(s)
**Findings resolved**: {W} P0s fixed, {X} P1s fixed, {Y} P2s fixed, {Z} P2s deferred
**Tests on branches**: {N} Rust tests — all pass
Do NOT run gh pr merge until the user responds with explicit approval.
After the user approves:
mergeOrder using gh pr merge --squash --delete-branch.git worktree remove {path} --force per merged branch.git branch -D {branch} per branch./post-merge (pulls main, cargo clean && pixi run build, workspace
tests, Python tests, issue verification, memory updates).IMPORTANT: pixi run build must run first after cargo clean — it catches
cross-PR signature mismatches that per-branch reviews miss.
Do NOT skip this step. review-core returns deferredP2s — file them so
nothing is lost:
deferredP2s by branch/crate.file:line references.When launching fix subagents, ALWAYS include (and use
.claude/templates/fix-subagent-prompt.md):
pixi run build / pixi run test-python — never raw
maturin develop or pip install."scripts/worktree-commit.sh <worktree-name> '<message>' [files]
for all commits."pixi run gh-issues for issue/PR queries."