Post PR Review
This skill posts a GitHub PR review. All feedback must already be collected and agreed upon before invoking this skill.
Rules — follow these exactly, no exceptions
Never post inline comments before the review is ready. This skill is the signal that the review is ready to post. Do not post anything until the user invokes it.
Ask whether to include a summary comment (
body). If the user wants one, draft it and present for explicit approval before posting. Do not auto-generate a summary. The summary is posted under the user's name and must reflect their voice and accurately represent the severity of findings. If no summary is needed, use an empty string for thebodyfield.Always post everything as a single API call using
gh api repos/{owner}/{repo}/pulls/{number}/reviewswith a JSON body that includes the summarybody, theeventfield, and all inlinecommentsin one array. Never post inline comments separately via/pulls/{number}/comments— that creates multiple disconnected review entries.Use
--input -with a heredoc to pass the full JSON payload, not individual--fieldarguments. This is the only reliable way to include multiple inline comments in a single call.Verify the result by checking that only one new review ID appears and that its
statematches the intended event (e.g.CHANGES_REQUESTED).
Template
gh api repos/{owner}/{repo}/pulls/{number}/reviews \
--method POST \
--input - <<'EOF'
{
"commit_id": "{full_sha}",
"event": "REQUEST_CHANGES",
"body": "{summary comment}",
"comments": [
{
"path": "{file path}",
"line": {line number},
"side": "RIGHT",
"body": "{inline comment text}"
}
]
}
EOF
Valid values for event: REQUEST_CHANGES, APPROVE, COMMENT.
If something goes wrong
If comments landed as separate reviews by mistake:
- Delete each inline comment via
DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} - Dismiss the bad review via
PUT /repos/{owner}/{repo}/pulls/{number}/reviews/{review_id}/dismissals - Note: GitHub does not allow deleting submitted reviews, only dismissing them — dismissed reviews remain visible in the PR timeline
- Repost using the template above