Skip to content

Commit babc5db

Browse files
Brian O'Kelleyclaude
andcommitted
feat(agents): triage runs pre-PR expert review on diff before opening PR
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) <noreply@anthropic.com>
1 parent 6bd434d commit babc5db

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

.agents/routines/triage-prompt.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,50 @@ related fixes, or "items 1-5 after PR #N" — decide:
253253
A single cohesive PR is easier to review than three PRs with
254254
dependencies. The bot reduces maintainer clicks, not multiplies them.
255255

256+
## Pre-PR expert review — mandatory before `gh pr create`
257+
258+
After the branch is pushed but **before** opening the PR, run a
259+
second expert pass on the actual diff. The Step 4 synthesis
260+
reviewed the plan; this step reviews the code. They catch
261+
different things — protocol drift, broken tests, overlong files,
262+
wrong PR target, typos — before a human reviewer sees anything.
263+
264+
1. Capture the diff: `git diff main...HEAD`.
265+
2. Spawn 2 experts **in parallel** via Task:
266+
- `code-reviewer` — always
267+
- The domain expert matching the bucket (same one from
268+
Step 4; for cross-cutting diffs, pick the bucket the diff
269+
primarily touches)
270+
3. Pass each expert: the diff + 2–3 sentences of intent ("Issue
271+
#N asks for X; this PR does Y by touching Z"). Ask them to
272+
classify each finding as **blocker**, **nit**, or **out of
273+
scope**.
274+
4. **Fix blockers.** Re-run only the experts that flagged
275+
blockers on the updated diff. Cap at **2 review→fix
276+
iterations.** If blockers persist after two passes, abandon
277+
the PR and Flag for human review instead.
278+
5. Surface nits in the PR body; don't fix them.
279+
6. If experts disagree on a blocker, do **not** resolve it
280+
yourself — Flag for human review with both positions.
281+
7. Record both sign-offs in the PR body:
282+
283+
```
284+
**Pre-PR review:**
285+
- code-reviewer: approved (1 nit noted)
286+
- ad-tech-protocol-expert: approved — non-breaking per spec
287+
```
288+
289+
**Never skip this step**, not even for one-line typo fixes.
290+
Cost is ~90 seconds of Task calls; benefit is two perspectives
291+
have read the diff before a human reviewer does.
292+
256293
## PR constraints
257294

258295
- Branch: `claude/issue-<N>-<short-slug>`
259296
- Status: **draft**
260297
- Title: conventional-commits (`fix(adcp): …`, `docs(adcp): …`) —
261298
release-please reads titles for versioning
262-
- Body: `Closes #N`, summary, what-tested, expert-consensus,
299+
- Body: `Closes #N`, summary, what-tested, **Pre-PR review** block,
263300
`Session:` link
264301
- Before pushing:
265302
- `pytest` on the subset touching your change (don't run full

0 commit comments

Comments
 (0)