.pi/skills/reject-pr/SKILL.md
Reject the pull request for the branch that is currently checked out. This skill
is meant to be run right after review-pr in the same conversation: it takes
the review you just produced and turns it into a blocking change-request on the
PR. Do not re-review here — post the existing review.
Actions performed, in order:
READY label.The body you post is the most recent review-pr report in this conversation
(its Critical / Moderate / Minor / Coverage map / Summary output).
/skill:review-pr first — do not fabricate a review.Auto-detect the PR from the checked-out branch. An explicit PR number/URL in the arguments overrides detection.
PR='<explicit PR number/URL from arguments, else empty>'
[ -z "$PR" ] && PR=$(gh pr view --json number -q .number 2>/dev/null)
if [ -z "$PR" ]; then
echo "No PR found for the current branch. Run 'gh pr checkout <n>' or pass a PR number."; exit 1
fi
gh pr view "$PR" --json number,title,author,headRefName,url,state,labels
AUTHOR=$(gh pr view "$PR" --json author -q .author.login)
echo "Rejecting PR #$PR by @$AUTHOR"
State one line to the user: which PR (#number — title) and author you are about
to reject, then proceed.
Write the review body to /tmp/reject-pr-$PR.md using the write tool (never
inline it into a shell command — reviews contain backticks, quotes, and $ that
break shell quoting). The first line must mention the author:
@<AUTHOR>
<the full verbatim review-pr report>
gh pr review "$PR" --request-changes --body-file /tmp/reject-pr-$PR.md
# Clear the READY label only if present (avoids a spurious error).
if gh pr view "$PR" --json labels -q '.labels[].name' | grep -qx "READY"; then
gh pr edit "$PR" --remove-label "READY"
fi
Notes:
gh pr review --request-changes fails for that reason, fall back to
gh pr comment "$PR" --body-file /tmp/reject-pr-$PR.md, tell the user the PR
could not be moved to "changes requested" because it is self-authored, and
still clear the READY label.Report back in one or two lines:
READY label was removed or was already absent.