verify-pr
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
Context
Repository: !gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "unknown"
Default branch: !git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@refs/remotes/origin/@@' || echo main
Current branch: !git branch --show-current 2>/dev/null
Instructions
Verify a GitHub PR multi-dimensionally (claim-driven and necessity-driven, not opinion-driven like generic /review; for issue verification use /verify-issue, for comment triage use /verify-pr-comments). Execute immediately without asking. Judge two things, in order:
- Should this PR exist at all? Necessity and authenticity: is the problem real, is the value already delivered elsewhere, does it duplicate existing code or another PR, and does its description honestly match what it ships? A flawless PR can still not warrant merging; necessity gates the verdict.
- Does it achieve what it claims? Correctness, tests, conventions, side effects.
Process
-
Fetch PR state (the leading positional of
$ARGUMENTSis a PR number like4020or a full GitHub PR URL):gh pr view <num> --json number,title,body,headRefName,baseRefName,headRefOid,mergeable,mergeStateStatus,statusCheckRollup,reviews,comments,additions,deletions,files, thengh pr diff <num>for the patch. Parse the body for linked issues (Closes #X,Fixes #X, bare#XXXXreferences). KeepheadRefOid: the report ends with it, so a later pass can scope itself to whatever lands after this one.Incremental re-verification (
--since <sha>): a PR under review is re-read every time its author pushes, and re-analyzing the whole patch each round costs enough that the re-read quietly gets skipped, which is the failure this exists to prevent. Given--since <sha>, the step 4 dimensions judgegit diff <sha>..<head>(withgit log --oneline <sha>..<head>for what landed) instead of the full patch, while the full-PR state from this step still loads as context. Necessity stays judged against the whole PR and is never re-derived from the delta, since a clean delta can still belong to a PR that should not exist. Confirm<sha>is an ancestor of the head (git merge-base --is-ancestor <sha> <head>); if it is not, a force-push rewrote the range, so say so and fall back to the full patch rather than reporting on a diff that does not mean what it claims.