Skip to content

Sync address-review prompt with upstream PR #16#1098

Merged
justin808 merged 2 commits intomainfrom
jg/sync-claude-commands-pr16
Apr 23, 2026
Merged

Sync address-review prompt with upstream PR #16#1098
justin808 merged 2 commits intomainfrom
jg/sync-claude-commands-pr16

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Apr 23, 2026

Summary

Brings over PR #16 from the shared commands repo so non-Claude assistants (Codex, GPT, etc.) can run the same /address-review workflow.

  • Add prompts/address-review.md — shared prompt template that mirrors the Claude /address-review triage/reply/resolve flow and falls back cleanly when terminal gh access is unavailable.
  • Add root AGENTS.md (adapted for Shakapacker's layout) 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 (synced previously in #1019) and is unchanged here.

Test plan

  • Verify prompts/address-review.md is byte-identical to the upstream template
  • Verify AGENTS.md is discoverable by Codex CLI and points at the shared prompt
  • Confirm no changes to existing .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 via gh, filter unresolved top-level feedback, triage into MUST-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.

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]>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@justin808 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 38 minutes and 15 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4f135145-9311-43c0-95f7-4e194f2a7cc4

📥 Commits

Reviewing files that changed from the base of the PR and between 0a15053 and 6758682.

📒 Files selected for processing (1)
  • prompts/address-review.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg/sync-claude-commands-pr16

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 23, 2026

Greptile Summary

This PR adds two documentation-only files: a root AGENTS.md to orient non-Claude coding tools (Codex, GPT, etc.) within the Shakapacker project, and prompts/address-review.md — a shared prompt template that mirrors the existing Claude /address-review slash-command workflow. No Ruby, JavaScript, or test files are touched.

Confidence Score: 5/5

Safe 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

Filename Overview
AGENTS.md New root-level doc file for non-Claude tools; provides project layout and working rules consistent with CLAUDE.md
prompts/address-review.md New shared prompt template for address-review workflow; mixes shell-variable syntax (${REPO}) with bare placeholder syntax ({PR_NUMBER}) in executable command examples, which may confuse AI tools or users running the commands manually

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (1): Last reviewed commit: "Sync address-review prompt with upstream..." | Re-trigger Greptile

Comment thread prompts/address-review.md
Comment on lines +54 to +57
`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}]'`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 23, 2026

Code Review: PR #1098 — Sync address-review prompt with upstream

Overview

Low-risk, docs/tooling-only change. Adds:

  1. AGENTS.md — project overview and working rules for non-Claude AI tools (Codex, GPT, etc.)
  2. prompts/address-review.md — a standalone prompt template mirroring the Claude /address-review workflow

Both files have proper trailing newlines. No runtime code is touched.


Issues Found

AGENTS.md — missing two rules from CLAUDE.md

The Working Rules section omits two rules that are listed as "Critical Requirements" in CLAUDE.md:

  1. Trailing newline ruleCLAUDE.md says "ALWAYS end all files with a trailing newline character. This is required by the project's linting rules." Non-Claude tools creating/editing files won't know this.
  2. Dual bundler testingCLAUDE.md says "Test changes with both bundlers when modifying core functionality" (webpack + rspack). Since the project explicitly supports both, this is worth carrying over.

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.

prompts/address-review.md — Known Limitations not ported

The Claude command (/.claude/commands/address-review.md) includes a "Known Limitations" section covering:

  • GitHub API rate limits
  • Private repo auth scope requirement
  • GraphQL comments(first:100) inner pagination truncation for threads with >100 comments

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

AGENTS.md and CLAUDE.md now have overlapping rules. Consider adding a comment in AGENTS.md pointing editors to keep both files in sync, or noting that CLAUDE.md is the canonical source and AGENTS.md is the non-Claude subset.


Summary

The 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.

Comment thread AGENTS.md Outdated
- 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`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two rules from CLAUDE.md's Critical Requirements are missing here:

Suggested change
- 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.

Comment thread prompts/address-review.md
Then ask:
- Which items should I address?
- Optional: which skipped or declined items should get rationale replies?
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 23, 2026

Review

Overview: Adds prompts/address-review.md — a copy-paste prompt template that lets non-Claude assistants (Codex, ChatGPT, etc.) run the same address-review triage workflow. Good idea for cross-tool parity.


Issues

1. PR description is stale after the second commit

The description still says:

Add root AGENTS.md (adapted for Shakapacker's layout)…

And the test plan still has:

  • Verify AGENTS.md is discoverable by Codex CLI…

AGENTS.md was dropped in the "Drop AGENTS.md from PR" commit, so these are dead. The description and test plan should be updated to reflect what's actually in the diff.

2. Missing explanation for review-summary-body reply constraint (Step 7)

The prompt correctly lists gh api repos/${REPO}/issues/{PR_NUMBER}/comments for review summary bodies, but gives no reason why. The Claude command spells this out:

"Review summary bodies do not have a comment_id and cannot be replied to via the /replies endpoint."

Without this note, an AI assistant following the prompt could still try the /replies endpoint on a review body (which will 404), since the rule is non-obvious and the why is absent. Suggest adding a one-sentence explanation inline.

3. Multi-line commands in Step 3 are written as inline backtick spans

Several gh api calls in Step 3 are multi-line but formatted as inline backtick code rather than fenced blocks. This makes it easy for a reader (human or AI) to miss the line boundaries and run them incorrectly. The Claude command uses fenced code blocks for every command — this prompt should do the same.

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

  • No Known Limitations section (rate limits, comments(first:100) inner pagination cap) — low priority but worth carrying forward from the Claude command.
  • File ends with a trailing newline ✓

Overall this is low-risk (docs only), but issues 1–3 above are worth fixing before merge.

Comment thread prompts/address-review.md
- 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>"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_id and cannot be replied to via the /replies endpoint — responses must be posted as general PR comments.

Suggest adding a one-liner after this bullet, e.g.:

Suggested change
- 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)

Comment thread prompts/address-review.md
Comment on lines +55 to +63
- 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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 '...'

@justin808 justin808 merged commit 46cc105 into main Apr 23, 2026
7 checks passed
@justin808 justin808 deleted the jg/sync-claude-commands-pr16 branch April 23, 2026 07:16
justin808 added a commit that referenced this pull request Apr 30, 2026
* 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
justin808 added a commit that referenced this pull request Apr 30, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant