review-pr-comments
Skill34 starsChanged 19 days agoMITView on GitHub
Fetch PR review comments via gh CLI, classify them (valid & fix / valid & skip / invalid), fix the valid ones, reply and resolve the threads, and fix any CI failures. Invoke only when the user types /review-pr-comments — never auto-trigger.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- MadsVSChristensen/claude-skillstheir own version, first seen Nov 15, 2026
- fritzprix/libr-agenttheir own version, first seen Nov 10, 2026
- rhvdbergh/claude-skillstheir own version, first seen Oct 16, 2026
- learntocloud/learn-to-cloud-apptheir own version, first seen Oct 8, 2026
- latitude-dev/latitude-llmtheir own version, first seen Oct 8, 2026
- DataDog/datadog-agenttheir own version, first seen Oct 8, 2026
Used with
Projects with it also use create-pr.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillcreate-pr
Create pull requests following Sentry conventions. Use when opening PRs, writing PR descriptions, or preparing changes for review. Follows Sentry's code review guidelines.
Also in 4 projects that use this
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- latitude-dev/latitude-llm★ 4.8ksame name
- DataDog/datadog-agent★ 3.8ksame name
- learntocloud/learn-to-cloud-app★ 1.1ksame name
- Hey-Diga/dotclaude★ 17same name
- fritzprix/libr-agent★ 12same name
- MadsVSChristensen/claude-skills★ 0same name
- rhvdbergh/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- extract-terminologySkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 8 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
All GitHub interaction goes through gh CLI — never the GitHub MCP server.
- Very specific: line 16
If $ARGUMENTS has a number, use it.
- Distinctive: line 25
If no open PR for the branch, stop and tell the user.
- Distinctive: line 87
When a reviewer submits "Request changes" or "Approve" they often paste a body with overall feedback.
- Distinctive: line 103
Keep bot comments that raise specific findings (Gemini inline, Claude bot inline, Copilot inline).
- Distinctive: line 113
Read the file before deciding.
- Distinctive: line 138
Ask the user to confirm which ones to fix.
- Very specific: line 147
No half-fixes: If the fix exposes another problem (e.g.
- Distinctive: line 151
Run the relevant subset, in roughly increasing cost:
- Distinctive: line 160
Before pushing — full sweep:
- Distinctive: line 166
If any quality gate fails, fix it before moving on.
- Very specific: line 187
Use the GraphQL threadId you correlated in step 2b:
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/review-pr-comments — evaluate PR feedback and fix valid issues
User-invoked only. $ARGUMENTS is an optional PR number; if empty, auto-detect from the current branch.
All GitHub interaction goes through gh CLI — never the GitHub MCP server. The MCP server is incomplete (missing endpoints for review-thread resolution, partial coverage of comment surfaces).
1. Identify the PR
If $ARGUMENTS has a number, use it.
Otherwise:
BRANCH=$(git branch --show-current)
gh pr list --head "$BRANCH" --json number,title,url --jq '.[0]'If no open PR for the branch, stop and tell the user.
Capture OWNER, REPO, PR for the rest of the run:
gh repo view --json owner,name --jq '"\(.owner.login) \(.name)"'2. Fetch comments — THREE separate surfaces
GitHub exposes PR feedback in three places. Missing any one means you'll miss real comments. Always check all three.
2a. Inline review comments (line-anchored)
These are the most common — Gemini/Claude/Copilot bots, human reviewers' line-level comments.
gh api "repos/$OWNER/$REPO/pulls/$PR/comments" --paginate \
--jq '.[] | {id, path, line, body, user: .user.login, in_reply_to_id, html_url}'Fields you need: id (REST numeric, used for reply), path, line, body, user.login, in_reply_to_id (non-null = follow-up reply, ignore the duplicates).
2b. Inline review threads (for resolution)
To resolve a thread you need its GraphQL node ID. Fetch in one query and correlate by databaseId ↔ REST id:
gh api graphql -f query='
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 100) {
nodes {
id
isResolved
isOutdated
path
line
comments(first: 1) { nodes { databaseId author { login } body } }
}
}
}
}
}' -F owner="$OWNER" -F repo="$REPO" -F pr="$PR"Build a map databaseId → {threadId, isResolved} so step 6 can resolve by REST comment ID.
Skip threads where isResolved: true — already handled.
2c. General PR comments (issue-level, not line-anchored)
This is where Claude-bot summaries, Gemini-bot summary, Copilot summary, and human comments-without-line-context land. The REST endpoint is /issues/.../comments because GitHub stores PR-level conversation as issue comments.
gh api "repos/$OWNER/$REPO/issues/$PR/comments" --paginate \
--jq '.[] | {id, body, user: .user.login, created_at, html_url}'2d. Review submissions (approval-level body)
When a reviewer submits "Request changes" or "Approve" they often paste a body with overall feedback. Different endpoint:
gh api "repos/$OWNER/$REPO/pulls/$PR/reviews" --paginate \
--jq '.[] | {id, state, body, user: .user.login}'Filtering
Filter out bot summary blobs — purely informational, never actionable:
gemini-code-assist[bot]summary comments (the long "Summary of Changes" general comment — keep the inline[medium]/[high]priority ones)copilot-pull-request-reviewer[bot]summarycoderabbitai[bot]walk-through comment- Comments whose body is just a status badge / emoji table
Keep bot comments that raise specific findings (Gemini inline, Claude bot inline, Copilot inline). Read the body, not the author — if there's a concrete code suggestion, it's actionable.
3. Classify each comment
For every real comment, assign one of three verdicts:
- Valid & fix — real bug, type error, race condition, security problem, correctness bug, data integrity issue.
- Valid & skip — observation is accurate but the change isn't worth it (minor stylistic preference that doesn't match project convention, premature optimization, scope creep).
- Invalid — the reviewer misread the code, or the proposed fix would break something.
Read the file before deciding. Don't blindly trust the reviewer; also don't reflexively dismiss bot output — Gemini/Copilot often catch real issues.
Common patterns in this codebase to watch for:
- TypeScript strictness:
noUncheckedIndexedAccessis on,T | undefinedfromarr[i]is real. A bot warning about a missing!or?? fallbackis usually valid. - AsyncLocalStorage usage in
packages/server/src/telemetry/: comments about identity propagation across async boundaries deserve careful reading. - SQLite query patterns in
analytics-store.ts/queries.ts:ISvs=for nullable columns,json_eachparameter bindings — bot suggestions about these are usually correct. - MCP tool registration in
mcp-handler.ts: handlers are monkey-patched viaserver.tool; bot comments about telemetry-wrap behavior need to be checked against the wrapper, not the raw handler. - UUIDv7 mandatory for all IDs (see
CLAUDE.md). Any comment suggestingrandomUUID()or auto-increment is invalid.
4. Present the assessment (before touching code)
## PR review assessment — #<PR_NUMBER>
### packages/.../file.ts:42 — <one-line gist>
Verdict: Valid & fix | Valid & skip | Invalid
Reason: <1–2 sentences>
Thread: <resolved | open>
...Group by file, ordered by line. Show all comments — including the ones you'd skip — so the user can override your call.
Ask the user to confirm which ones to fix. Don't auto-proceed.
5. Fix confirmed comments
For each approved "Valid & fix":
- Read the affected file fully. One-line changes in shared modules have non-obvious blast radius. Telemetry / chunker / indexer changes especially.
- Implement the fix. Match existing patterns — see
CLAUDE.mdfor the codebase's "Key patterns" section. - Update the test if behavior changed. A comment worth fixing is usually worth a regression test, especially for telemetry, chunking, search-result correctness, or SQL query semantics.
- No half-fixes. If the fix exposes another problem (e.g. an
ISoperator suggestion reveals the prepared statement has too many parameters), fix both — don't leave the file inconsistent.
6. Quality gate
Run the relevant subset, in roughly increasing cost:
yarn prettier:check # fast
yarn lint # fast
yarn workspace @paparats/<affected-pkg> typecheck
yarn workspace @paparats/<affected-pkg> testBefore pushing — full sweep:
yarn check && yarn testIf any quality gate fails, fix it before moving on. Never commit through a broken gate.
7. Reply + resolve each thread
Close the loop on GitHub. Always reply and resolve — never silent resolution, never resolve without replying.
Reply to inline review comment
REST endpoint, posts a reply in the same thread as the original comment:
gh api "repos/$OWNER/$REPO/pulls/$PR/comments/$COMMENT_ID/replies" \
-f body="Fixed in <commit-sha-short> — <one-sentence what changed>."$COMMENT_ID is the REST numeric id of the original comment (not your reply).
For Valid & skip / Invalid, reply with the reason: "Not applicable because…" / "Already handled by … in <file>:<line>."
Resolve the thread
Use the GraphQL threadId you correlated in step 2b:
gh api graphql -f query='
mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { isResolved }
}
}' -f threadId="$THREAD_ID"Reply to a general PR comment (step 2c)
There's no native thread / reply for issue-level comments. Either:
- Edit your follow-up commit message to reference it ("Addresses Gemini's note about X."), and skip the reply, or
- Post a top-level comment quoting the original:
> @<author> on <date>: …then your response.
There's nothing to "resolve" — issue comments don't have a resolution state.
8. Check and fix failing CI
gh pr checks "$PR"For each failing check:
# Extract run ID from the URL field of `gh pr checks --json`:
gh pr checks "$PR" --json name,state,link --jq '.[] | select(.state != "SUCCESS")'
# Then for each failing run:
RUN_ID=$(echo "$LINK" | grep -oE '[0-9]+$')
gh run view "$RUN_ID" --log-failedTriage each failure:
- PR-caused → fix the source file or update the test to match the new behavior. Verify locally with
yarn workspace @paparats/<pkg> test. - Pre-existing or flaky → note it in the hand-off; don't silence it. If it's a known-flaky test that's been red on main too, that's an infra problem, not this PR's job.
- Lockfile / dependency drift → run
yarn installlocally and commit the lockfile.
9. Hand off
Summarise in this shape:
## PR #<N> review handled
Fixed (N):
- <file:line> — <what changed> (commit <sha>)
...
Replied & resolved (N + M):
- N fixes + M skip/invalid
Skipped (M):
- <file:line> — <reason>
CI:
- ✅ <check> (fixed by <commit>)
- ⚠️ <check> (pre-existing on main, not this PR)
Outstanding:
- <anything that needs the user's eyes>Never commit or push for the user. Stage the changes; let them review and commit.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

