|
1 | 1 | --- |
2 | 2 | name: pr-feedback-quality-gate |
3 | 3 | description: | |
4 | | - Safely track pull request feedback, resolve review comments or merge conflicts, validate fixes, and use a read-only cross-review before committing or pushing follow-up changes. |
| 4 | + Safely track pull request feedback, resolve review comments or merge conflicts, validate fixes, and use a read-only cross-review before committing or pushing follow-up changes. Also drafts truthful, ready-to-copy replies when the user asks how to answer new or current PR feedback without authorizing mutations. |
5 | 5 | triggers: |
6 | 6 | - "PR feedback" |
7 | 7 | - "review comments" |
8 | 8 | - "merge conflicts" |
9 | 9 | - "cross-review" |
10 | 10 | - "Claude CLI review" |
11 | 11 | - "monitor PR" |
| 12 | + - "continue PR" |
| 13 | + - "reply to PR feedback" |
| 14 | + - "answer PR feedback" |
| 15 | + - "kontynuuj PR" |
| 16 | + - "odpowiedz na uwagi do PR" |
12 | 17 | od: |
13 | 18 | mode: utility |
| 19 | + example_prompt: "Continue PR #6016 — inspect current feedback, classify each item, and draft truthful copy-paste replies for anything actionable. Do not post, resolve threads, push commits, or edit the PR; only read and advise." |
14 | 20 | --- |
15 | 21 |
|
16 | 22 | # PR Feedback Quality Gate |
17 | 23 |
|
18 | 24 | Use this when a PR has review feedback, merge conflicts, pending checks, or |
19 | | -needs a monitored follow-up after a fix. |
| 25 | +needs a monitored follow-up after a fix, and use this when the user asks how to |
| 26 | +answer PR feedback (continue PR, reply to reviewer, kontynuuj PR, odpowiedz na |
| 27 | +uwagi do PR) without authorizing mutations. |
20 | 28 |
|
21 | | -## Workflow |
| 29 | +## Reply-advice mode (read-only) |
| 30 | + |
| 31 | +Reply-advice mode is the default path whenever the user asks to continue a PR, |
| 32 | +review feedback, or draft replies, AND has not separately authorized the |
| 33 | +mutating fix workflow below. Reply-advice NEVER edits PRs, posts comments, |
| 34 | +resolves threads, commits, pushes, or reruns checks. It only inspects and |
| 35 | +advises. The mutating fix workflow runs only on an explicit separate request |
| 36 | +("apply the fix", "commit", "push", "resolve the thread"); until then, stay |
| 37 | +read-only. |
| 38 | + |
| 39 | +### Target resolution precedence |
| 40 | + |
| 41 | +Resolve the target PR deterministically before any inspection: |
| 42 | + |
| 43 | +1. Explicit URL or number supplied by the user. |
| 44 | +2. The PR open on the current git branch (`gh pr view` from the worktree). |
| 45 | +3. A single open PR authored by the current user in the current repository. |
| 46 | + |
| 47 | +If two or more candidates remain, list them with PR number, title, head SHA, |
| 48 | +author, and current review decision; then STOP. Do not pick silently. Let the |
| 49 | +user disambiguate before any inspection. |
| 50 | + |
| 51 | +### Feedback surfaces to inspect |
| 52 | + |
| 53 | +Read every surface that can carry actionable feedback on the resolved PR: |
| 54 | + |
| 55 | +- PR body, current head SHA, and mergeable state. |
| 56 | +- Issue (timeline) comments on the PR. |
| 57 | +- Review summaries (approve / request changes / comment) and reviewer bodies. |
| 58 | +- Inline review threads, including resolved and outdated state per thread. |
| 59 | +- Status checks (`gh pr checks`) and mergeability (`gh pr view --json |
| 60 | + mergeable,mergeStateStatus`). |
| 61 | +- Local worktree status (`git status`, `git log`) when relevant. |
| 62 | + |
| 63 | +A surface with no items is itself an observation ("no inline review threads |
| 64 | +present on this PR"), not a gap to skip. |
| 65 | + |
| 66 | +### Freshness and checkpoint semantics |
| 67 | + |
| 68 | +Compare against a prior report or conversation checkpoint when one exists in |
| 69 | +this session. Without a checkpoint, call the result `current feedback` — never |
| 70 | +`new feedback`. Saying `new` without a comparison baseline is a fabrication |
| 71 | +risk; only the delta over a recorded observation is `new`. |
| 72 | + |
| 73 | +### Classification |
| 74 | + |
| 75 | +Classify every relevant item on every inspected surface as exactly one of: |
| 76 | + |
| 77 | +- **action required before replying** — a request that must be addressed |
| 78 | + (code change, PR body update, validation, doc edit) before any truthful |
| 79 | + reply can claim it is done. |
| 80 | +- **question requiring an answer** — a reviewer question that needs a |
| 81 | + response, with no implicit code change required. |
| 82 | +- **acknowledgement after a completed change** — a reviewer note reacting to |
| 83 | + an already-completed fix; reply optionally, briefly. |
| 84 | +- **informational / approval / automated — no reply required** — CI runs, |
| 85 | + Looper approvals, status updates, automation logs. These are not human |
| 86 | + feedback. Do not draft a substantive reply; an optional courtesy `thanks for |
| 87 | + the review and approval` is the maximum allowed. |
| 88 | +- **stale, outdated, or already resolved** — threads marked resolved/outdated |
| 89 | + by GitHub, or items superseded by a newer change. Acknowledge their state |
| 90 | + once; do not relitigate. |
| 91 | + |
| 92 | +An item may have a single classification. If two classifications apply, the |
| 93 | +most actionable one wins (a question that is also an approval is still a |
| 94 | +question). |
| 95 | + |
| 96 | +### Truthful drafting rules |
| 97 | + |
| 98 | +For every actionable item, write a ready-to-copy reply that: |
| 99 | + |
| 100 | +- States the smallest required action and why, before any draft reply. |
| 101 | +- Never claims a change has been made when it has not. If the user has not |
| 102 | + separately run the fix, the draft must say `Once X is done, the suggested |
| 103 | + reply is:` and present the reply as conditional, not past tense. |
| 104 | +- Never claims new validation has run when it has not. If the user has not run |
| 105 | + tests, say `after you run \`pnpm X\`` rather than `I ran \`pnpm X\``. |
| 106 | +- Mirrors the reviewer's language register and addresses the reviewer by name |
| 107 | + when known. |
| 108 | +- Is concise — one short paragraph per actionable item, not a wall of text. |
| 109 | + |
| 110 | +### Output shape |
| 111 | + |
| 112 | +Reply-advice output, in order: |
| 113 | + |
| 114 | +1. PR state and freshness — number, title, head SHA, review decision, |
| 115 | + mergeable state, last update timestamp, and the comparison baseline (or |
| 116 | + `no prior checkpoint — current feedback, not new`). |
| 117 | +2. Feedback item — author, source (issue comment / review summary / inline |
| 118 | + thread / check), timestamp, classification. |
| 119 | +3. Required action and why (when classification is `action required` or |
| 120 | + `question`). |
| 121 | +4. Suggested reply, or explicit `no reply needed` rationale. Conditional |
| 122 | + language if the underlying action has not yet been performed. |
| 123 | +5. Checks and mergeability — label unknown causes as `unknown`; do not |
| 124 | + invent a blocker. |
| 125 | +6. Remaining risk and next step — the smallest action that unblocks the PR. |
| 126 | + |
| 127 | +## Workflow (mutating, opt-in only) |
| 128 | + |
| 129 | +This workflow runs only on an explicit mutating request from the user. It does |
| 130 | +not run inside reply-advice mode. |
22 | 131 |
|
23 | 132 | 1. Inspect PR state first: comments, reviews, mergeability, checks, branch, and |
24 | 133 | local worktree status. Keep unrelated local changes out of the PR. |
@@ -50,4 +159,5 @@ needs a monitored follow-up after a fix. |
50 | 159 |
|
51 | 160 | Always report PR state, actions taken, cross-review verdict, accepted or |
52 | 161 | rejected findings, validation run, commits pushed, skipped checks with reasons, |
53 | | -remaining risks, and next step. |
| 162 | +remaining risks, and next step. In reply-advice mode, replace `actions taken` |
| 163 | +with `actions advised` and `commits pushed` with `no mutations performed`. |
0 commit comments