com um clique
review-pr
Conduct a comprehensive PR review and return an interactive review board
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Conduct a comprehensive PR review and return an interactive review board
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Systematically collect, analyze, score, and address pull request review feedback, then post reply comments
Google Calendar: Manage calendars and events.
Google Drive: Manage files, folders, and shared drives.
Gmail: Send, read, and manage email.
Manage Google Meet conferences.
Google Tasks: Manage task lists and tasks.
| name | review-pr |
| description | Conduct a comprehensive PR review and return an interactive review board |
| disable-model-invocation | true |
| arguments | ["pr-url"] |
| argument-hint | <github-pr-url> |
| allowed-tools | ["ExitPlanMode","Workflow","AskUserQuestion","Bash(git diff *)","mcp__plugin_github_github__pull_request_read","mcp__plugin_github_github__pull_request_review_write","mcp__plugin_github_github__add_comment_to_pending_review","mcp__plugin_github_github__add_reply_to_pull_request_comment","mcp__plugin_golang_gopls__go_diagnostics","mcp__plugin_golang_gopls__go_file_context","mcp__plugin_golang_gopls__go_package_api","mcp__plugin_golang_gopls__go_search","mcp__plugin_golang_gopls__go_symbol_references","mcp__plugin_golang_gopls__go_vulncheck","mcp__plugin_golang_gopls__go_workspace"] |
git remote get-url origin 2>/dev/null || echo __NO_ORIGIN_REMOTE__bash "${CLAUDE_SKILL_DIR}/scripts/checkout.sh" "$pr-url"Use only allowed-tools. Do not generate ad-hoc processing scripts. Workflow
return values and MCP responses are structured JSON; read them directly. Bash is
limited to the git patterns in allowed-tools for diff collection and
line-number translation below.
The workflow and its agents are read-only — they must not call GitHub write tools.
GitHub write tools may be used only after an exact preview and explicit final posting approval from the user.
If plan mode is active, call ExitPlanMode now before proceeding. The workflow
and its tool calls require manual mode to avoid unwanted permission prompts.
Parse $pr-url to extract owner, repo, and PR number from:
https://github.com/{owner}/{repo}/pull/{number}
Call pull_request_read with method get. Extract and record:
headSha: the current head commit SHA of the PRchangedFiles: the number of changed fileshttps://github.com/{owner}/{repo})Read the Checkout output from Git Environment above.
CHECKOUT_SKIP: → record the reason as fallbackReason, skip to workflow
launch without localGitManifest or fullDiff.
CHECKOUT_OK → parse mergeCommit, baseSha, headSha from the subsequent
key value lines. Then:
headSha matches PR metadata headSha. Mismatch → record "HEAD^2
does not match PR headSha". Do not trust local diff data on mismatch.{owner}/{repo} (strip protocol, .git suffix; case-insensitive).
Mismatch → "origin does not match PR base repository".Parse the NAME_STATUS and NUMSTAT sections from the checkout output.
From NAME_STATUS, parse each line into {path, status}. Map A, M, D,
R*, C* to added, modified, deleted, renamed, copied. For renames
and copies, use the destination path.
From NUMSTAT, parse additions and deletions per file and merge with the status
list. For renames/copies use destination path as key. Binary files show - for
additions/deletions; store as 0. Each entry: {path, status, additions, deletions}.
The resulting array is the localGitManifest.
If the manifest was built, collect the full merge diff:
git diff --no-ext-diff --no-textconv HEAD^1 HEAD
Store as fullDiff if 200,000 characters or fewer; otherwise omit.
Invoke the Workflow tool with:
scriptPath: ${CLAUDE_SKILL_DIR}/review-pr.jsargs: owner, repo, pullNumber, localGitManifest (omit if preflight
failed), fullDiff (omit if not collected), and sources:
mergeCommit, baseSha, headSha (empty strings if preflight failed)fullDiffIncluded: whether fullDiff is includedfallbackReason: reason preflight failed (or empty string)The workflow collects PR metadata via MCP, runs specialist analysis, fetches review threads, and returns grouped findings with review metadata.
Present the review board before drafting or posting anything. Use this order:
Format: owner/repo#number — PR title
Below the heading, include a one-line summary with section counts derived from section array lengths:
N findings recommended, M overlap existing threads, P discussion-worthy.
Reviewers: code-reviewer, pr-test-analyzer, silent-failure-hunter.
The reviewer list comes from reviewMeta.selectedReviewers which stores full
agent names.
For each finding, include:
Same fields as recommended, plus existing review overlap rationale.
Same fields as recommended; rationale explains why not recommended to post.
One line per finding: id — title (covered by thread on path:line).
One line per finding: id — title (reason).
List positive observations when present.
After presenting the board, propose a recommended action based on board state
using AskUserQuestion with contextual options.
Write a brief assessment of the recommended findings and any notable overlaps, then offer options:
The user may type free-form text via Other (e.g., "Tell me more about F3"). Respond accordingly and loop back to updated options.
Draft comments only in the conversation. Drafts should:
Draft relatedToExisting findings as thread replies: acknowledge the original
comment, add the new perspective, and avoid restating the concern.
Prefer line comments for findings with a concrete changed-file location. Put findings without a valid line location in the review body.
Choose the proposed review event from the selected findings:
REQUEST_CHANGES only when at least one selected finding is a serious
correctness or blocking concern.COMMENT for non-blocking feedback, suggestions, endorsements, or discussion.APPROVE when the user selected "Leave an approving review" from the
nothing-postable menu and no findings are being posted.Skip this section if MCP fallback was used (no local checkout) — findings already use PR HEAD line numbers.
Findings use merge-result line numbers. GitHub requires PR HEAD (HEAD^2)
line numbers. Translate before posting.
git diff --name-only HEAD^2 HEAD
No output → lines are identical, skip translation.
For each finding on a file listed above:
git diff HEAD^2 HEAD -- <path>.+-only line (no PR HEAD equivalent),
move the finding to the review body.- lines from the hunk's PR HEAD start (a in
@@ -a,b +c,d @@).offset += (b - d) per @@ -a,b +c,d @@.
PR_HEAD_line = merge_line + offset.pull_request_read get_files). If not, move to review body.Files absent from the diff output have identical line numbers — use as-is.
Before posting, show an exact preview.
For each finding being posted as a new line comment, show:
For each overlap finding being posted as a thread reply, show:
⚠ Target thread is resolved — reply will stay collapsed and the PR author may not see it.For review body text (non-line findings), show the review body.
Show the proposed review event: COMMENT, REQUEST_CHANGES, or APPROVE.
After the preview, ask for explicit approval with AskUserQuestion. Use the
preview field on each option so the reviewer can attach free-text notes to
their selection (e.g., specifying exactly what to edit):
Accept approval only when the user selects "Post this review" or clearly confirms posting. If the user requests edits or removals, update the preview and ask for approval again.
Use GitHub write tools only in this final approved step.
If the approved preview has new line comments:
mcp__plugin_github_github__pull_request_review_write.mcp__plugin_github_github__add_comment_to_pending_review.mcp__plugin_github_github__pull_request_review_write using the approved
event and review body.Post overlapping findings as replies using
add_reply_to_pull_request_comment with the numeric commentId and
pullNumber. If commentId is missing or invalid, post as a new line comment
via the pending review flow instead. Thread replies are independent of the
pending review submission.
If the approved preview has only review-body text, submit the review body with
mcp__plugin_github_github__pull_request_review_write using the approved event.
If a line comment cannot be added because the location is invalid for the PR diff, move that text into the review body, show the revised preview, and ask for approval again before posting.