You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/workflows/address-review.md
+57-16Lines changed: 57 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,9 @@ Use this prompt in Codex CLI, ChatGPT, or another coding assistant when you want
7
7
Paste the prompt below into your coding assistant and replace `{{PR_REFERENCE}}` with one of:
8
8
9
9
- A PR number, such as `12345`
10
+
- A PR number plus override, such as `12345 check all reviews`
10
11
- A PR URL, such as `https://github.com/org/repo/pull/12345`
12
+
- A PR URL plus override, such as `https://github.com/org/repo/pull/12345 check all reviews`
11
13
- A specific review URL, such as `https://github.com/org/repo/pull/12345#pullrequestreview-123456789`
12
14
- A specific issue comment URL, such as `https://github.com/org/repo/pull/12345#issuecomment-123456789`
13
15
@@ -29,16 +31,23 @@ Behavior rules:
29
31
- the output of the required `gh api` commands.
30
32
- Do not auto-fix everything. Stop after triage and wait for my selection.
31
33
- Default to real issues only, not optional polish.
34
+
- For full-PR scans, default to feedback after the latest PR summary comment whose body contains `<!-- address-review-summary -->`.
35
+
- If I say `check all reviews`, ignore that cutoff and rescan the full PR history.
36
+
- If I give a specific review URL or specific issue-comment URL, fetch that exact target even if it predates the latest summary comment.
32
37
- After selected items are addressed, reply to the original GitHub comments and resolve threads when appropriate.
38
+
- After each completed action or action chain, post a new PR summary comment with the `<!-- address-review-summary -->` marker that says what mattered and what was skipped.
33
39
34
40
Execution flow when terminal access is available:
35
41
36
42
1. Parse the input:
37
43
- Support:
38
44
- PR number only
45
+
- PR number plus `check all reviews`
39
46
- PR URL
47
+
- PR URL plus `check all reviews`
40
48
- Specific review URL with `#pullrequestreview-...`
41
49
- Specific issue comment URL with `#issuecomment-...`
50
+
- Detect the exact phrase `check all reviews`, set a `CHECK_ALL_REVIEWS` flag, and remove only that phrase before parsing the PR reference.
42
51
- If the input is a full GitHub URL, extract the URL's `org/repo` before running `gh repo view`.
43
52
- Extract the PR number and optional review/comment ID.
44
53
@@ -47,34 +56,54 @@ Execution flow when terminal access is available:
- If `gh` is unavailable or unauthenticated, stop and tell me to fix that first.
49
58
50
-
3. Fetch review data:
59
+
3. Determine scan window and summary cutoff:
60
+
- For full-PR scans (plain PR number or PR URL with no specific review/comment anchor), default to reviewing only feedback posted after the latest PR summary comment created by this workflow.
61
+
- The summary marker is a PR issue comment whose body contains `<!-- address-review-summary -->`.
62
+
- If `CHECK_ALL_REVIEWS` is true, ignore the cutoff and scan the full PR history.
63
+
- If the input is a specific review URL or specific issue-comment URL, fetch that exact target even if it predates the latest summary comment.
64
+
- Fetch the latest summary comment before collecting review data:
- If the review body contains actionable feedback, include it as an additional general comment. Review summary bodies cannot use the `/replies` endpoint; post those responses as general PR comments (see step 7).
- If the review body contains actionable feedback, include it as an additional general comment. Review summary bodies cannot use the `/replies` endpoint; post those responses as general PR comments (see step 8).
- Include actionable review summary bodies from `/pulls/{PR_NUMBER}/reviews` as additional general comments. Like specific review bodies, they cannot use the `/replies` endpoint and must be answered as general PR comments (see step 7).
- Include actionable review summary bodies from `/pulls/{PR_NUMBER}/reviews` as additional general comments. Like specific review bodies, they cannot use the `/replies` endpoint and must be answered as general PR comments (see step 8).
82
+
- When `REVIEW_CUTOFF_AT` is set for a full-PR scan:
83
+
- Fetch the full datasets so you keep older context for unresolved threads.
84
+
- Filter issue comments and review summaries to items created after `REVIEW_CUTOFF_AT`.
85
+
- For inline review threads, keep an unresolved thread only when at least one comment in that thread has `created_at > REVIEW_CUTOFF_AT`.
86
+
- Use the thread's top-level comment as the triage item, and use newer replies in that thread as the latest context.
87
+
- Do not let older comments with no new activity re-enter triage unless I said `check all reviews`.
62
88
- For all review-comment paths, fetch thread metadata and match `thread_id` by `node_id`:
- Never triage a prior summary checkpoint comment. Skip any issue comment whose body contains `<!-- address-review-summary -->`.
68
95
- Skip resolved threads.
69
96
- Do not create standalone triage items from comments where `in_reply_to_id` is set, but use reply text as the latest thread context when it updates or narrows the unresolved concern.
97
+
- When `REVIEW_CUTOFF_AT` is set, evaluate unresolved review threads by their latest activity timestamp, not only by the top-level comment timestamp.
70
98
- Keep bot comments by default, but deduplicate duplicates and skip status-only bot posts.
71
99
- Focus on correctness bugs, regressions, security issues, missing tests that hide bugs, and clear adjacent-code inconsistencies.
72
100
- Skip style nits, speculative suggestions, documentation nits, changelog wording, duplicate comments, and "could consider" feedback unless I ask for polish work.
73
101
- If the API returns 404, tell me the PR or comment does not exist.
74
102
- If the API returns 403, tell me to check `gh auth status`.
75
-
- If nothing is returned, tell me no review comments were found.
103
+
- If nothing is returned after cutoff filtering, tell me no new review feedback was found since the last summary comment and mention `check all reviews`.
104
+
- If nothing is returned without a cutoff, tell me no review comments were found.
76
105
77
-
5. Triage every remaining comment:
106
+
6. Triage every remaining comment:
78
107
- `MUST-FIX`: correctness bugs, regressions, security issues, missing tests that could hide a bug, and clear inconsistencies with adjacent code that would likely block merge.
79
108
- `DISCUSS`: reasonable scope-expanding suggestions, architectural opinions, and comments that need a decision.
@@ -88,7 +117,7 @@ Execution flow when terminal access is available:
88
117
- Use the subject format: `"{file}:{line} - {comment_summary} (@{username})"`.
89
118
- For general comments, extract the must-fix action from the body.
90
119
91
-
6. Present triage and quick-action menu:
120
+
7. Present triage and quick-action menu:
92
121
- Use a single numbering sequence across all categories.
93
122
- Show counts for `MUST-FIX`, `DISCUSS`, and `SKIPPED`.
94
123
- After the triage list, present this quick-action menu:
@@ -105,8 +134,9 @@ Execution flow when terminal access is available:
105
134
- Support range syntax: `N-M` expands to individual items (e.g., `3-5` → `3,4,5`).
106
135
- If a range is malformed, reversed, or out of bounds, show a validation message and ask the user to retry (do not silently coerce it).
107
136
- Do not edit code yet.
137
+
- Do not post the PR summary checkpoint yet. Post it only after a chosen action reaches a stable stopping point so the summary reflects the new baseline.
108
138
109
-
7. Execute the chosen action:
139
+
8. Execute the chosen action:
110
140
- **`f`**: Fix all must-fix items (if none exist, skip fix phase). If local changes exist, commit, ask for push confirmation, then push; if no local changes, skip commit/push and continue decision flow. Then reply/resolve addressed must-fix threads. If skipped items exist, ask for explicit confirmation before posting rationale replies/resolving skipped threads. Keep discuss items for an explicit follow-up decision (`d`, `f+i`, or `r all discuss + resolve`).
111
141
- **`f+i`**: Same must-fix handling as `f`, plus create a follow-up GitHub issue bundling discuss and non-trivial skipped items; still reply/resolve trivial skipped items that are excluded from the follow-up issue. For general PR comments and review summary bodies (which have no thread), the reply alone is sufficient. If there are no deferred items, skip issue creation and behave like `f`. No additional commit is needed unless later steps introduce local changes.
112
142
- **`d`**: Present requested items with full context, ask for a decision on each. Bare `d` presents all DISCUSS items. Approved → fix like must-fix (use the same commit/push-before-reply ordering as `f` when code changes occur). Declined → optionally reply with rationale.
@@ -123,7 +153,7 @@ Execution flow when terminal access is available:
123
153
- Do not resolve anything still in progress or uncertain.
124
154
- Ask for push confirmation before running `git push`.
125
155
126
-
8. Create follow-up issue (when `f+i` or `m` is chosen):
156
+
9. Create follow-up issue (when `f+i` or `m` is chosen):
127
157
- Use `gh issue create --repo "${REPO}"` with title "Follow-up: Review feedback from PR #N"
128
158
- For `f+i`, include discuss items and non-trivial skipped items (must-fix is already addressed)
129
159
- For `m`, include deferred must-fix items, discuss items, and non-trivial skipped items
@@ -132,7 +162,18 @@ Execution flow when terminal access is available:
132
162
- Reference the issue in thread replies
133
163
- Return the issue URL
134
164
135
-
9. Merge-ready signal:
165
+
10. Post a PR summary comment:
166
+
- After any chosen action or completed action chain (`f`, `f+i`, `d`, `r`, `m`, or direct item selection), post a consolidated general PR comment that becomes the next default review cutoff.
167
+
- Include the exact marker `<!-- address-review-summary -->` on its own line near the top.
168
+
- Use a `Mattered` section for `MUST-FIX` and `DISCUSS` items, including whether each item was addressed, deferred, or left pending by user choice.
169
+
- Use a `Skipped` section for `SKIPPED` items with short reasons.
170
+
- Mention any follow-up issue URL that was created.
171
+
- Mention whether the run used the default cutoff or the explicit `check all reviews` override.
172
+
- End with a note that future full-PR scans should start after this comment unless I say `check all reviews`.
173
+
- Use exact timestamps in the summary when referring to the scan window.
174
+
- Post it with: `gh api repos/${REPO}/issues/{PR_NUMBER}/comments -X POST --input <summary_body_file>`
175
+
176
+
11. Merge-ready signal:
136
177
- After `f`, tell me the PR is merge-ready only when no `DISCUSS` items remain unresolved
137
178
- After `f+i`, tell me the PR is merge-ready
138
179
- After `m`, only tell me the PR is merge-ready when no must-fix items were deferred; otherwise explicitly say it is not merge-ready
0 commit comments