技能 编程开发 获取团队待审的GitHub PR请求

获取团队待审的GitHub PR请求

v20260423
gh-review-requests
该技能用于获取指定团队或团队成员需要进行评审的未合并GitHub拉取请求(PRs)。适用于需要查看团队待办的评审队列、查找需要关注的PR,或自动化代码评审流程的用户。需要配置GitHub CLI。
获取技能
128 次下载
概览

GitHub Review Requests

Fetch unread review_requested notifications for open (unmerged) PRs, filtered by a GitHub team.

Requires: GitHub CLI (gh) authenticated.

When to Use

  • You need to find unread GitHub PR review requests for a specific team.
  • You want to check which open PRs currently need your review or a teammate's review.
  • You need a filtered review queue instead of manually browsing GitHub notifications.

Step 1: Identify the Team

If the user has not specified a team, ask:

Which GitHub team should I filter by? (e.g. streaming-platform)

Accept either a team slug (streaming-platform) or a display name ("Streaming Platform") — convert to lowercase-hyphenated slug before passing to the script.

Step 2: Run the Script

uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_review_requests.py --org getsentry --teams <team-slug>

To filter by multiple teams, pass a comma-separated list:

uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_review_requests.py --org getsentry --teams <team slugs>

Script output

{
  "total": 3,
  "prs": [
    {
      "notification_id": "12345",
      "title": "feat(kafka): add workflow to restart a broker",
      "url": "https://github.com/getsentry/ops/pull/19144",
      "repo": "getsentry/ops",
      "pr_number": 19144,
      "author": "bmckerry",
      "reasons": ["opened by: bmckerry"]
    }
  ]
}

reasons will contain one or both of:

  • "review requested from: <Team Name>" — the team is a requested reviewer
  • "opened by: <login>" — the PR author is a team member

Step 3: Present Results

Display results as a markdown table with full URLs:

# Title URL Reason
1 feat(kafka): add workflow to restart a broker https://github.com/getsentry/ops/pull/19144 opened by: evanh

If total is 0, say: "No unread review requests found for that team."

Fallback

If the script fails, run manually:

gh api notifications --paginate

Then for each review_requested notification, check:

  • gh api repos/{repo}/pulls/{number} — skip if state == "closed" or merged_at is set
  • gh api repos/{repo}/pulls/{number}/requested_reviewers — check teams[].name
  • gh api orgs/{org}/teams/{slug}/members — check if author is a member

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
信息
Category 编程开发
Name gh-review-requests
版本 v20260423
大小 2.94KB
更新时间 2026-04-24
语言