Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6814d72
feat(agents): [#2904] add the pr-review-handler agent
josecelano-bot Nov 19, 2026
9daae1a
docs(wait-for-pr-review): [#2904] say which agent runs a review round
josecelano-bot Nov 19, 2026
4a168aa
docs(process-pr-review): [#2904] say which agent runs the workflow
josecelano-bot Nov 19, 2026
9c73efc
docs(issues): [#2904] start the inventory of the removed profiles' rules
josecelano-bot Nov 19, 2026
47e8e2b
docs(issues): [#2904] record scenarios M1 and M2 for pr-review-handler
josecelano-bot Nov 19, 2026
614232d
docs(issues): [#2904] mark task T4 in progress with M1 and M2 done
josecelano-bot Nov 19, 2026
ab9a747
docs(agents): [#2904] align pr-review-handler with the review of task T4
josecelano-bot Nov 19, 2026
8c35789
docs(wait-for-pr-review): [#2904] say that the session syncs the bran…
josecelano-bot Nov 19, 2026
67d4f43
docs(issues): [#2904] correct where the M1 transcript holds the prelo…
josecelano-bot Nov 19, 2026
7044dcb
docs(issues): [#2904] record the task review of T4 and check AC2
josecelano-bot Nov 19, 2026
1014adb
docs(issues): [#2904] store the records of the M1 and M2 run in the r…
josecelano-bot Nov 19, 2026
7d565da
docs(issues): [#2904] say in V1 that the agent file changed after the…
josecelano-bot Nov 19, 2026
fde106a
docs(issues): [#2904] narrow the inventory note on loading AGENTS.md …
josecelano-bot Nov 19, 2026
2ef09d1
docs(issues): [#2904] log the task review of T4 in the Progress Log
josecelano-bot Nov 19, 2026
594b0fb
docs(issues): [#2904] update last-updated-utc of the manual verificat…
josecelano-bot Nov 19, 2026
e3ad74d
docs(pr-reviews): [#2904] add the audit record of PR #2963 review rou…
josecelano-bot Nov 19, 2026
7c97816
docs(issues): [#2904] record scenario M3 and the first round count of…
josecelano-bot Nov 19, 2026
c3fe6b0
docs(issues): [#2904] mark scenario M3 and task T4 done
josecelano-bot Nov 19, 2026
a84d265
docs(issues): [#2904] say how many commits addressed the review of T4
josecelano-bot Nov 19, 2026
e277292
docs(issues): [#2904] store the session's listing and the agent's rep…
josecelano-bot Nov 19, 2026
647ffe7
docs(pr-reviews): [#2904] name the heads of PR #2963 round 1 by commi…
josecelano-bot Nov 19, 2026
8db3b0b
docs(pr-reviews): [#2904] count six sections in the F1 verification o…
josecelano-bot Nov 19, 2026
f3bc03f
docs(pr-reviews): [#2904] record PR #2963 review round 2 in the audit
josecelano-bot Nov 19, 2026
d220278
docs(issues): [#2904] store the records of the M3 runs and count revi…
josecelano-bot Nov 19, 2026
6576113
docs(issues): [#2904] name the source of the wait-ceiling variable in V3
josecelano-bot Nov 19, 2026
0a94063
docs(issues): [#2904] check AC3 with the evidence of scenario M3
josecelano-bot Nov 19, 2026
3bffe75
docs(pr-reviews): [#2904] give the F9 verification of PR #2963 a chec…
josecelano-bot Nov 19, 2026
0a751f7
docs(pr-reviews): [#2904] record PR #2963 review round 3 in the audit…
josecelano-bot Nov 19, 2026
3ec1086
docs(pr-reviews): [#2904] record the replies and resolutions of PR #2…
josecelano-bot Nov 19, 2026
37a1450
docs(issues): [#2904] name the round definition of V6 and count revie…
josecelano-bot Nov 19, 2026
14c510b
docs(pr-reviews): [#2904] record PR #2963 review round 4 in the audit…
josecelano-bot Nov 19, 2026
da4bfcc
docs(pr-reviews): [#2904] record the reply and resolution of PR #2963…
josecelano-bot Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .claude/agents/pr-review-handler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: pr-review-handler
description: Processes one round of pull-request review feedback, from Copilot, a person or a bot, through the process-pr-review workflow, and returns a short report. Use when a review or comment arrived on a pull request, open, merged or replaced, and its findings must be fixed, replied to, recorded and resolved.
model: claude-opus-5-5
tools: Bash, Read, Edit, Write, Grep, Glob
skills:
- process-pr-review
- fetch-review-threads
- resolve-review-threads
- commit-changes
---

# Pull-Request Review Handler

You process one round of review feedback on one pull request, for every reviewer: Copilot, a
person or another bot. The session that owns the pull request starts you after its poller reports a
`review` or `comment` event, with the branch already at the commit the event is about. That session
keeps the rest of the [`wait-for-pr-review`](../skills/wait-for-pr-review/SKILL.md) loop, as its
section "The Review Loop" lists; you run the processing half.

Your model is pinned in this file because review loops were the main cost of earlier work, and the
role runs on one known model so that the number of rounds can be measured.

## Inputs

The session gives you:

- the pull-request number and the repository;
- the event the poller returned: its `kind`, the review or comment ID and URL, `head_sha` and
`cursor`;
- the command that acts on GitHub as the contributor's account, when it is not `gh`, and the
command that pushes the branch, when it is not `git push`;
- anything it already knows about this round, such as an earlier undecided finding and the
contributor's answer.

When an input is missing and you cannot read it from the pull request, return a question instead of
guessing.

## Workflow

Run the [`process-pr-review`](../skills/process-pr-review/SKILL.md) workflow; it is preloaded. It
alone defines the audit record `docs/pr-reviews/pr-<number>-review/PR-REVIEW.md`, finding
normalization, dispositions, current-tree verification, commits, replies, the resolution order and
the completion checks. Follow `AGENTS.md` and the preloaded `commit-changes` skill for commits.
Follow the skill's sections for a pull request that was merged, or closed and replaced by
another: after a merge you stop after the read-only triage and return its proposal.

You start no other agent. You cannot ask the contributor anything: a finding that needs their
decision (a design choice, a scope change, a post-merge disposition, anything the skill says to ask
about) is not acted on. Record it as the skill says and return it as a question.

## Report

Return a short plain-text report, with no claim beyond what you ran:

- the reviews and comments processed, by ID;
- each finding: its ID in the audit record, its disposition and its thread state;
- the commits pushed, by subject, and the head that `git ls-remote` showed after the push;
- the replies posted and the threads resolved, and the count of unresolved threads after a refresh;
- the exit code of `validate-audit-record.py`;
- the questions for the contributor, one per undecided finding, or "none".
7 changes: 6 additions & 1 deletion .claude/skills/process-pr-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: process-pr-review
description: "Process every pull-request review finding, from Copilot, a person or a bot: fix, reply, record. Use when addressing PR review feedback, even after merge or on a replaced PR."
metadata:
author: torrust
version: "1.8"
version: "1.9"
semantic-links:
related-artifacts:
- docs/issues/closed/2219-2003-unify-pr-review-processing/ISSUE.md
Expand All @@ -23,6 +23,11 @@ repository review agents, deliver findings through GitHub only and create no
repository artifact. Process all authors through this workflow; author
classification adds context but never changes the audit or resolution requirements.

Who runs it: in Claude Code, the [`pr-review-handler`](../../agents/pr-review-handler.md) agent runs
this workflow for one review round, on a pinned model, when the session that owns the pull request
delegates the round to it ([`wait-for-pr-review`](../wait-for-pr-review/SKILL.md) says what the
session keeps). Any session can also run the workflow itself.

## Purpose

Process every review finding correctly, efficiently, traceably, and deterministically: handle
Expand Down
10 changes: 9 additions & 1 deletion .claude/skills/wait-for-pr-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: wait-for-pr-review
description: Wait for Copilot or maintainer reviews with a deterministic Rust poller that spends no tokens, then run the review loop. Use when waiting for a review of an opened or updated PR.
metadata:
author: torrust
version: "1.2"
version: "1.3"
semantic-links:
related-artifacts:
- .claude/skills/wait-for-pr-review/tool/Cargo.toml
Expand Down Expand Up @@ -141,6 +141,14 @@ and nothing in that gap is missed.

## The Review Loop

Who runs a round: in Claude Code, the session that owns the pull request can delegate the processing
of one `review` or `comment` event (step 2, from `process-pr-review` to the push, the replies and the
resolved threads) to the [`pr-review-handler`](../../agents/pr-review-handler.md) agent, which runs
on its pinned model and returns a short report. The session keeps the rest: the poller, bringing the
branch to the commit the event is about before it delegates (the start of step 2), the checks of the
new head, the re-request, the round count, the exit condition and the watching after it. A
session that does not delegate, or runs in another tool, runs step 2 itself.

1. Run the poller with `--since-head-sha "$(git rev-parse HEAD)"`. After an event that needed no
push, add `--since <cursor>` from that result.
2. Branch on `kind`:
Expand Down
Loading