con un clic
review-pr-comments
// Review and triage PR review comments on the current branch — groups threads by file, separates bots from humans, walks through unresolved comments interactively
// Review and triage PR review comments on the current branch — groups threads by file, separates bots from humans, walks through unresolved comments interactively
Generate the Agent Supply Chain newsletter by researching team activity on GitHub and Confluence, then creating a Confluence draft and Gmail draft
Explains a lading.yaml config file from the regression test suite, using the lading Rust source as ground truth for field meanings and defaults.
Give your AI agents something more useful than a prompt. Velocity through clarity.
Create a pull request for the current branch with proper labels and description
Create a new Fx component using the modern def/fx/impl pattern (NOT legacy)
Add a new configuration field to the Datadog Agent (datadog.yaml)
| name | review-pr-comments |
| description | Review and triage PR review comments on the current branch — groups threads by file, separates bots from humans, walks through unresolved comments interactively |
Fetch, summarize, and interactively triage review comments on the PR for the current git branch.
gh CLI authenticated with access to the repositorymain or a release branch like N.N.x)BRANCH=$(git branch --show-current)
Guard: skip if branch is main, master, or matches release pattern ^\d+\.\d+\.x$.
Find the PR:
gh pr list --head "$BRANCH" --json number,title,url,state --limit 5
If no PR found, inform the user and stop.
Run these three gh api calls in parallel:
# Review comments (inline code comments)
gh api repos/{owner}/{repo}/pulls/{PR_NUMBER}/comments --paginate \
--jq '.[] | {id, path, line, body, user: .user.login, created_at, in_reply_to_id, diff_hunk}'
# Top-level reviews (approval/request-changes status + body)
gh api repos/{owner}/{repo}/pulls/{PR_NUMBER}/reviews --paginate \
--jq '.[] | {id, user: .user.login, state, body}'
# Issue-level comments (general PR discussion, CI bot reports)
gh api repos/{owner}/{repo}/issues/{PR_NUMBER}/comments --paginate \
--jq '.[] | {id, user: .user.login, body, created_at}'
Extract {owner} and {repo} from gh repo view --json owner,name.
Group review comments into conversation threads using in_reply_to_id:
in_reply_to_id: null starts a new threadFor each thread, track:
Separate into two groups:
Bot comments (user login ends with [bot] or is a known CI bot):
Human reviewer comments:
For each unresolved human reviewer comment thread:
Options:
- "Fix" → Apply the proposed code change
- "Reply" → Post a reply comment on the PR via gh api
- "Reply with custom message" → Ask user for reply text, then post
- "Add TODO" → Add a TODO item to track for later
- "Skip" → Move to next comment
For already-resolved threads (PR author replied last), present them as a summary group:
Fix: Edit the file, show the diff to the user. Do NOT commit automatically.
Reply: Post via gh API:
gh api repos/{owner}/{repo}/pulls/{PR_NUMBER}/comments \
-f body="$REPLY_TEXT" -f in_reply_to=$COMMENT_ID
TODO: Use the TodoWrite tool to track it.
After processing all comments, output a summary table:
| # | File | Reviewer | Action Taken |
|---|------|----------|--------------|
| 1 | path/to/file.go:42 | reviewer1 | Fixed |
| 2 | path/to/other.py:10 | reviewer2 | Replied |
| 3 | path/to/build.bzl:5 | reviewer3 | Skipped (already resolved) |