Sync address-review prompt with upstream PR #16#1098
Conversation
Brings over the shared Codex/GPT prompt and AGENTS.md guidance from shakacode/claude-code-commands-skills-agents#16 so non-Claude assistants can run the same `/address-review` workflow. Key additions: - `prompts/address-review.md`: shared prompt template for Codex, GPT, or any coding assistant without Claude slash commands. Mirrors the triage/reply/resolve flow and falls back cleanly when terminal `gh` access is unavailable. - `AGENTS.md`: repo-level guidance (adapted for Shakapacker) that points non-Claude tools at `prompts/address-review.md` when asked to address PR review comments. The Claude command at `.claude/commands/address-review.md` already matches upstream HEAD from PR #1019 and is unchanged here. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 38 minutes and 15 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR adds two documentation-only files: a root Confidence Score: 5/5Safe to merge — documentation-only additions with no impact on runtime code. Both files are purely documentation. The single P2 finding is a placeholder-naming clarity issue in an AI prompt template that doesn't affect any production code path. prompts/address-review.md — minor placeholder convention inconsistency worth addressing before the template is widely used. Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant AI as Coding Assistant (Codex / GPT)
participant GH as GitHub API (gh)
Dev->>AI: Address PR review comments for PR N
AI->>AI: Read prompts/address-review.md
alt Terminal / gh available
AI->>GH: gh repo view (get REPO)
AI->>GH: gh api pulls/PR/comments
AI->>GH: gh api graphql (thread metadata)
GH-->>AI: comments + thread state
AI->>AI: Filter and triage (MUST-FIX / DISCUSS / SKIPPED)
AI-->>Dev: Present triage list, await selection
Dev->>AI: Select items to address
AI->>AI: Apply code changes
AI->>GH: POST reply comments
AI->>GH: resolveReviewThread (mutation)
else No gh access
AI-->>Dev: Request exported comment data
Dev->>AI: Provide comment data
AI->>AI: Triage and address as above
end
Reviews (1): Last reviewed commit: "Sync address-review prompt with upstream..." | Re-trigger Greptile |
| `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}]'` | ||
| - Full PR: | ||
| `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}]'` | ||
| `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.
Inconsistent placeholder vs. shell-variable syntax
${REPO} is a real shell variable set in step 1, but {PR_NUMBER} and {REVIEW_ID} look identical to shell brace-expansion but have no $. An AI tool (or a developer) copy-pasting these lines into a terminal will silently expand {PR_NUMBER} to the literal string {PR_NUMBER}, producing a 404. Consider using a clearly non-shell placeholder convention such as <PR_NUMBER> / <REVIEW_ID>, or declare them as shell variables (PR_NUMBER=…) the same way REPO is declared.
Code Review: PR #1098 — Sync address-review prompt with upstreamOverviewLow-risk, docs/tooling-only change. Adds:
Both files have proper trailing newlines. No runtime code is touched. Issues FoundAGENTS.md — missing two rules from The Working Rules section omits two rules that are listed as "Critical Requirements" in
Suggested additions to the Working Rules section: - Always end files with a trailing newline (required by project linting rules).
- Test changes with both webpack and rspack bundlers when modifying core functionality.
The Claude command (
These caveats are equally relevant to non-Claude tools executing the workflow. Worth adding a short limitations note at the end of the prompt template. Maintenance Note
SummaryThe approach is solid and the prompt template faithfully captures the triage-then-act workflow. The two omissions above are minor but worth fixing before merge since they affect correctness for non-Claude users of this repo. |
| - Always use `bundle exec` when running Ruby commands (rubocop, rspec, rake). | ||
| - Run `bundle exec rubocop` before committing Ruby changes. | ||
| - Run `yarn lint` before committing JavaScript changes. | ||
| - Keep PRs small and focused. Never push directly to `main`. |
There was a problem hiding this comment.
Two rules from CLAUDE.md's Critical Requirements are missing here:
| - Keep PRs small and focused. Never push directly to `main`. | |
| - Keep PRs small and focused. Never push directly to `main`. | |
| - Always end files with a trailing newline (required by project linting rules). | |
| - Test changes with both webpack and rspack bundlers when modifying core functionality. |
Non-Claude tools won't have access to CLAUDE.md, so the trailing-newline linting requirement and the dual-bundler testing expectation are worth duplicating here.
| Then ask: | ||
| - Which items should I address? | ||
| - Optional: which skipped or declined items should get rationale replies? | ||
| ``` |
There was a problem hiding this comment.
The Claude command includes a "Known Limitations" section that is equally relevant when non-Claude tools execute this workflow. Consider appending:
## Known Limitations
- **Rate limiting**: GitHub API has rate limits; if you hit them, wait a few minutes before retrying.
- **Private repos**: Requires appropriate `gh` authentication scope (`gh auth status` to verify).
- **GraphQL inner pagination**: `comments(first:100)` inside each review thread is hardcoded. Threads with >100 comments will have older comments truncated. The outer `reviewThreads` pagination is handled by `--paginate`.
Keep this PR scoped to the two address-review files: the existing Claude command in `.claude/commands/address-review.md` and the new Codex/GPT prompt in `prompts/address-review.md`. AGENTS.md belongs in a separate change if/when the project decides to adopt repo-level Codex guidance. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ReviewOverview: Adds Issues1. PR description is stale after the second commit The description still says:
And the test plan still has:
2. Missing explanation for review-summary-body reply constraint (Step 7) The prompt correctly lists
Without this note, an AI assistant following the prompt could still try the 3. Multi-line commands in Step 3 are written as inline backtick spans Several 4. No example output The Claude command includes a concrete example triage block showing the expected format, which helps non-Claude tools produce consistent output. The new prompt omits this; adding even a compact version would improve reliability across different AI backends. Minor
Overall this is low-risk (docs only), but issues 1–3 above are worth fixing before merge. |
| - Reply to each addressed review comment: | ||
| - Issue comments: `gh api repos/${REPO}/issues/{PR_NUMBER}/comments -X POST -f body="<response>"` | ||
| - Review comment replies: `gh api repos/${REPO}/pulls/{PR_NUMBER}/comments/{COMMENT_ID}/replies -X POST -f body="<response>"` | ||
| - Review summary body replies: `gh api repos/${REPO}/issues/{PR_NUMBER}/comments -X POST -f body="<response>"` |
There was a problem hiding this comment.
The correct endpoint is listed here, but the why is missing. An AI assistant following this prompt may still try the /replies endpoint on a review summary body (it's a non-obvious GitHub API constraint). The Claude command makes this explicit:
Review summary bodies do not have a
comment_idand cannot be replied to via the/repliesendpoint — responses must be posted as general PR comments.
Suggest adding a one-liner after this bullet, e.g.:
| - Review summary body replies: `gh api repos/${REPO}/issues/{PR_NUMBER}/comments -X POST -f body="<response>"` | |
| - Review summary body replies: `gh api repos/${REPO}/issues/{PR_NUMBER}/comments -X POST -f body="<response>"` (review summary bodies have no comment_id and cannot use the /replies endpoint) |
| - Full PR: | ||
| `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}]'` | ||
| `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}]'` | ||
| - For all review-comment paths, fetch thread metadata and match `thread_id` by `node_id`: | ||
| `OWNER=${REPO%/*}` | ||
| `NAME=${REPO#*/}` | ||
| `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}]}]'` | ||
|
|
||
| 4. Filter comments: |
There was a problem hiding this comment.
These gh api calls in Step 3 are written as inline backtick spans. Several of them are long enough that the line break between the two commands in the "Specific review" case is ambiguous — a reader could interpret them as one command or two.
The Claude command uses fenced code blocks for every command. Recommend switching to fenced blocks here for clarity and consistency, e.g.:
- Specific review:
```bash
gh api repos/${REPO}/pulls/{PR_NUMBER}/reviews/{REVIEW_ID} | jq '...'
gh api --paginate repos/${REPO}/pulls/{PR_NUMBER}/reviews/{REVIEW_ID}/comments | jq '...'* origin/main: (22 commits) docs: add Dependabot configuration guide (#1094) Sync address-review prompt with upstream PR #16 (#1098) Supersede #910: entry shape test with lint unblock (#919) fix: align rspack v2 peer deps and installer defaults (#1091) docs: update README and guides for Shakapacker v10 (#1092) Release 10.0.0 Update CHANGELOG.md for v10.0.0 (#1089) Release 10.0.0-rc.1 Update CHANGELOG.md for v10.0.0-rc.1 (#1087) Supersede #961 by using pack-config-diff (#973) Add final summary output to rake release (#1041) Add bin/setup to install development deps (#1039) Release 10.0.0-rc.0 Use npx release-it to avoid mise shim failures (#1040) Fix Nokogiri build failure on Ruby 3.4.6 (#1038) Update CHANGELOG.md for v10.0.0-rc.0 (#1037) Update rspack dev deps to 2.0.0-rc.0 (#1036) Fix stale and broken documentation across Shakapacker guides (#1023) Allow webpack-cli v7 in peer dependencies (#1021) refactor: simplify resolving js peer versions when installing (#1034) ... # Conflicts: # package.json
* origin/main: docs: add Dependabot configuration guide (#1094) Sync address-review prompt with upstream PR #16 (#1098) Supersede #910: entry shape test with lint unblock (#919) fix: align rspack v2 peer deps and installer defaults (#1091) docs: update README and guides for Shakapacker v10 (#1092) Release 10.0.0 Update CHANGELOG.md for v10.0.0 (#1089) Release 10.0.0-rc.1 Update CHANGELOG.md for v10.0.0-rc.1 (#1087) Supersede #961 by using pack-config-diff (#973) # Conflicts: # CHANGELOG.md # Rakefile
Summary
Brings over PR #16 from the shared commands repo so non-Claude assistants (Codex, GPT, etc.) can run the same
/address-reviewworkflow.prompts/address-review.md— shared prompt template that mirrors the Claude/address-reviewtriage/reply/resolve flow and falls back cleanly when terminalghaccess is unavailable.AGENTS.md(adapted for Shakapacker's layout) that points non-Claude tools atprompts/address-review.mdwhen asked to address PR review comments.The Claude command at
.claude/commands/address-review.mdalready matches upstream HEAD (synced previously in #1019) and is unchanged here.Test plan
prompts/address-review.mdis byte-identical to the upstream templateAGENTS.mdis discoverable by Codex CLI and points at the shared prompt.claude/commands/address-review.md🤖 Generated with Claude Code
Note
Low Risk
Low risk: adds a standalone prompt markdown file only, with no runtime code changes.
Overview
Adds
prompts/address-review.md, a reusable prompt template that instructs coding assistants how to fetch PR review/issue comments viagh, filter unresolved top-level feedback, triage intoMUST-FIX/DISCUSS/SKIPPED, then (after user selection) reply and optionally resolve threads.Reviewed by Cursor Bugbot for commit 6758682. Bugbot is set up for automated code reviews on this repo. Configure here.