Add AGENTS.md and address-review prompt for non-Claude agents#708
Add AGENTS.md and address-review prompt for non-Claude agents#708
Conversation
Adds Codex/GPT support by including: - AGENTS.md pointing non-Claude agents to shared prompts - prompts/address-review.md for PR review triage workflow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ 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 (2)
✨ 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 |
🚀 Quick Review App CommandsWelcome! Here are the commands you can use in this PR:
|
Greptile SummaryThis PR adds two documentation files to support non-Claude coding agents (Codex CLI, ChatGPT, etc.) in this repo: a minimal
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User invokes agent with PR reference] --> B{Agent has gh access?}
B -- No --> C[Agent asks user for gh api output or PR data]
B -- Yes --> D[Step 1: Resolve REPO via gh repo view]
D --> E[Step 2: Parse PR reference\nExtract PR number and optional review/comment ID]
E --> F{Reference type?}
F -- Issue comment --> G[Fetch single issue comment via REST]
F -- Specific review --> H[Fetch review + review comments via REST]
F -- Full PR --> I[Fetch all review comments + issue comments via REST]
G --> J[GraphQL: fetch thread metadata\nresolvedstatus per thread]
H --> J
I --> J
J --> K[Step 4: Filter\nSkip resolved threads\nSkip reply comments\nDeduplicate]
K --> L[Step 5: Triage\nMUST-FIX / DISCUSS / SKIPPED]
L --> M[Step 6: Present triage and WAIT for user]
M --> N[User selects items to address]
N --> O[Step 7: Make code/test/doc changes\nRun checks]
O --> P[Post gh api replies to each addressed comment]
P --> Q[Resolve threads via GraphQL mutation]
Reviews (1): Last reviewed commit: "Add AGENTS.md and address-review prompt ..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae4f80e6ff
ℹ️ 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".
| `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.
Include review summaries when fetching full PR comments
The Full PR fetch path only pulls inline review comments (/pulls/{PR_NUMBER}/comments) and issue comments (/issues/{PR_NUMBER}/comments), so it misses review-level summary bodies from /pulls/{PR_NUMBER}/reviews. Those summary reviews are where many REQUEST_CHANGES must-fix notes are left, so this workflow can incorrectly triage a PR as having no actionable feedback and skip required fixes.
Useful? React with 👍 / 👎.
| # react-webpack-rails-tutorial | ||
|
|
||
| ## Project Overview | ||
|
|
||
| React on Rails demo app — a Rails application with React, Redux, Tailwind CSS, and server-side rendering via the react_on_rails gem. | ||
|
|
||
| - `prompts/`: shared prompt templates for Codex, GPT, and other non-Claude tools | ||
|
|
||
| ## Working Rules | ||
|
|
||
| - When the user asks to address PR review comments, follow `prompts/address-review.md`. |
There was a problem hiding this comment.
Missing project development context
AGENTS.md is intentionally minimal, but unlike CLAUDE.md, it omits build/test commands and the important Conductor compatibility note (the bin/conductor-exec wrapper required for correct Ruby/Node version usage). Any non-Claude agent relying solely on AGENTS.md will lack this context and may run commands with incorrect tool versions.
Consider adding a brief "Key Commands" section or a pointer to CLAUDE.md for the shared project rules, similar to how CLAUDE.md documents the build workflow:
| # react-webpack-rails-tutorial | |
| ## Project Overview | |
| React on Rails demo app — a Rails application with React, Redux, Tailwind CSS, and server-side rendering via the react_on_rails gem. | |
| - `prompts/`: shared prompt templates for Codex, GPT, and other non-Claude tools | |
| ## Working Rules | |
| - When the user asks to address PR review comments, follow `prompts/address-review.md`. | |
| # react-webpack-rails-tutorial | |
| ## Project Overview | |
| React on Rails demo app — a Rails application with React, Redux, Tailwind CSS, and server-side rendering via the react_on_rails gem. | |
| - `prompts/`: shared prompt templates for Codex, GPT, and other non-Claude tools | |
| ## Working Rules | |
| - When the user asks to address PR review comments, follow `prompts/address-review.md`. | |
| ## Key Commands | |
| ```bash | |
| bin/dev # development server | |
| bundle exec rspec # test suite | |
| bundle exec rubocop # lint |
Note: Use
bin/conductor-exec <cmd>when running in a non-interactive shell to ensure the correct Ruby/Node versions are activated (seeCLAUDE.mdfor details).
| - 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}]}]'` | ||
|
|
There was a problem hiding this comment.
Thread metadata fetch scope is ambiguous
The comment "For all review-comment paths" on line 58 appears nested under the "Full PR" bullet, but the instruction implies it should also be executed for the "Specific review" path on lines 53-54. If an agent follows the indented structure literally, it would skip fetching thread resolution status when handling a specific review URL — meaning resolved threads would not be filtered out in step 4.
Consider making this explicit by either:
- Moving the GraphQL thread-metadata fetch to a separate numbered step, or
- Adding it explicitly under the "Specific review" block as well.
| `gh api repos/${REPO}/pulls/{PR_NUMBER}/reviews/{REVIEW_ID} | jq '{id: .id, body: .body, state: .state, user: .user.login, html_url: .html_url}'` | ||
| `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}]'` |
There was a problem hiding this comment.
The commands in this block mix two distinct syntaxes that look similar but behave differently:
${REPO}— a shell variable set earlier byREPO=$(gh repo view ...){PR_NUMBER},{COMMENT_ID},{REVIEW_ID}— template placeholders the human must substitute before running
An AI agent executing these commands literally will expand ${REPO} correctly but silently expand {PR_NUMBER} to an empty string (failed substitution in bash), producing malformed API paths like repos/org/name/pulls//comments.
Consider using a visually distinct delimiter for template slots, e.g. <PR_NUMBER> or $PR_NUMBER (set via PR_NUMBER=... before the block), to make it unambiguous which tokens are pre-set shell variables and which require substitution.
|
|
||
| React on Rails demo app — a Rails application with React, Redux, Tailwind CSS, and server-side rendering via the react_on_rails gem. | ||
|
|
||
| - `prompts/`: shared prompt templates for Codex, GPT, and other non-Claude tools |
There was a problem hiding this comment.
Non-Claude agents reading only AGENTS.md won't know that CLAUDE.md exists alongside it and contains important project conventions (build/test commands, the bin/conductor-exec wrapper requirement for correct tool versions, etc.).
Consider adding a cross-reference so agents know to read both files:
| - `prompts/`: shared prompt templates for Codex, GPT, and other non-Claude tools | |
| - `prompts/`: shared prompt templates for Codex, GPT, and other non-Claude tools | |
| - See also `CLAUDE.md` for build commands, test commands, and environment setup (the `bin/conductor-exec` wrapper is required for correct Ruby/Node versions) |
| - 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}]}]'` |
There was a problem hiding this comment.
Minor: -F pr={PR_NUMBER} uses the typed field flag (-F) which coerces the value to an integer for GraphQL — correct for the Int! type. But {PR_NUMBER} here is still an unset template placeholder (same issue as line 56). If an agent runs this literally, -F pr= passes an empty string, which the GraphQL endpoint will reject with a type error. Worth fixing alongside the broader placeholder-syntax clarification.
|
Overall: Clean, low-risk addition — documentation only. The prompt logic in prompts/address-review.md mirrors the Claude Code /address-review skill well. Issue 1 — Mixed shell-variable / template-placeholder syntax (see inline comments on lines 56 and 61): Commands mix REPO as a real shell variable set by gh with PR_NUMBER, COMMENT_ID, etc. used as bare-brace template placeholders. In bash a token like {PR_NUMBER} without a leading dollar sign is not a variable expansion — an AI agent executing these commands literally would produce broken API paths (e.g. repos/org/name/pulls//comments). Recommend using angle brackets for template slots (e.g. <PR_NUMBER>) or pre-setting all values as shell variables so the syntax is unambiguous. Issue 2 — AGENTS.md does not cross-reference CLAUDE.md (see inline comment on line 7): An agent reading only AGENTS.md will miss project conventions in CLAUDE.md — specifically the bin/conductor-exec wrapper required for correct Ruby/Node versions, and the build/test commands. A one-line pointer closes the gap. What is good: the step-by-step structure is complete and clear. The --paginate plus jq -s flattening pattern is correct for GitHub list endpoints. The -F typed field flag for the GraphQL Int! parameter is correct. Bot deduplication, thread resolution, and the stop-and-wait guard against auto-fixing are all well-specified. |
Summary
AGENTS.mdso non-Claude coding agents (Codex, GPT) know to use shared prompts in this repoprompts/address-review.md— a portable PR review triage workflow that mirrors Claude Code's/address-reviewcommand, for use with Codex CLI, ChatGPT, or other toolsMirrors setup from shakacode/claude-code-commands-skills-agents#16.
Test plan
AGENTS.mdand usesprompts/address-review.mdwhen asked to address PR review comments🤖 Generated with Claude Code
Note
Low Risk
Low risk: only adds documentation/prompt templates and does not change application code or runtime behavior.
Overview
Adds
AGENTS.mdto document repo-specific working rules for non-Claude coding agents, including pointing them at shared prompts.Introduces
prompts/address-review.md, a portable, step-by-step prompt/workflow for fetching, filtering, and triaging GitHub PR review comments (viagh/GraphQL), then replying/resolving threads after user selection.Written by Cursor Bugbot for commit ae4f80e. This will update automatically on new commits. Configure here.