Sync address-review command with triage improvements#2760
Conversation
Pulls in changes from shakacode/claude-code-commands-skills-agents#14: - Add $ARGUMENTS variable, review body fetch, node_id/thread_id tracking - Add jq -s (slurp) for paginated gh api commands - Add GraphQL thread metadata query for resolved-thread skipping - Add review summary body reply path (cannot use /replies endpoint) - Add /replies endpoint for standalone review comments - Add GraphQL inner pagination known limitation - Add security issues to actionable-by-default filter Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
WalkthroughThis pull request updates the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| **If only PR number is provided (fetch all PR review comments):** | ||
| **For all paths that fetch review comments (both specific review and full PR), fetch review thread metadata and attach `thread_id` by matching each review comment's `node_id`:** | ||
|
|
||
| ```bash |
There was a problem hiding this comment.
The GraphQL query and its jq post-processing are collapsed onto a single very long line, making it nearly impossible to read, debug, or modify. Consider breaking it into a shell variable or heredoc for maintainability:
| ```bash | |
| gh api graphql --paginate \ | |
| -f owner="${OWNER}" \ | |
| -f name="${NAME}" \ | |
| -F pr={PR_NUMBER} \ | |
| -f query=' | |
| query($owner:String!, $name:String!, $pr:Int!, $endCursor:String) { | |
| repository(owner:$owner, name:$name) { | |
| pullRequest(number:$pr) { | |
| reviewThreads(first:100, after:$endCursor) { | |
| nodes { | |
| id | |
| isResolved | |
| comments(first:100) { | |
| nodes { id databaseId } | |
| } | |
| } | |
| pageInfo { hasNextPage endCursor } | |
| } | |
| } | |
| } | |
| }' \ | |
| | jq -s '[ | |
| .[].data.repository.pullRequest.reviewThreads.nodes[] | | |
| { | |
| thread_id: .id, | |
| is_resolved: .isResolved, | |
| comments: [.comments.nodes[] | {node_id: .id, id: .databaseId}] | |
| } | |
| ]' |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.claude/commands/address-review.md (1)
107-112: Standardize general-comment task subject format to keep IDs traceable.Line 110 defines a strict subject pattern, but Line 111 allows free-form extraction for general comments. Consider requiring a stable fallback format (for example
general:{comment_id} - {summary} (@{username})) so task-to-comment mapping remains deterministic during follow-up.Based on learnings: Apply blocking review comments by default; optional refinements can be suggested when they improve workflow reliability.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/commands/address-review.md around lines 107 - 112, The TodoWrite task creation logic must enforce a deterministic subject format for general comments and only emit MUST-FIX items; update the code that builds task subjects (the TodoWrite creation logic and any helper that extracts subjects from comments) to use the stable fallback pattern "general:{comment_id} - {summary} (@{username})" whenever a comment does not match the strict file:line pattern, and ensure you filter tasks so only comments marked MUST-FIX are turned into TodoWrite entries; also make blocking review comments the default flag on created tasks unless explicitly marked non-blocking.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.claude/commands/address-review.md:
- Around line 107-112: The TodoWrite task creation logic must enforce a
deterministic subject format for general comments and only emit MUST-FIX items;
update the code that builds task subjects (the TodoWrite creation logic and any
helper that extracts subjects from comments) to use the stable fallback pattern
"general:{comment_id} - {summary} (@{username})" whenever a comment does not
match the strict file:line pattern, and ensure you filter tasks so only comments
marked MUST-FIX are turned into TodoWrite entries; also make blocking review
comments the default flag on created tasks unless explicitly marked
non-blocking.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a2a61b62-7614-428a-b94e-688179695f46
📒 Files selected for processing (1)
.claude/commands/address-review.md
| gh api repos/${REPO}/pulls/{PR_NUMBER}/reviews/{REVIEW_ID}/comments | jq '[.[] | {id: .id, path: .path, body: .body, line: .line, start_line: .start_line, user: .user.login}]' | ||
| # Review body (often contains summary feedback) | ||
| gh api repos/${REPO}/pulls/{PR_NUMBER}/reviews/{REVIEW_ID} | jq '{id: .id, body: .body, state: .state, user: .user.login, html_url: .html_url}' | ||
|
|
There was a problem hiding this comment.
The jq -s '[.[].[] | ...]' idiom for paginated REST results is correct but non-obvious. With --paginate, gh emits one JSON array per page as separate outputs; jq -s collects them into an array-of-arrays, and then .[].[] double-indexes through pages → items to flatten them.
Consider adding a brief inline comment to explain this for future readers:
| gh api --paginate repos/${REPO}/pulls/{PR_NUMBER}/reviews/{REVIEW_ID}/comments \ | |
| | jq -s '[ | |
| # --paginate emits one array per page; -s collects them into [[page1...],[page2...]]; | |
| # .[].[] flattens pages -> items | |
| .[].[] | {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} | |
| ]' |
| 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}]' | ||
|
|
||
| # General PR discussion comments (not tied to specific lines) | ||
| 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}]' |
There was a problem hiding this comment.
No error-handling guidance is given for this GraphQL fetch, unlike the REST API calls which have explicit 404/403 notes. If the query fails (e.g. missing OAuth scope read:discussion, or a network error), the AI has no thread metadata and could silently skip thread resolution.
Suggest adding a brief note here:
If the GraphQL query fails, log the error and continue without
thread_id— thread resolution will be skipped for unresolved threads, but fetching and triaging comments should still proceed normally.
Review: address-review command syncOverall this is a solid improvement. The additions address real gaps (paginated comment fetching, review body capture, resolved-thread skipping) and the triage/reply guidance is clearer. A few notes: What's good
Concerns (see inline comments)
Minor
|
Greptile SummaryThis PR syncs Key changes:
One issue found: Step 5's TodoWrite instruction removes the required Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Claude
participant GH_REST as GitHub REST API
participant GH_GQL as GitHub GraphQL API
User->>Claude: /address-review $ARGUMENTS
Claude->>GH_REST: gh repo view (get REPO)
GH_REST-->>Claude: REPO name
alt specific review ID
Claude->>GH_REST: GET /pulls/{PR}/reviews/{REVIEW_ID}
GH_REST-->>Claude: review body + state
Claude->>GH_REST: GET --paginate /pulls/{PR}/reviews/{REVIEW_ID}/comments
GH_REST-->>Claude: inline comments (node_id, ...)
else full PR
Claude->>GH_REST: GET --paginate /pulls/{PR}/comments
GH_REST-->>Claude: review comments (node_id, ...)
Claude->>GH_REST: GET --paginate /issues/{PR}/comments
GH_REST-->>Claude: issue comments (node_id, ...)
end
Claude->>GH_GQL: graphql --paginate reviewThreads query
GH_GQL-->>Claude: thread_id, isResolved, comment node_ids
Claude->>Claude: Filter resolved threads & replies
Claude->>Claude: Triage → MUST-FIX / DISCUSS / SKIPPED
Claude->>Claude: TodoWrite (MUST-FIX items only)
Claude->>User: Present triage, await selection
User->>Claude: Select items to address
loop For each selected item
Claude->>Claude: Make code/test/doc change
alt review summary body
Claude->>GH_REST: POST /issues/{PR}/comments
else review inline comment
Claude->>GH_REST: POST /pulls/{PR}/comments/{ID}/replies
else issue comment
Claude->>GH_REST: POST /issues/{PR}/comments
end
GH_REST-->>Claude: reply posted
Claude->>GH_GQL: mutation resolveReviewThread(threadId)
GH_GQL-->>Claude: thread resolved
end
Last reviewed commit: "Sync address-review ..." |
| Create a task list with TodoWrite containing **only the `MUST-FIX` items**: | ||
|
|
||
| - One todo per must-fix comment or deduplicated issue | ||
| - For file-specific comments: `"{file}:{line} - {comment_summary} (@{username})"` (content) | ||
| - For general comments: Parse the comment body and extract the must-fix action | ||
| - Format activeForm: `"Addressing {brief description}"` | ||
| - All todos should start with status: `"pending"` | ||
| - One task per must-fix comment or deduplicated issue | ||
| - Subject: `"{file}:{line} - {comment_summary} (@{username})"` | ||
| - For general comments: Parse the comment body and extract the must-fix action as the subject | ||
| - Description: Include the full review comment text and any relevant context | ||
| - All tasks should start with status: `"pending"` |
There was a problem hiding this comment.
activeForm field dropped from TodoWrite instruction
The previous version of Step 5 explicitly told the executing AI to set activeForm: "Addressing {brief description}", which is a required field in the TodoWrite schema (content, activeForm, status are all required). The new version replaces it with a Description: bullet that doesn't correspond to any TodoWrite field.
As a result:
activeFormis no longer specified, so the executing AI must guess an appropriate present-continuous label or omit it entirely — either path risks a tool-call failure.Description:is not a real TodoWrite field; its instruction ("include the full review comment text") will be silently ignored or misapplied.
Suggested fix — restore activeForm guidance and drop the non-existent Description field:
| Create a task list with TodoWrite containing **only the `MUST-FIX` items**: | |
| - One todo per must-fix comment or deduplicated issue | |
| - For file-specific comments: `"{file}:{line} - {comment_summary} (@{username})"` (content) | |
| - For general comments: Parse the comment body and extract the must-fix action | |
| - Format activeForm: `"Addressing {brief description}"` | |
| - All todos should start with status: `"pending"` | |
| - One task per must-fix comment or deduplicated issue | |
| - Subject: `"{file}:{line} - {comment_summary} (@{username})"` | |
| - For general comments: Parse the comment body and extract the must-fix action as the subject | |
| - Description: Include the full review comment text and any relevant context | |
| - All tasks should start with status: `"pending"` | |
| - One task per must-fix comment or deduplicated issue | |
| - `content`: `"{file}:{line} - {comment_summary} (@{username})"` | |
| - For general comments: Parse the comment body and extract the must-fix action as the content | |
| - `activeForm`: `"Addressing {brief description}"` | |
| - All tasks should start with status: `"pending"` |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49173b9b75
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Inline code review comments | ||
| 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}]' | ||
|
|
||
| # General PR discussion comments (not tied to specific lines) | ||
| 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}]' |
There was a problem hiding this comment.
Fetch review summaries in the PR-wide path
In the /address-review 12345 branch, we now load inline review comments and general issue comments, but we still never call GitHub's List reviews for a pull request endpoint, which is where submitted review summary bodies live (body, state, html_url). That means a very common case—a review that only leaves summary feedback and no inline comments—will be invisible unless the user passes a specific #pullrequestreview-... URL. Since Step 7 now has special handling for review summary replies, this omission will cause actionable feedback to be missed in the default full-PR flow.
Useful? React with 👍 / 👎.
## Summary - Stamp `### [16.5.0.rc.0]` version header with today's date - Add 10 new changelog entries for PRs merged since v16.4.0 - Fix incomplete PR 2818 entry (missing author link) ### New entries added **Added:** - `create-react-on-rails-app --pro` support (PR 2818) - Global prerender env override `REACT_ON_RAILS_PRERENDER_OVERRIDE` (PR 2816) - `react_on_rails:sync_versions` rake task (PR 2797) - Pro/RSC setup checks in `react_on_rails:doctor` (PR 2674) **Changed:** - [Pro] Canonical env var for worker count is now `RENDERER_WORKERS_COUNT` (PR 2611) **Improved:** - Smoother `create-react-on-rails-app` and install generator flows (PR 2650) - Pro upgrade hint after install (PR 2642) **Fixed:** - Preserve runtime env vars across `Bundler.with_unbundled_env` (PR 2836) - Fix doctor prerender check and ExecJS display for Pro/RSC apps (PR 2773) - Fix doctor false positives for custom layouts (PR 2612) ### Skipped PRs (not user-visible) Docs-only: #2845, #2842, #2826, #2830, #2820, #2809, #2803, #2785, #2801, #2791, #2789, #2788, #2772, #2778, #2780, #2784, #2671, #2676, #2662, #2657, #2669 CI/internal tooling: #2825, #2817, #2819, #2812, #2815, #2810, #2808, #2807, #2634, #2798, #2761, #2760, #2658, #2639, #2667, #2656 ## Test plan - [x] Verified version header and diff links are correct - [x] Verified all entries follow changelog formatting conventions - [x] Verified file ends with newline - [ ] After merge, run `rake release` to publish 16.5.0.rc.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation-only change updating `CHANGELOG.md` with a new `16.5.0.rc.0` section and compare links; no runtime code is modified. > > **Overview** > Adds a new `16.5.0.rc.0` (2026-03-25) section to `CHANGELOG.md`, consolidating recent PR entries under **Added/Changed/Improved/Fixed** and correcting the previously incomplete `--pro` CLI entry author attribution. > > Updates the bottom compare links so `[unreleased]` now compares from `v16.5.0.rc.0` and adds a link definition for `[16.5.0.rc.0]`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 481a71c. 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 ## Release Notes - v16.5.0.rc.0 * **New Features** * Added sync_versions task for streamlined version management * Expanded doctor checks for Pro and RSC support * **Improvements** * Enhanced generator workflow and Pro upgrade guidance * Improved environment variable handling and preservation * **Bug Fixes** * Fixed detection issues with doctor tools and ExecJS/prerender functionality <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
## Summary - Syncs `.claude/commands/address-review.md` with upstream [shakacode/claude-code-commands-skills-agents#14](shakacode/claude-code-commands-skills-agents#14) - Adds `$ARGUMENTS` variable, review body fetch, `node_id`/`thread_id` tracking, `jq -s` for paginated API calls, GraphQL thread metadata query, review summary body reply path, and GraphQL pagination known limitation ## Test plan - [ ] Run `/address-review` on a PR with inline review comments and verify triage output - [ ] Verify thread resolution works via GraphQL after addressing a comment 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Updates the `/address-review` workflow to use additional GitHub API/GraphQL calls and new reply paths, which could mis-handle comment/thread IDs if incorrect. Changes are confined to a command markdown file (no product code), limiting blast radius to the review-assistant workflow. > > **Overview** > Updates the `.claude/commands/address-review.md` `/address-review` instructions to better handle real-world GitHub review flows. > > It now captures `$ARGUMENTS`, fetches both *review summary bodies* and paginated inline comments (using `jq -s`), and records `node_id` so comments can be mapped to GraphQL `reviewThreads` to obtain `thread_id`/`is_resolved` and skip already-resolved threads. > > Reply guidance is clarified: use `/replies` for review comments, but post general PR comments for review summary bodies; triage/task creation rules are tightened and DISCUSS items can be treated like MUST-FIX when user-selected, with a documented GraphQL pagination limitation. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 49173b9. 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 * Clarified address-review command workflow with improved step-by-step guidance for extracting pull request and review information * Enhanced instructions for retrieving review data and attaching thread metadata to comments * Refined filtering rules for handling different types of review comments and replies * Updated terminology and formatting requirements for consistency <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
## Summary - Syncs `.claude/commands/address-review.md` with upstream [shakacode/claude-code-commands-skills-agents#14](shakacode/claude-code-commands-skills-agents#14) - Adds `$ARGUMENTS` variable, review body fetch, `node_id`/`thread_id` tracking, `jq -s` for paginated API calls, GraphQL thread metadata query, review summary body reply path, and GraphQL pagination known limitation ## Test plan - [ ] Run `/address-review` on a PR with inline review comments and verify triage output - [ ] Verify thread resolution works via GraphQL after addressing a comment 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Updates the `/address-review` workflow to use additional GitHub API/GraphQL calls and new reply paths, which could mis-handle comment/thread IDs if incorrect. Changes are confined to a command markdown file (no product code), limiting blast radius to the review-assistant workflow. > > **Overview** > Updates the `.claude/commands/address-review.md` `/address-review` instructions to better handle real-world GitHub review flows. > > It now captures `$ARGUMENTS`, fetches both *review summary bodies* and paginated inline comments (using `jq -s`), and records `node_id` so comments can be mapped to GraphQL `reviewThreads` to obtain `thread_id`/`is_resolved` and skip already-resolved threads. > > Reply guidance is clarified: use `/replies` for review comments, but post general PR comments for review summary bodies; triage/task creation rules are tightened and DISCUSS items can be treated like MUST-FIX when user-selected, with a documented GraphQL pagination limitation. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 49173b9. 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 * Clarified address-review command workflow with improved step-by-step guidance for extracting pull request and review information * Enhanced instructions for retrieving review data and attaching thread metadata to comments * Refined filtering rules for handling different types of review comments and replies * Updated terminology and formatting requirements for consistency <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Summary
.claude/commands/address-review.mdwith upstream shakacode/claude-code-commands-skills-agents#14$ARGUMENTSvariable, review body fetch,node_id/thread_idtracking,jq -sfor paginated API calls, GraphQL thread metadata query, review summary body reply path, and GraphQL pagination known limitationTest plan
/address-reviewon a PR with inline review comments and verify triage output🤖 Generated with Claude Code
Note
Medium Risk
Updates the
/address-reviewworkflow to use additional GitHub API/GraphQL calls and new reply paths, which could mis-handle comment/thread IDs if incorrect. Changes are confined to a command markdown file (no product code), limiting blast radius to the review-assistant workflow.Overview
Updates the
.claude/commands/address-review.md/address-reviewinstructions to better handle real-world GitHub review flows.It now captures
$ARGUMENTS, fetches both review summary bodies and paginated inline comments (usingjq -s), and recordsnode_idso comments can be mapped to GraphQLreviewThreadsto obtainthread_id/is_resolvedand skip already-resolved threads.Reply guidance is clarified: use
/repliesfor review comments, but post general PR comments for review summary bodies; triage/task creation rules are tightened and DISCUSS items can be treated like MUST-FIX when user-selected, with a documented GraphQL pagination limitation.Written by Cursor Bugbot for commit 49173b9. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
Documentation