원클릭으로
review-comments
Review unresolved PR comments, reply with valid/invalid assessment, and check CI status
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Review unresolved PR comments, reply with valid/invalid assessment, and check CI status
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | review-comments |
| description | Review unresolved PR comments, reply with valid/invalid assessment, and check CI status |
| user_invocable | true |
| triggers | ["/review-comments"] |
Reviews all unresolved review comments on a GitHub PR, reads the relevant code, and replies to each comment explaining whether the feedback is valid or invalid.
All GitHub API calls MUST go through the helper script at ~/.claude/scripts/review-comments.sh. This script is pre-approved in the permissions allowlist, so it won't trigger approval prompts.
CRITICAL rules for calling the script (violating these triggers approval prompts):
bash /Users/eito/.claude/scripts/review-comments.sh <subcommand> [args]$HOME or ~ — use the literal absolute path /Users/eito/.claude/scripts/review-comments.shgh directly — always use the script| python, | jq, | grep, etc. Piping changes the command and breaks allowlist matching2>&1 or other redirections — same reasonreply subcommand reads the body from stdin — use a heredoc or echo | bash ... to pass the body. Do NOT pass the body as a positional argument (it triggers security prompts when the text contains shell-special characters like quotes, $(), backticks, etc.)Execute these steps in order:
If an argument was provided (e.g. /review-comments 284 or /review-comments https://github.com/org/repo/pull/284), use that PR number/URL.
Otherwise, detect the PR from the current branch:
bash /Users/eito/.claude/scripts/review-comments.sh detect-pr
If no PR is found, stop and report: "No PR found for the current branch. Pass a PR number as an argument."
Store the PR number as PR_NUMBER. Parse the owner and repo from the URL or by running:
bash /Users/eito/.claude/scripts/review-comments.sh detect-pr
Extract owner and repo from the URL field in the JSON response.
bash /Users/eito/.claude/scripts/review-comments.sh detect-pr
Parse the current user's login from the PR data, or use gh api user --jq .login via the script.
Use the list-unresolved subcommand which fetches threads, filters out resolved ones, removes your own comments and noise-bot comments (github-actions, codecov, dependabot), and returns clean JSON. Code-review bots (Sentry, Devin, Qodo, Recurse, Greptile) are kept — their comments are substantive reviews, not noise.
bash /Users/eito/.claude/scripts/review-comments.sh list-unresolved {owner} {repo} {PR_NUMBER} {your_login}
This returns a JSON array where each element has:
databaseId — the comment ID (for replying)path — the file pathline / startLine — line number(s)author — who wrote the commentbody — the comment textcreatedAt — when it was postedthreadComments — full conversation thread for contextParse this JSON output directly. Do NOT pipe it through another command.
For each unresolved comment, read the referenced file and lines to understand the code context. Use the Read tool to inspect the file at the path indicated by the comment.
Read enough surrounding context (at least 20 lines around the referenced line) to understand what the reviewer is referring to.
Before assessing each comment, check the current state of the code on the branch (not the diff snapshot from the comment). Compare the code the reviewer commented on against what's in the working tree now:
Read tool to read the current file at the path and lines referencedbash /Users/eito/.claude/scripts/review-comments.sh log-since {comment_createdAt}
Classify each comment's resolution status:
For each unresolved comment, evaluate:
If a comment is valid and not yet addressed, fix it immediately. Do not just reply — actually make the code change.
For each valid + not-yet-addressed comment:
Estimate the scope of the fix:
next_task.md in the repo root describing the issue, the reviewer's comment, the file/line, and what needs to be done. Reply to the comment noting it's been documented for follow-up.After making fixes, do NOT commit yet — collect all fixes first, then create a single commit at the end of step 7 (after all comments are processed). Use a commit message like 🐛 Address PR review feedback that briefly lists what was fixed.
After committing, push to the PR branch automatically (git push). This ensures the reviewer sees the fixes immediately.
If you deferred any items to next_task.md, mention this in the summary.
For each unresolved comment, post a reply by piping the body via stdin using a heredoc:
bash /Users/eito/.claude/scripts/review-comments.sh reply {owner} {repo} {PR_NUMBER} {comment_id} <<'REPLY_EOF'
{reply_body}
REPLY_EOF
Why stdin? Reply bodies often contain backticks, $(...), consecutive quotes, and other shell-special characters (e.g. when discussing awk/sed). Passing these as a positional argument triggers Claude Code's command obfuscation security check. Using a heredoc with single-quoted delimiter (<<'REPLY_EOF') prevents all shell interpretation of the body.
The reply format should include the validity assessment and the resolution status:
For valid + addressed comments (including ones you just fixed):
**Valid** — [concise explanation of why the feedback is correct]
**Status: Addressed** — [reference the fix, e.g. "Fixed in commit abc1234" or "Updated X at line N to handle Y"]
For valid + deferred comments (too large to fix inline):
**Valid** — [concise explanation of why the feedback is correct]
**Status: Deferred** — This requires a larger change. Documented in `next_task.md` for follow-up.
For invalid comments:
**Invalid** — [concise explanation of why this concern doesn't apply, referencing the specific code/context that addresses it]
Keep replies concise (2-4 sentences per section). Reference specific line numbers, code, or commit hashes when explaining.
After processing comments, check the CI status for the PR:
bash /Users/eito/.claude/scripts/review-comments.sh check-ci {owner} {repo} {PR_NUMBER}
This returns JSON with all check runs. For each check run, note:
status: queued, in_progress, or completedconclusion: success, failure, cancelled, skipped, timed_out, etc. (only present when status is completed)Report on CI:
html_url). Read the failure logs if possible to diagnose the issueAfter processing all comments and CI, report:
next_task.md, call that out explicitly