Approve a GitHub pull request, inferring the target from context when no PR is given. Use when the user invokes `$pr-approve`, asks to approve a PR, or approves a pull request mentioned earlier in the conversation.
95%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Approve a GitHub pull request via gh pr review --approve.
If a PR number, #1234, or URL was given directly, strip a leading # and use it as the sole candidate — skip inference.
Otherwise, gather candidates from context:
gh pr view --json number --jq .number 2>/dev/null#<number>, pull/<number> paths, or full github.com/.../pull/<number> URLs mentioned by the user or in prior output.Deduplicate the results.
gh pr view <number> --json number,url,title,state,isDraft,mergedAt,headRefName,baseRefName,author,reviewDecision,reviews,reviewRequests,statusCheckRollupGet the authenticated user's login once:
gh api user --jq .loginDerive per PR:
merged if mergedAt is set, else closed if state == "CLOSED", else open.approved by you / changes requested by you); else being in reviewRequests[] (waiting on your review); else reviewDecision == "APPROVED" (approved by others); else not requested.statusCheckRollup[], priority order: any failing conclusion → failing; any in-progress/queued status → running; any cancelled conclusion → cancelled; all success → passing; empty rollup → waiting.Single candidate — show the card and ask for a yes/no:
#<number> <title>
<state> · <my approval status> · <headRefName> → <baseRefName> · @<author> · checks <checks status>
<url>
Approve this PR?Multiple candidates — present each as #<number> <title> with the same detail line, and ask the user to pick one or more (multi-select). That selection is itself the confirmation — don't ask again.
If the user declines or picks nothing, stop without approving anything.
For each confirmed PR:
gh pr review <number> --approveIf gh refuses (self-authored PR, already approved, etc.), report that specific failure and continue with the rest.
✅ Approved PR #<number>
<pr_url>Report any failures separately with their reason instead of a ✅ line.
phatblat/dotfiles
4d65cab
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.