plugins/github/skills/fetch-pr-comments/SKILL.md
Fetch new review comments from a GitHub PR, filtered to trusted users (org members + allowed bots). Use when monitoring a PR for feedback, checking for new review comments, or building a review-response workflow.
npx skillsauth add openshift-eng/ai-helpers fetch-pr-commentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch all comments from a GitHub pull request, filtered to trusted users only. Trusted users are GitHub org members and explicitly allowed bots. Untrusted comments are silently excluded.
This skill fetches from all three GitHub comment endpoints (inline review comments, review summaries, and PR conversation comments), providing a complete picture of PR feedback.
Use this skill when you need to:
gh CLI: Authenticated with gh auth loginresult=$(bash "${CLAUDE_PLUGIN_ROOT}/skills/fetch-pr-comments/fetch_pr_comments.sh" \
--repo owner/repo \
--pr 123)
result=$(bash "${CLAUDE_PLUGIN_ROOT}/skills/fetch-pr-comments/fetch_pr_comments.sh" \
--repo owner/repo \
--pr 123 \
--trusted-bots "coderabbitai,dependabot" \
--exclude-ids "12345,67890")
| Parameter | Required | Description |
|-----------|----------|-------------|
| --repo | Yes | GitHub repository in owner/repo format |
| --pr | Yes | Pull request number |
| --trusted-bots | No | Comma-separated bot logins to trust (default: coderabbitai) |
| --exclude-ids | No | Comma-separated comment IDs to skip (already processed) |
JSON on stdout:
{
"inline_comments": [
{"id": "123", "user": "reviewer", "path": "pkg/server.go", "body": "This needs a nil check"}
],
"reviews": [
{"id": "456", "user": "reviewer", "state": "CHANGES_REQUESTED", "body": "See inline comments"}
],
"issue_comments": [
{"id": "789", "user": "coderabbitai[bot]", "body": "Static analysis found..."}
],
"all_ids": ["123", "456", "789"],
"total": 3,
"formatted": {
"inline": "**reviewer** on `pkg/server.go`:\nThis needs a nil check\n---",
"reviews": "**reviewer** (CHANGES_REQUESTED):\nSee inline comments\n---",
"issue_comments": "**coderabbitai[bot]**:\nStatic analysis found...\n---"
}
}
The all_ids and --exclude-ids fields enable stateful polling across iterations:
PROCESSED_IDS=""
while true; do
sleep 300
result=$(bash "${CLAUDE_PLUGIN_ROOT}/skills/fetch-pr-comments/fetch_pr_comments.sh" \
--repo owner/repo --pr 123 --exclude-ids "$PROCESSED_IDS")
total=$(echo "$result" | jq -r '.total')
if [[ "$total" -gt 0 ]]; then
# Process comments...
new_ids=$(echo "$result" | jq -r '.all_ids | join(",")')
PROCESSED_IDS="${PROCESSED_IDS:+$PROCESSED_IDS,}$new_ids"
fi
done
The formatted fields provide ready-to-use text:
inline=$(echo "$result" | jq -r '.formatted.inline')
reviews=$(echo "$result" | jq -r '.formatted.reviews')
issue_comments=$(echo "$result" | jq -r '.formatted.issue_comments')
repos/{repo}/pulls/{pr}/comments — inline code review commentsrepos/{repo}/pulls/{pr}/reviews — review summaries (CHANGES_REQUESTED, etc.)repos/{repo}/issues/{pr}/comments — PR conversation threadgh api orgs/{org}/members/{login})A user is trusted if they match ANY of:
--trusted-bots entry (with or without [bot] suffix)All other commenters are silently excluded.
check-pr-ci-status — Check CI status and detect new failuresupload-screenshot — Upload images to GitHub for PR comments/utils:address-reviews — Full review-addressing workflowtools
Analyze a JIRA issue and create a pull request to solve it. Use when the user wants to implement a fix or feature described in a Jira issue, push a branch, and open a draft PR.
development
Use when a deeper level of code review is requested. Multi-agent panel code review with specialist reviewers and forced runtime reproducers for all BLOCKING bug findings. Optionally posts to GitHub/GitLab as a PENDING review.
development
Review agentic documentation — verify claims locally against source code first, then use chai-bot for cross-repo and cross-functional verification
development
Use this skill when debugging a failed Prow CI job.