跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

pr-comment-review

Audit and remediate an open GitHub PR's review feedback: verify Copilot and Codex actually reviewed, drive every unresolved thread to a fix-or-justify reply, correct PR title/description drift against the real diff, and run a one-time self-review pass. Trigger on "have all PR comments been addressed", "did copilot and codex review this", "reply to the PR comments", "address the PR feedback", "is this PR ready to merge", "clean up this PR before merging", "make sure nothing got missed on this PR" — and on generic "review comments" mentions, on single-bot mentions, and when prepping a new PR for review before comments exist. Not a fresh review of an unpushed working diff; that's `/code-review`.

anchildress1 · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add anchildress1/awesome-github-copilot --skill pr-comment-review

技能说明


status: polish name: pr-comment-review description: > Audit and remediate an open GitHub PR's review feedback: verify Copilot and Codex actually reviewed, drive every unresolved thread to a fix-or-justify reply, correct PR title/description drift against the real diff, and run a one-time self-review pass. Trigger on "have all PR comments been addressed", "did copilot and codex review this", "reply to the PR comments", "address the PR feedback", "is this PR ready to merge", "clean up this PR before merging", "make sure nothing got missed on this PR" — and on generic "review comments" mentions, on single-bot mentions, and when prepping a new PR for review before comments exist. Not a fresh review of an unpushed working diff; that's /code-review. argument-hint: "optional: PR number or URL (defaults to the PR for the current branch)" allowed-tools: Bash, Read, Edit, Write, Grep, Glob, Agent disable-model-invocation: false user-invocable: true

Remediation workflow for an existing PR. Bot threads rot: unresolved thread, PR merges, the "minor" finding was the real one. Every step below exists to close that gap.

GitHub MCP tools are preferred when loaded (ToolSearch("select:mcp__plugin_github_github__pull_request_read")); gh api equivalents are given inline.

1. Resolve the PR

Given a number/URL, use it. Otherwise:

gh pr view --json number,title,body,url,isDraft,baseRefName,headRefName

owner/repo come from whichever identified the PR. A supplied URL carries its own owner/repo — parse them from it, because the PR may live in a repo the current checkout isn't (same number, different repo, and every read and reply would land on a stranger's PR). Fall back to git remote -v (origin) only for a bare number or the current-branch case.

No open PR for the branch → say so and stop. Don't guess.

2. Confirm both required bots reviewed

  • Copilot: copilot-pull-request-reviewer[bot]
  • Codex: chatgpt-codex-connector[bot]
pull_request_read(method="get_reviews" | "get_comments", owner, repo, pullNumber)
# gh api --paginate repos/{owner}/{repo}/pulls/{pr}/reviews  |  .../issues/{pr}/comments

Read every page before concluding anyone is absent. gh api returns one page by default, so a bot that reviewed after 30 other events looks missing without --paginate; the MCP tool pages via perPage + the after cursor from pageInfo.

A missing bot is a diagnosis, not a shrug. Diagnose per bot — they have independent configurations, so one explanation rarely covers both:

  • Draft PR — check isDraft. This only explains Copilot if the repo has not enabled Review draft pull requests in its ruleset; with that on, a draft is no explanation at all and you need a different cause.

  • Pending — last push minutes ago; report the timestamp instead of "absent".

  • No prior review history — check whether the bot has ever commented on any PR here:

    gh api -X GET search/issues -f q="repo:{owner}/{repo} commenter:app/{bot-slug}" --jq '.total_count'
    

    -X GET is required — -f alone makes gh POST, and search answers with a bare 404 that reads like a missing repo. {bot-slug} is the login without the [bot] suffix.

    Report a 0 as "no prior comments in this repo" — never as "not installed". A freshly installed app, or one enabled before its first eligible PR, returns exactly the same 0, and calling that an installation problem sends the user to fix something that isn't broken.

    There is no user-token API that answers "is this app installed" (repos/{owner}/{repo}/installation needs a GitHub App JWT and returns 401 to gh auth credentials). A recent review on any PR here is the practical proof — a bot that answered yesterday is installed today.

    You can also check whether this bot was requested, but filter by who was requested — a bare count of review_requested events counts requests aimed at humans and at the other bot:

    gh api --paginate repos/{owner}/{repo}/issues/{pr}/timeline \
      --jq '[.[] | select(.event=="review_requested")
             | .requested_reviewer.login // .requested_team.name] '
    

    Read the result carefully in both directions:

    • Requested and silent, while it answered other PRs in minutes → installed and not delivering. A bot-side failure, worth saying plainly.
    • Never requested proves nothing on its own. Bots that review automatically never appear here at all — Copilot shows up because a ruleset requests it, while Codex triggers on PR open / ready-for-review / an @codex review comment and so leaves no request event.

    Before declaring any automatic reviewer broken, re-trigger it manually and time the response. Posting @codex review is the supported path, and a bot that answers a manual trigger in minutes after missing the automatic one has a trigger problem, not an install problem — a much more useful thing to tell the user. Send them to Settings → GitHub Apps only when nothing else explains it.

  • Other — state the evidence. Never "reason unclear"; if inconclusive, say what you checked and what came back, so the user doesn't re-derive it.

3. Drive every unresolved thread to a conclusion

pull_request_read(method="get_review_comments", owner, repo, pullNumber)

Returns review_threads[], each with is_resolved / is_outdated / is_collapsed and its comments — snake_case in the payload, even though the tool description spells them camelCase. Page with perPage + after until pageInfo.hasNextPage is false; an unresolved thread on page two counts exactly as much as one on page one.

The gh api fallback can't do this: REST /pulls/{pr}/comments returns flat comment records with no thread resolution state. If you're on the fallback path, get it from GraphQL:

gh api graphql -f query='query($o:String!,$r:String!,$n:Int!){repository(owner:$o,name:$r){
  pullReque
阅读完整来源 ↗