From 24208b99e13c77fdfde8720411392df1b9b604c5 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Thu, 23 Apr 2026 23:12:59 -0400 Subject: [PATCH] feat(agents): triage runs pre-PR expert review on diff before opening PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors adcontextprotocol/adcp#2999. Adds mandatory pre-PR expert review on the diff (code-reviewer + domain expert in parallel) before `gh pr create`, capped at 2 review→fix iterations. Sign-offs recorded in PR body. Paired with flipping triage routines to Sonnet 4.6 so multi-step flows complete inside the idle-timeout window. Co-Authored-By: Claude Opus 4.7 (1M context) --- .agents/routines/triage-prompt.md | 39 ++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.agents/routines/triage-prompt.md b/.agents/routines/triage-prompt.md index 65edddc9f..a46acde84 100644 --- a/.agents/routines/triage-prompt.md +++ b/.agents/routines/triage-prompt.md @@ -253,13 +253,50 @@ related fixes, or "items 1-5 after PR #N" — decide: A single cohesive PR is easier to review than three PRs with dependencies. The bot reduces maintainer clicks, not multiplies them. +## Pre-PR expert review — mandatory before `gh pr create` + +After the branch is pushed but **before** opening the PR, run a +second expert pass on the actual diff. The Step 4 synthesis +reviewed the plan; this step reviews the code. They catch +different things — protocol drift, broken tests, overlong files, +wrong PR target, typos — before a human reviewer sees anything. + +1. Capture the diff: `git diff main...HEAD`. +2. Spawn 2 experts **in parallel** via Task: + - `code-reviewer` — always + - The domain expert matching the bucket (same one from + Step 4; for cross-cutting diffs, pick the bucket the diff + primarily touches) +3. Pass each expert: the diff + 2–3 sentences of intent ("Issue + #N asks for X; this PR does Y by touching Z"). Ask them to + classify each finding as **blocker**, **nit**, or **out of + scope**. +4. **Fix blockers.** Re-run only the experts that flagged + blockers on the updated diff. Cap at **2 review→fix + iterations.** If blockers persist after two passes, abandon + the PR and Flag for human review instead. +5. Surface nits in the PR body; don't fix them. +6. If experts disagree on a blocker, do **not** resolve it + yourself — Flag for human review with both positions. +7. Record both sign-offs in the PR body: + + ``` + **Pre-PR review:** + - code-reviewer: approved (1 nit noted) + - ad-tech-protocol-expert: approved — non-breaking per spec + ``` + +**Never skip this step**, not even for one-line typo fixes. +Cost is ~90 seconds of Task calls; benefit is two perspectives +have read the diff before a human reviewer does. + ## PR constraints - Branch: `claude/issue--` - Status: **draft** - Title: conventional-commits (`fix(adcp): …`, `docs(adcp): …`) — release-please reads titles for versioning -- Body: `Closes #N`, summary, what-tested, expert-consensus, +- Body: `Closes #N`, summary, what-tested, **Pre-PR review** block, `Session:` link - Before pushing: - `pytest` on the subset touching your change (don't run full