@@ -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,
219220specialist 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
306339Prefer line comments for findings with a concrete changed-file location. Put
307340findings without a valid line location in the review body.
308341
342+ ### Review event
343+
309344Choose 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
331381Use 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
3353871 . 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+
343410If 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+
346415If a line comment cannot be added because the location is invalid for the PR
347416diff, move that text into the review body, show the revised preview, and ask for
348417approval again before posting.
0 commit comments