| name | description |
|---|---|
review_pr_comments |
This prompt is used to review comments on an active pull request and decide whether to accept, iterate, or reject the changes suggested in each comment. |
We have received comments on the current active pull request. Together, we will go through each comment one by one and discuss whether to accept the change, iterate on it, or reject the change.
- Fetch the active pull request: If available, use the
activePullRequesttool from theGitHub Pull Requeststoolset to get the details of the active pull request including the comments. If not, use the GitHub MCP server or GitHub CLI to get the details of the active pull request. Fetch both top level comments and inline comments. - Present a list of the comments with a one-sentence summary of each.
- One at a time, present each comment in full detail and ask me whether to accept, iterate, or reject the change. Provide your recommendation for each comment based on best practices, code quality, and project guidelines. Await user's decision before proceeding to the next comment. DO NOT make any changes to the code or files until I have responded with my decision for each comment.
- If the decision is to accept or iterate, make the necessary code changes to address the comment. If the decision is to reject, provide a brief explanation of why the change was not made.
- Wait for user to affirm completion of any code changes made before moving to the next comment.
- Reply to each comment on the pull request with the outcome of our discussion (accepted, iterated, or rejected) along with any relevant explanations.
This guide explains how to reply directly to inline review comments on GitHub pull requests.
To reply to an inline PR comment, use:
POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/repliesWith body:
{
"body": "Your reply message"
}gh api repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies \
-X POST \
-f body="Your reply message"-
Get PR comments: First fetch the PR review comments to get their IDs:
gh api repos/{owner}/{repo}/pulls/{pull_number}/comments -
Identify comment IDs: Each comment has an
idfield. For threaded comments, use the root comment'sid. -
Post replies: For each comment you want to reply to:
gh api repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies \ -X POST \ -f body="Fixed in commit abc123"
For accepted changes:
- "Fixed in {commit_sha}"
- "Accepted - fixed in {commit_sha}"
For rejected changes:
- "Rejected - {reason}"
- "Won't fix - {explanation}"
For questions:
- "Good catch, addressed in {commit_sha}"
- The
comment_idis the numeric ID from the comment object, NOT thenode_id - Replies appear as threaded responses under the original comment
- You can reply to any comment, including bot comments (like Copilot reviews)
To resolve (mark as resolved) PR review threads, use the GraphQL API:
-
Get thread IDs: Query for unresolved threads:
gh api graphql -f query=' query { repository(owner: "{owner}", name: "{repo}") { pullRequest(number: {pull_number}) { reviewThreads(first: 50) { nodes { id isResolved comments(first: 1) { nodes { body path } } } } } } }'
-
Resolve threads: Use the
resolveReviewThreadmutation:gh api graphql -f query=' mutation { resolveReviewThread(input: {threadId: "PRRT_xxx"}) { thread { isResolved } } }'
-
Resolve multiple threads at once:
gh api graphql -f query=' mutation { t1: resolveReviewThread(input: {threadId: "PRRT_xxx"}) { thread { isResolved } } t2: resolveReviewThread(input: {threadId: "PRRT_yyy"}) { thread { isResolved } } }'
The thread ID starts with PRRT_ and can be found in the GraphQL query response.
Note: This skill can be removed once the GitHub MCP server has added built-in support for replying to PR review comments and resolving threads. See: github/github-mcp-server#1323 github/github-mcp-server#1768