Skip to content

Commit 8b484cb

Browse files
justin808claude
andcommitted
Add quick-action menu and follow-up issue workflow to /address-review (#2808)
## Summary - Adds quick-action menu (`f`, `f+i`, `d`, `r`, `m`) after triage to support a "fix what matters, merge, follow-up the rest" pattern - Adds range syntax (`N-M`) for selecting items (e.g., `r7-9`, `1,3-5`) - Adds follow-up GitHub issue creation to bundle deferred discuss/skipped items - Adds merge-ready signaling after completing actions - Updates both `.claude/commands/address-review.md` and `.agents/workflows/address-review.md` Closes #2805 ## Test plan - [ ] Run `/address-review` on a PR with mixed must-fix, discuss, and skipped items - [ ] Verify quick-action menu appears after triage - [ ] Test `f` action: fixes must-fix, reply-skips rest, signals merge-ready - [ ] Test `f+i` action: fixes must-fix, creates follow-up issue, signals merge-ready - [ ] Test `r` with range syntax (e.g., `r3-5`) - [ ] Test `m` action: creates follow-up issue for everything - [ ] Test direct item selection with ranges (e.g., `1,3-5`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation-only workflow changes that adjust expected `/address-review` behavior (including follow-up issue creation and thread resolution). Low implementation risk, but reviewers should verify the new instructions align with desired operational safeguards (push/resolve semantics). > > **Overview** > Updates the `/address-review` workflow docs to add a **post-triage quick-action menu** (`f`, `f+i`, `d`, `r`, `m`) and specify per-action behavior for fixing, discussing, replying, and deferring review feedback. > > Adds **range-based item selection** (e.g., `3-5`) with validation rules, introduces a **follow-up GitHub issue** creation template for deferred items, and clarifies **merge-ready signaling**, `git push` confirmation requirements, and inclusion of `html_url` in fetched comment payloads for easier linking. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0834a5f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Redesigned address-review workflow with a required quick-action menu (f, f+i, d, r, m) and explicit per-action behaviors. * Added support for direct item selection, range syntax (N-M) and presets (e.g., "all must-fix") for bulk operations. * Include fetched comment links in review outputs and require git-push confirmation before pushing. * Clarified follow-up issue creation rules, merge-readiness signaling, and thread-resolution/rationale handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 33c9184 commit 8b484cb

1 file changed

Lines changed: 179 additions & 15 deletions

File tree

.claude/commands/address-review.md

Lines changed: 179 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ gh api repos/${REPO}/issues/comments/{COMMENT_ID} | jq '{body: .body, user: .use
7575
gh api repos/${REPO}/pulls/{PR_NUMBER}/reviews/{REVIEW_ID} | jq '{id: .id, body: .body, state: .state, user: .user.login, html_url: .html_url}'
7676

7777
# Inline comments for this review
78-
gh api --paginate repos/${REPO}/pulls/{PR_NUMBER}/reviews/{REVIEW_ID}/comments | jq -s '[.[].[] | {id: .id, node_id: .node_id, path: .path, body: .body, line: .line, start_line: .start_line, user: .user.login, in_reply_to_id: .in_reply_to_id}]'
78+
gh api --paginate repos/${REPO}/pulls/{PR_NUMBER}/reviews/{REVIEW_ID}/comments | jq -s '[.[].[] | {id: .id, node_id: .node_id, path: .path, body: .body, line: .line, start_line: .start_line, user: .user.login, in_reply_to_id: .in_reply_to_id, html_url: .html_url}]'
7979
```
8080

8181
Include the review body as a general comment when it contains actionable feedback. When the review body contains actionable feedback, note that it cannot be replied to via the `/replies` endpoint — responses to review summary bodies must be posted as general PR comments (see Step 7).
@@ -87,7 +87,7 @@ Include the review body as a general comment when it contains actionable feedbac
8787
gh api --paginate repos/${REPO}/pulls/{PR_NUMBER}/reviews | jq -s '[.[].[] | select((.body // "") != "") | {id: .id, type: "review_summary", body: .body, state: .state, user: .user.login, html_url: .html_url}]'
8888

8989
# Inline code review comments
90-
gh api --paginate repos/${REPO}/pulls/{PR_NUMBER}/comments | jq -s '[.[].[] | {id: .id, node_id: .node_id, type: "review", path: .path, body: .body, line: .line, start_line: .start_line, user: .user.login, in_reply_to_id: .in_reply_to_id}]'
90+
gh api --paginate repos/${REPO}/pulls/{PR_NUMBER}/comments | jq -s '[.[].[] | {id: .id, node_id: .node_id, type: "review", path: .path, body: .body, line: .line, start_line: .start_line, user: .user.login, in_reply_to_id: .in_reply_to_id, html_url: .html_url}]'
9191

9292
# General PR discussion comments (not tied to specific lines)
9393
gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -s '[.[].[] | {id: .id, node_id: .node_id, type: "issue", body: .body, user: .user.login, html_url: .html_url}]'
@@ -146,22 +146,88 @@ Create a task list with TodoWrite containing **only the `MUST-FIX` items**:
146146
- Description: Include the full review comment text and any relevant context
147147
- All tasks should start with status: `"pending"`
148148

149-
## Step 6: Present Triage to User
149+
## Step 6: Present Triage and Quick-Action Menu
150150

151151
Present the triage to the user - **DO NOT automatically start addressing items**:
152152

153153
- Use a single sequential numbering across all categories (1, 2, 3, ...) so every item has a unique number the user can reference. Do not restart numbering at 1 for each category.
154154
- `MUST-FIX ({count})`: list the todos created
155155
- `DISCUSS ({count})`: list items needing user choice, with a short reason
156156
- `SKIPPED ({count})`: list skipped comments with a short reason, including duplicates and factually incorrect suggestions
157-
- Wait for the user to tell you which items to address
158-
- Always offer an explicit optional follow-up to post rationale replies on selected `SKIPPED` or declined `DISCUSS` items
159-
- Never post those rationale replies unless the user explicitly selects which items to reply to
160-
- Ask two things when there are `SKIPPED` or declined `DISCUSS` items:
161-
- Which items to address in code/tests/docs
162-
- Which skipped/declined items (if any) should receive a rationale reply
163157

164-
## Step 7: Address Items, Reply, and Resolve
158+
After the triage list, present a **quick-action menu**:
159+
160+
```text
161+
Quick actions:
162+
f — Fix must-fix items, then confirm whether to reply/resolve skipped items before deciding discuss items
163+
f+i — Fix must-fix + create follow-up issue for discuss/non-trivial skipped items
164+
d — Discuss specific items before deciding (e.g., "d2,4"). Bare "d" presents all DISCUSS items.
165+
r — Reply with rationale to items (e.g., "r3,5", "r7-9", "r all skipped", "r all discuss"); add `+ resolve` to also resolve those threads
166+
m — Skip code changes + create follow-up issue for must-fix/discuss/non-trivial skipped items
167+
168+
Or pick items by number: "1,2", "all must-fix", "1,3-5"
169+
```
170+
171+
**Range syntax**: Support `N-M` to expand into individual item numbers (e.g., `3-5` becomes `3,4,5`). Ranges work everywhere: item selection, `d`, and `r`.
172+
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).
173+
174+
**Dynamic menu**: Generate `f` and `f+i` descriptions dynamically using actual item numbers and deferred targets from the current triage set (e.g., "Fix #1, #3" instead of "Fix must-fix items"). When there are no `DISCUSS` or `SKIPPED` items, only show `f` and direct item selection.
175+
176+
Wait for the user to choose an action before proceeding.
177+
178+
## Step 7: Execute the Chosen Action
179+
180+
### Action `f` — Fix and merge-ready
181+
182+
1. Address all `MUST-FIX` items (make code changes, run checks). If there are no `MUST-FIX` items, skip directly to discuss/skipped handling.
183+
2. If local changes exist, commit and then ask for push confirmation before pushing. If there are no local changes, skip commit/push and continue decision flow.
184+
3. Reply to each addressed comment explaining the fix.
185+
4. Resolve the corresponding review threads.
186+
5. If `SKIPPED` items exist, ask for explicit confirmation before posting rationale replies and resolving those threads (for example: "Reply/resolve 3 skipped items? y/n").
187+
6. Do **not** auto-resolve `DISCUSS` items in `f`; after must-fix work, re-present discuss items and prompt the user to choose `d` (discuss), `f+i` (create follow-up issue), or `r all discuss + resolve`. If `f` starts with zero `MUST-FIX` items, show this discuss decision menu immediately.
188+
7. Tell the user the PR is merge-ready only after `DISCUSS` items are resolved or explicitly deferred.
189+
8. If any `DISCUSS` items remain, explicitly prompt with the next action (for example: "DISCUSS items remain - use `d` to review, `f+i` to defer to a follow-up issue, or `r all discuss + resolve` to decline and close.").
190+
191+
### Action `f+i` — Fix, follow-up issue, and merge-ready
192+
193+
1. Do everything in `f` for `MUST-FIX` items. If there are no `MUST-FIX` items, skip the fix phase and continue with deferred-item handling.
194+
2. Create a **follow-up GitHub issue** (see Step 8) bundling all `DISCUSS` and non-trivial `SKIPPED` items.
195+
3. For each deferred item in the follow-up issue, post a reply in the original location referencing the issue (use review-comment replies for inline comments and issue comments for review summaries/general comments), and resolve the thread when one exists. For general PR comments and review summary bodies (which have no thread), the reply alone is sufficient.
196+
4. For trivial `SKIPPED` items that are not included in the follow-up issue (duplicates, factually incorrect suggestions, status noise), still post rationale replies and resolve those threads.
197+
5. If there are zero deferred items, skip issue creation and behave like `f`.
198+
6. No additional commit is required unless later steps introduce local changes; if they do, commit and ask for push confirmation before pushing.
199+
7. Tell the user the PR is merge-ready.
200+
201+
### Action `d` — Discuss items
202+
203+
Present the requested items with full context and ask the user for a decision on each. If the user enters bare `d` with no item numbers, present all `DISCUSS` items. After the user decides, treat approved items as `MUST-FIX` (fix, reply, resolve) and declined items as `SKIPPED` (optionally reply with rationale if the user asks). For approved items that produce local changes, use the same commit/push-before-reply ordering as action `f`. After handling requested `d` items, re-offer the quick-action menu for remaining unaddressed items.
204+
205+
### Action `r` — Reply with rationale
206+
207+
Post rationale replies to the specified items explaining why they are being deferred or skipped. By default, do not resolve threads in `r` unless the user explicitly asks to resolve them (for example, `r3,5 + resolve`). Accept only `SKIPPED`/`DISCUSS` item numbers, ranges, `r all skipped`, or `r all discuss`. If the selection includes any `MUST-FIX` item (including `r all must-fix`), do not post replies; direct the user to `f` or explicit deferral (`f+i` / `m`).
208+
209+
### Action `m` — Merge as-is
210+
211+
1. Create a follow-up GitHub issue (see Step 8) bundling `MUST-FIX`, `DISCUSS`, and non-trivial `SKIPPED` items.
212+
2. Post replies in the original location for each deferred item: use review-comment replies for inline comments and issue comments for review summaries/general comments.
213+
3. Resolve `DISCUSS` and `SKIPPED` review threads after replying (resolve only when a thread exists).
214+
4. If any `MUST-FIX` items were deferred, keep those review threads open by default unless the user explicitly asks to close them.
215+
5. If any `MUST-FIX` items were deferred, explicitly tell the user the PR is **not merge-ready** without an override decision.
216+
6. Only signal merge-ready with no code changes when there are zero deferred `MUST-FIX` items.
217+
218+
### Direct item selection (e.g., "1,2", "all must-fix", "1,3-5")
219+
220+
Address only the selected items. After completing them:
221+
222+
1. If selected items produced local changes, commit and ask for push confirmation before pushing (skip this step when there are no local changes).
223+
2. Reply and resolve threads for addressed items.
224+
3. Ask whether remaining items should receive rationale replies, a follow-up issue, or be left as-is.
225+
226+
### Combination actions
227+
228+
Users can chain actions: e.g., `f+i` then `r7-9`. After the first action completes, check if there are remaining un-replied items and offer the next logical action.
229+
230+
### General rules for all actions
165231

166232
When addressing items, after completing each selected item (whether `MUST-FIX` or `DISCUSS`), reply to the original review comment explaining how it was addressed.
167233
If the user selects `DISCUSS` items to address, treat them the same as `MUST-FIX`: make the code change, reply, and resolve the thread.
@@ -211,6 +277,98 @@ Do not resolve a thread if the fix is still pending, if you are unsure whether t
211277

212278
If the user explicitly asks to close out a `DISCUSS` or `SKIPPED` item, reply with the rationale and resolve the thread only when the conversation is actually complete.
213279

280+
## Step 8: Create Follow-Up Issue (when requested)
281+
282+
When the user chooses `f+i`, `m`, or explicitly asks for a follow-up issue, create a GitHub issue that bundles deferred items:
283+
284+
```bash
285+
# Template inputs: replace each <...> placeholder before running this snippet.
286+
# Use single-quoted heredocs so pasted review text is treated as literal content.
287+
DISCUSS_ITEMS="$(cat <<'EOF'
288+
<DISCUSS_ITEMS_BULLETS_OR_EMPTY>
289+
EOF
290+
)"
291+
SKIPPED_ITEMS="$(cat <<'EOF'
292+
<SKIPPED_ITEMS_BULLETS_OR_EMPTY>
293+
EOF
294+
)"
295+
296+
# For `f+i`, keep this empty. For `m`, include a heading and deferred must-fix bullets.
297+
MUST_FIX_SECTION="$(cat <<'EOF'
298+
<MUST_FIX_SECTION_OR_EMPTY>
299+
EOF
300+
)"
301+
302+
MUST_FIX_BLOCK="${MUST_FIX_SECTION}"
303+
304+
DISCUSS_SECTION=""
305+
if [ -n "${DISCUSS_ITEMS}" ]; then
306+
printf -v DISCUSS_SECTION '### Discuss items\n%s\n' "${DISCUSS_ITEMS}"
307+
fi
308+
309+
SKIPPED_SECTION=""
310+
if [ -n "${SKIPPED_ITEMS}" ]; then
311+
printf -v SKIPPED_SECTION '### Skipped items (non-trivial)\n%s\n' "${SKIPPED_ITEMS}"
312+
fi
313+
314+
if [ -z "${MUST_FIX_BLOCK}${DISCUSS_SECTION}${SKIPPED_SECTION}" ]; then
315+
echo "No deferred items found; skip follow-up issue creation."
316+
else
317+
SECTION_CONTENT=""
318+
for section in "${MUST_FIX_BLOCK}" "${DISCUSS_SECTION}" "${SKIPPED_SECTION}"; do
319+
[ -z "${section}" ] && continue
320+
if [ -n "${SECTION_CONTENT}" ]; then
321+
SECTION_CONTENT="${SECTION_CONTENT}"$'\n\n'
322+
fi
323+
SECTION_CONTENT="${SECTION_CONTENT}${section}"
324+
done
325+
issue_body_file="$(mktemp)"
326+
{
327+
printf '## Deferred review feedback from PR #%s\n\n' "${PR_NUMBER}"
328+
printf 'These items were triaged during review and deferred for follow-up.\n\n'
329+
printf '%s\n\n' "${SECTION_CONTENT}"
330+
printf -- '---\n'
331+
printf 'Original PR: https://github.com/%s/pull/%s\n' "${REPO}" "${PR_NUMBER}"
332+
} > "${issue_body_file}"
333+
334+
gh issue create --repo "${REPO}" --title "Follow-up: Review feedback from PR #${PR_NUMBER}" --body-file "${issue_body_file}"
335+
rm -f "${issue_body_file}"
336+
fi
337+
```
338+
339+
Rules for follow-up issues:
340+
341+
- Only include non-trivial `SKIPPED` items (skip pure duplicates and factually incorrect suggestions)
342+
- For `f+i`, omit the must-fix section because must-fix items were addressed in the current PR
343+
- For `m`, include a must-fix section with heading `### Must-fix items (deferred)` and deferred blockers
344+
- Omit any section heading when its corresponding item list is empty
345+
- Include the original reviewer username and comment link for each item
346+
- Include enough context that someone can act on the issue without re-reading the full PR review
347+
- After creating the issue, reference it in thread replies (e.g., "Tracked in #NNN for follow-up")
348+
- Return the issue URL to the user
349+
350+
## Step 9: Merge-Ready Signal
351+
352+
After completing the chosen action (`f`, `f+i`, `d`, `r`, `m`, or direct item selection), report merge readiness status:
353+
354+
```text
355+
All review threads resolved. PR is merge-ready.
356+
Follow-up issue: https://github.com/org/repo/issues/NNN (if created)
357+
```
358+
359+
If `m` deferred any `MUST-FIX` items, report:
360+
361+
```text
362+
Deferred review feedback tracked in follow-up issue: https://github.com/org/repo/issues/NNN
363+
Deferred MUST-FIX threads remain open by default.
364+
PR is NOT merge-ready because must-fix items were deferred.
365+
```
366+
367+
If the action was direct item selection and unresolved `MUST-FIX`/`DISCUSS` items remain, do not signal merge-ready. Re-offer the quick-action menu and ask whether to continue with `f`, `f+i`, `d`, `r`, or `m`.
368+
If the action was `d` or `r` and unresolved `MUST-FIX`/`DISCUSS` items remain, do not signal merge-ready; re-offer the quick-action menu and ask whether to continue with `f`, `f+i`, `d`, `r`, or `m`.
369+
370+
Do not automatically merge. Signal readiness (or non-readiness) and let the user decide.
371+
214372
# Example Usage
215373

216374
```text
@@ -241,11 +399,15 @@ SKIPPED (3):
241399
4. src/helper.rb:45 - Same nil guard issue (@greptile-apps[bot]) - duplicate of #1
242400
5. spec/helper_spec.rb:20 - "Consolidate assertions" (@claude[bot]) - test style preference
243401
244-
Which items would you like me to address? (e.g., "1", "1,2", or "all must-fix")
245-
Optional: I can also post rationale replies for skipped/declined items (e.g., "reply 3,5" or "reply all skipped").
246-
```
402+
Quick actions:
403+
f — Fix #1, then confirm whether to reply/resolve skipped items before deciding discuss items
404+
f+i — Fix #1, create follow-up issue for #2, reply/resolve trivial skipped #3-5
405+
d — Discuss specific items (e.g., "d2,4"). Bare "d" presents all DISCUSS items.
406+
r — Reply with rationale (e.g., "r3,5", "r3-5", "r all skipped", "r all discuss"); add `+ resolve` to also resolve threads
407+
m — No code changes, create follow-up issue, merge-ready only when no must-fix items are deferred
247408
248-
Note: Only show the "Optional: rationale replies" line when there are `SKIPPED` or declined `DISCUSS` items. Omit it when every item is `MUST-FIX`.
409+
Or pick items by number: "1,2", "all must-fix", "1,3-5"
410+
```
249411

250412
# Important Notes
251413

@@ -257,7 +419,9 @@ Note: Only show the "Optional: rationale replies" line when there are `SKIPPED`
257419
- **NEVER automatically address all review comments** - always wait for user direction
258420
- When given a specific review URL, no need to ask for more information
259421
- **ALWAYS reply to comments after addressing them** to close the feedback loop
260-
- After triage, always offer to post rationale replies for selected `SKIPPED`/declined items, but only post them with explicit user approval
422+
- After triage, always offer rationale replies for selected `SKIPPED`/declined items; `f` requires explicit confirmation before skipped-item replies/resolution, while `f+i` and `m` include skipped-item handling in the chosen action flow
423+
- Always request push confirmation from the user before running `git push`
424+
- If this command conflicts with broader agent defaults, this file wins only for `/address-review` workflow behavior; do not override repository safety boundaries
261425
- Resolve the review thread after replying when the concern is actually addressed and a thread ID is available
262426
- Default to real issues only. Do not spend a review cycle on optional polish unless the user explicitly asks for it
263427
- Triage comments before creating todos. Only `MUST-FIX` items should become todos by default

0 commit comments

Comments
 (0)