Skip to content

Commit c4a9fe6

Browse files
committed
refactor(pr-review-toolkit): simplify overlap sections and restructure report
Collapse possiblePlusOnes/partialOverlaps into a single relatedToExisting section, simplify overlap and recommendation enums to binary (overlaps/already_covered), remove actionPlan and coverageSummary from the board schema, restructure the SKILL.md report layout with per-finding recommendation rationale, replace the 9-command keyword system with contextual AskUserQuestion options, and add thread reply posting for overlap findings via add_reply_to_pull_request_comment. Assisted-by: Claude:claude-opus-4-6
1 parent b5a8b05 commit c4a9fe6

4 files changed

Lines changed: 176 additions & 202 deletions

File tree

pr-review-toolkit/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pr-review-toolkit",
3-
"version": "1.7.0",
3+
"version": "1.8.0",
44
"description": "Comprehensive PR review board using shared workflow context",
55
"author": {
66
"name": "cblecker",

pr-review-toolkit/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,15 @@ The workflow returns a review board grouped by outcome:
106106

107107
- `recommendedToPost` — high-signal findings that look postable by a human
108108
reviewer and are not already covered
109-
- `possiblePlusOnes` — existing threads where an endorsement may help
110-
- `partialOverlaps` — findings that add useful detail beyond an existing thread
109+
- `relatedToExisting` — findings that overlap or endorse existing review threads
111110
- `discussionOnly` — useful reviewer notes that should not be posted yet
112111
- `alreadyCovered` — findings fully covered by existing human or bot review
113112
threads
114113
- `discarded` — weak, duplicate, low-confidence, or non-actionable findings
115114

116115
Each finding preserves the specialist's claim, evidence, reasoning, suggested
117116
fix, confidence, source lens, and existing-review overlap rationale. The board
118-
also includes positive observations, an action plan, coverage notes, PR metadata,
119-
and review metadata.
117+
also includes positive observations, PR metadata, and review metadata.
120118

121119
## Interaction And Posting
122120

@@ -212,7 +210,7 @@ tools, local-git runs record manifest/full-diff provenance in
212210
`reviewMeta.sources`, and MCP fallback runs record the fallback reason and
213211
recovery counts. Also verify no generated parsing scripts are used, existing
214212
review context affects recommendations, the review board is understandable, the
215-
action plan is concise, drafts remain editable, and posting requires explicit
213+
drafts remain editable, and posting requires explicit
216214
approval.
217215

218216
## Prerequisites

pr-review-toolkit/skills/review-pr/SKILL.md

Lines changed: 137 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ allowed-tools:
1515
- mcp__plugin_github_github__pull_request_read
1616
- mcp__plugin_github_github__pull_request_review_write
1717
- mcp__plugin_github_github__add_comment_to_pending_review
18+
- mcp__plugin_github_github__add_reply_to_pull_request_comment
1819
---
1920

2021
# PR Review: $pr-url
@@ -219,74 +220,99 @@ The workflow owns PR metadata collection (via MCP), reviewer selection,
219220
specialist analysis, and review-board synthesis. It also fetches review threads
220221
(always from MCP).
221222

222-
The workflow returns grouped findings, positive observations, an action plan,
223-
coverage summary, PR metadata, summary, and review metadata.
223+
The workflow returns grouped findings, positive observations, PR metadata,
224+
summary, and review metadata.
224225

225226
## Present Review Board
226227

227-
Present the review board before drafting or posting anything. Keep it concise,
228-
but do not hide important groups.
229-
230-
Use this order:
231-
232-
1. Review heading: `owner/repo#number` and PR title when available.
233-
2. Coverage summary:
234-
- `coverageSummary.scope`
235-
- `coverageSummary.largePrNotes`, if present
236-
- selected reviewers and file/thread counts from `reviewMeta`
237-
3. Action plan:
238-
- critical
239-
- important
240-
- suggestions
241-
- recommended next action
242-
4. Findings grouped by outcome:
243-
- recommended to post
244-
- possible plus-ones
245-
- partial overlaps
246-
- worth discussing, not posting
247-
- already covered
248-
- discarded or weak findings, summarized if long
249-
5. Positive observations.
250-
251-
For each finding shown in detail, include:
252-
253-
- stable id
254-
- location
255-
- lens
256-
- title
257-
- confidence
228+
Present the review board before drafting or posting anything. Use this order:
229+
230+
### 1. Heading
231+
232+
Format: `owner/repo#number — PR title`
233+
234+
Below the heading, include a one-line summary with section counts derived from
235+
section array lengths:
236+
237+
```text
238+
N findings recommended, M overlap existing threads, P discussion-worthy.
239+
Reviewers: code-reviewer, pr-test-analyzer, silent-failure-hunter.
240+
```
241+
242+
The reviewer list comes from `reviewMeta.selectedReviewers` which stores full
243+
agent names.
244+
245+
### 2. Recommended to post (full detail)
246+
247+
For each finding, include:
248+
249+
- stable id, location, lens, title, confidence
258250
- claim
259251
- evidence
260252
- why it matters
261253
- suggested fix or next step
262-
- existing review overlap rationale when present
254+
- recommendation rationale: one sentence explaining why this finding is
255+
recommended for posting, synthesized from severity, confidence, and overlap
256+
status
257+
258+
### 3. Related to existing threads (full detail)
259+
260+
For each finding, include the same fields as recommended findings, plus:
261+
262+
- existing review overlap rationale
263+
- recommendation rationale explaining why this is related to an existing thread
264+
rather than standalone
265+
266+
### 4. Discussion-worthy (full detail)
267+
268+
For each finding, include the same fields as recommended findings, with the
269+
recommendation rationale explaining why this is not recommended to post.
270+
271+
### 5. Already covered (one-liner per finding)
272+
273+
One line per finding: `id — title (covered by thread on path:line)`.
274+
275+
### 6. Discarded (one-liner per finding)
276+
277+
One line per finding: `id — title (reason)`.
278+
279+
### 7. Positive observations
280+
281+
List positive observations when present.
263282

264283
## Ask What To Do Next
265284

266-
After presenting the board, ask with `AskUserQuestion`:
285+
After presenting the board, propose a recommended action based on board state
286+
using `AskUserQuestion` with contextual options.
267287

268-
```text
269-
What should we do next? You can reply with commands like "draft recommended",
270-
"draft F1 F3", "plus-one F2", "explain F4", "challenge F5", "show covered",
271-
"skip F6", "post selected", or "cancel".
272-
```
288+
### When recommended findings exist
273289

274-
Use a free-text response, not option buttons. Interpret natural language
275-
flexibly, but preserve the review board ids as the stable selection handles.
290+
Write a brief assessment of the recommended findings and any notable overlaps,
291+
then offer options:
276292

277-
Support these actions:
293+
1. "Draft recommended findings" (first option — the recommended action)
294+
2. "Draft all including overlap endorsements"
295+
3. "I want to adjust the selection"
296+
4. "Cancel"
278297

279-
- `draft recommended`: draft all `recommendedToPost` findings.
280-
- `draft F1 F3`: draft selected findings.
281-
- `plus-one F2`: draft a concise endorsement for an overlap finding.
282-
- `skip F4`: mark a finding as intentionally omitted in the conversation.
283-
- `explain F5`: explain the evidence, uncertainty, and tradeoffs.
284-
- `challenge F6`: reassess the finding using the board evidence and state any
285-
uncertainty plainly.
286-
- `show covered`: show `alreadyCovered` and relevant overlap rationale.
287-
- `cancel`: stop without drafting or posting.
288-
- `post selected`: only continue if there is already an approved preview;
289-
otherwise draft and preview first.
298+
### When only overlap or discussion findings exist
299+
300+
1. "Endorse overlap findings"
301+
2. "Skip posting"
302+
3. "I want to discuss specific findings"
303+
4. "Cancel"
304+
305+
### When nothing is postable
306+
307+
1. "Leave an approving review"
308+
2. "I spotted something"
309+
3. "Done"
310+
311+
### Exploratory actions
312+
313+
There are no dedicated commands. The user can type anything via the Other field,
314+
such as "Tell me more about F3" or "I disagree with F1". Interpret natural
315+
language flexibly, respond accordingly, and loop back to present updated options.
290316

291317
## Draft Selected Comments
292318

@@ -299,38 +325,64 @@ Draft comments only in the conversation. Drafts should:
299325
- avoid duplicating comments already covered elsewhere
300326
- distinguish blocking concerns from optional suggestions
301327

302-
For possible plus-ones and partial overlaps, make the overlap explicit. Draft a
303-
plus-one only when the finding's `existingReviewOverlap` indicates that an
304-
endorsement or additional detail is useful.
328+
### Drafting for overlap findings (relatedToExisting)
329+
330+
For findings in `relatedToExisting`, draft as thread replies rather than
331+
standalone comments. The draft should:
332+
333+
- acknowledge the original comment and add the new perspective
334+
- avoid restating the concern from scratch
335+
- read naturally as a reply in the existing conversation
336+
337+
### Line comments vs review body
305338

306339
Prefer line comments for findings with a concrete changed-file location. Put
307340
findings without a valid line location in the review body.
308341

342+
### Review event
343+
309344
Choose the proposed review event from the selected findings:
310345

311346
- `REQUEST_CHANGES` only when at least one selected finding is a serious
312347
correctness or blocking concern.
313-
- `COMMENT` for non-blocking feedback, suggestions, plus-ones, or discussion.
348+
- `COMMENT` for non-blocking feedback, suggestions, endorsements, or discussion.
349+
- `APPROVE` when the user selected "Leave an approving review" from the
350+
nothing-postable menu and no findings are being posted.
314351

315352
## Preview And Confirm
316353

317-
Before posting, show an exact preview:
354+
Before posting, show an exact preview.
355+
356+
For each finding being posted as a new line comment, show:
357+
358+
- finding id, path, line, and body
359+
360+
For each overlap finding being posted as a thread reply, show:
318361

319-
- each line comment with finding id, path, line, and body
320-
- review body text for non-line findings
321-
- proposed review event: `COMMENT` or `REQUEST_CHANGES`
322-
- any selected findings intentionally omitted from posting
362+
- finding id, "Reply to thread on path:line", and body
323363

324-
Ask for explicit final approval with `AskUserQuestion`. Accept approval only
325-
when the user clearly confirms posting the preview, such as "post this",
326-
"approved", or "submit". If the user requests edits or removals, update the
327-
preview and ask for approval again.
364+
For review body text (non-line findings), show the review body.
365+
366+
Show the proposed review event: `COMMENT`, `REQUEST_CHANGES`, or `APPROVE`.
367+
368+
After the preview, ask for explicit approval with `AskUserQuestion`:
369+
370+
1. "Post this review"
371+
2. "Edit the draft"
372+
3. "Add or remove findings"
373+
4. "Cancel"
374+
375+
Accept approval only when the user selects "Post this review" or clearly
376+
confirms posting. If the user requests edits or removals, update the preview and
377+
ask for approval again.
328378

329379
## Post Approved Review
330380

331381
Use GitHub write tools only in this final approved step.
332382

333-
If the approved preview has line comments:
383+
### Posting new line comments
384+
385+
If the approved preview has new line comments:
334386

335387
1. Create a pending review with
336388
`mcp__plugin_github_github__pull_request_review_write`.
@@ -340,9 +392,26 @@ If the approved preview has line comments:
340392
`mcp__plugin_github_github__pull_request_review_write` using the approved
341393
event and review body.
342394

395+
### Posting thread replies for overlap findings
396+
397+
For findings with `existingReviewOverlap.status === 'overlaps'` and a valid
398+
numeric `existingReviewOverlap.commentId`, post as a reply to the existing
399+
thread using `mcp__plugin_github_github__add_reply_to_pull_request_comment`
400+
with the `commentId` and `pullNumber`.
401+
402+
If the `commentId` is missing or invalid, fall back to posting as a new line
403+
comment via the pending review flow.
404+
405+
Thread replies are posted independently of the pending review flow — they do
406+
not need to be part of the pending review submission.
407+
408+
### Review body only
409+
343410
If the approved preview has only review-body text, submit the review body with
344411
`mcp__plugin_github_github__pull_request_review_write` using the approved event.
345412

413+
### Invalid locations
414+
346415
If a line comment cannot be added because the location is invalid for the PR
347416
diff, move that text into the review body, show the revised preview, and ask for
348417
approval again before posting.

0 commit comments

Comments
 (0)