ワンクリックで
review-pr
// Handle CodeRabbit and Codex review comments on a GitHub PR. Fetches the PR, investigates each comment against the codebase, discusses validity with the user, batches valid fixes, and guides through push and reply steps.
// Handle CodeRabbit and Codex review comments on a GitHub PR. Fetches the PR, investigates each comment against the codebase, discusses validity with the user, batches valid fixes, and guides through push and reply steps.
Investigate and resolve GitHub pull request review comments for HMIS. Use when the user wants Codex to read PR review threads, assess CodeRabbit or Codex feedback, discuss valid fixes, batch and apply changes, reply to each comment, and re-request review.
JSF AJAX update rules for the HMIS project. Use when working on AJAX updates, p:commandButton update attributes, PrimeFaces AJAX callbacks, partial page rendering, or debugging AJAX update failures. Also covers JSF navigation patterns: why f:viewAction must not be used on @SessionScoped beans, and how initialization belongs in navigation methods. Critical rules to prevent silent AJAX failures and refresh/back-button state corruption.
JSF AJAX update rules for the HMIS project. Use when working on AJAX updates, p:commandButton update attributes, PrimeFaces AJAX callbacks, partial page rendering, or debugging AJAX update failures. Also covers JSF navigation patterns: why f:viewAction must not be used on @SessionScoped beans, and how initialization belongs in navigation methods. Critical rules to prevent silent AJAX failures and refresh/back-button state corruption.
Commit code following HMIS project conventions. Use when committing changes with proper issue closing keywords, message format, and co-author attribution.
Full environment setup when starting work on a GitHub issue. Creates a feature branch from origin/development, swaps persistence.xml to local JNDI settings, assigns the issue, and guides project board setup. Use when beginning work on any new issue: "start issue 20408", "/start-issue 20408", or "prepare env for issue 20408".
Verify and manage persistence.xml configuration around git push. Use before pushing to ensure environment variable placeholders are in place, and after pushing to restore local JNDI names for continued testing. Prevents QA deployment failures from hardcoded datasource names.
| name | review-pr |
| description | Handle CodeRabbit and Codex review comments on a GitHub PR. Fetches the PR, investigates each comment against the codebase, discusses validity with the user, batches valid fixes, and guides through push and reply steps. |
| allowed-tools | Read, Grep, Glob, Bash |
| argument-hint | <pr-url-or-number> |
Handle review comments (CodeRabbit, Codex, human reviewers) on a GitHub pull request.
$0 — GitHub PR URL or PR number (required)git fetch origin
gh pr checkout $0
Always fetch first — automated tools may have pushed fixes not yet local.
gh pr view $0 --comments
pr_number=$(gh pr view $0 --json number --jq '.number')
gh api repos/hmislk/hmis/pulls/$pr_number/comments
List all review comments. Group them by file/topic.
For each comment:
ReadGrepCommon false positives in this project:
getBillFinanceDetails())purcahseRate — database compatibilityFor each comment, report:
Wait for user confirmation before making any changes.
Apply all confirmed fixes. Group into one or a few logical commits:
Fix CodeRabbit review comments (#<issue>)
Closes #<issue>
Co-Authored-By: Claude <noreply@anthropic.com>
persistence.xml uses ${JDBC_DATASOURCE} / ${JDBC_AUDIT_DATASOURCE} — not hardcoded JNDI names.env files stagedgit push
Verify CI passes before proceeding.
⚠️ Cardinal rules — read before posting anything:
- Do NOT create new top-level inline comments on the PR. Each one becomes a thread the author must manually resolve. This is noise.
- Reply only after fixing (or explicitly dismissing). Bots cannot fix anything — describe action taken, not requested.
⚠️ "Please resolve" wording on a CodeRabbit thread triggers CodeRabbit Chat — it opens a NEW PR (
- Valid + fixed → "Fixed in
<commit-sha>:<what was changed>"- Dismissed → "Dismissed because:
<specific reasoning>"📝 CodeRabbit Chat: Implement requested code changes, branchcoderabbitai/chat/<sha>) attempting the fix against a stale snapshot. These auto-PRs often duplicate work the author has already done and have shipped unsafe diffs (e.g. deleted aparams.put(...)line on PR #20979). If you accidentally trigger one: close it, delete the branch.- Replies go UNDER existing reviewer threads only (
/repliesendpoint). Never as new top-level comments.- Self-review items go in the commit message (or PR description if deferred). Never as new inline comments.
- ONE re-review request at the end, not per item.
Order: discuss → fix → push → reply to existing threads → one re-review request.
For each existing reviewer comment, post a threaded reply under the parent. The four endpoints are easy to confuse:
| Want | Endpoint | Use? |
|---|---|---|
| Reply under existing reviewer comment (threaded) | POST /pulls/{pr}/comments/{id}/replies | YES — this is the only legitimate reply form |
| New standalone inline comment on a line | POST /pulls/{pr}/comments | NO — creates a fresh thread the author must manually resolve |
| Bundled review | POST /pulls/{pr}/reviews | NO — grouping wrapper, doesn't match how bots post |
| General PR comment (only genuine PR-wide notes) | POST /issues/{n}/comments | Sparingly — only for actual PR-wide announcements |
For self-review items you spot on your own PR — don't post a new inline comment. Fix in the next commit and reference the file:line in the commit message:
refactor(cashier): address self-review items
- PaymentSettlementController.java:117 — add comment on shallow snapshot
- settle_non_cash.xhtml:203 — use lastSettlementBill.institution.name
Find existing comment IDs to reply to:
gh api "repos/hmislk/hmis/pulls/<PR>/comments" \
--jq '.[] | "\(.id) \(.user.login) \(.path):\(.line // .original_line)"'
Post a threaded reply:
gh api -X POST "repos/hmislk/hmis/pulls/<PR>/comments/<COMMENT_ID>/replies" \
-f body="Fixed in <commit-sha>: <what was changed>."
Do NOT resolve other reviewers' conversations. CodeRabbit auto-resolves on detection.
Full API recipes and cleanup commands: see Posting PR Comments via gh CLI.
Click "Re-request review" on the PR page after pushing. Do not rely on reviewers noticing the new push.
After merge:
git branch -d <branch-name>
Also confirm "Delete branch" was checked in the GitHub merge dialog.
Full workflow documentation: developer_docs/git/pr-review-workflow.md