Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

  1. gh CLI: Authenticated with gh auth login
  2. 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

  1. Fetches from three GitHub API endpoints:
    • repos/{repo}/pulls/{pr}/comments — inline code review comments
    • repos/{repo}/pulls/{pr}/reviews — review summaries (CHANGES_REQUESTED, etc.)
    • repos/{repo}/issues/{pr}/comments — PR conversation thread
  2. Identifies all unique comment authors
  3. Checks each author against the trusted bots list and org membership (gh api orgs/{org}/members/{login})
  4. Filters comments to trusted authors only
  5. Excludes already-processed comment IDs
  6. Filters out APPROVED and PENDING reviews (no actionable content)
  7. 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-bots entry (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
Полный SKILL.md на GitHub

Установить fetch-pr-comments в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

fetch_pr_comments.sh

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить fetch-pr-comments с