fetch-pr-comments
БесплатноЗапускает вложенные скриптыНе проверен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…
от openshift-eng★ 123 звезды на GitHubОб этом скилле
Fetch PR Comments
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.
When to Use This Skill
Use this skill when you need to:
- Check a PR for new review comments that need attention
- Monitor a PR for feedback during an agentic workflow
- Build a review-response loop that only processes trusted feedback
- Fetch all actionable PR comments in a single call
Prerequisites
ghCLI: Authenticated withgh auth login- Repository read access: The token must have permission to read PR comments and check org membership
Implementation
Basic usage
result=$(bash "${CLAUDE_PLUGIN_ROOT}/skills/fetch-pr-comments/fetch_pr_comments.sh" \
--repo owner/repo \
--pr 123)
With custom trusted bots and exclusions
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")
Parameters
| 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) |
Output
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---"
}
}
Using in a polling loop
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
Using formatted output for Claude prompts
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')
How It Works
- Fetches from three GitHub API endpoints:
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 thread
- Identifies all unique comment authors
- Checks each author against the trusted bots list and org membership (
gh api orgs/{org}/members/{login}) - Filters comments to trusted authors only
- Excludes already-processed comment IDs
- Filters out APPROVED and PENDING reviews (no actionable content)
- Returns structured JSON with both raw data and pre-formatted text
Trust Model
A user is trusted if they match ANY of:
- Their login matches a
--trusted-botsentry (with or without[bot]suffix) - They are a member of the repository's GitHub organization
All other commenters are silently excluded.
See Also
- Related Skill:
check-pr-ci-status— Check CI status and detect new failures - Related Skill:
upload-screenshot— Upload images to GitHub for PR comments - Related Command:
/utils:address-reviews— Full review-addressing workflow
Установить fetch-pr-comments в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл fetch-pr-comments?
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.
Как установить скилл fetch-pr-comments?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл fetch-pr-comments запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic