| name | pr-review |
| description | Find the PR for the current branch, check review comments, and address reviewer feedback by making code changes. Uses the `gh` CLI. |
PR Review Skill
Address PR review feedback for the current branch.
Workflow: Address Reviews
When asked to address PR reviews, follow this sequence:
1. Get PR context
gh pr view --json number,title,state,body,reviewDecision,headRefName,baseRefName,statusCheckRollup
2. Read unresolved review comments
Only fetch unresolved threads — ignore anything already resolved:
gh api graphql -f query='
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 100) {
nodes {
isResolved
comments(first: 10) {
nodes {
databaseId
author { login }
body
path
line
createdAt
diffHunk
}
}
}
}
}
}
}
' -f owner="{owner}" -f repo="{repo}" -F pr=<number> --jq '
.data.repository.pullRequest.reviewThreads.nodes[]
| select(.isResolved == false)
| .comments.nodes[]
| "ID: \(.databaseId)\nFile: \(.path):\(.line // "?")\nAuthor: \(.author.login) (\(.createdAt | split("T")[0]))\n\(.diffHunk | split("\n") | .[-3:] | map(" │ \(.)") | join("\n"))\n💬 \(.body)\n"
'
3. Check changed files
gh pr view --json files --jq '.files[] | "\(.status) +\(.additions) -\(.deletions) \(.path)"'
4. Read diff for context
gh pr diff
gh pr diff | awk '/^diff --git.*<file>/{show=1} /^diff --git/ && !/'"<file>"'/{show=0} show'
5. Make the code changes
Read the files mentioned in review comments and address the feedback.
6. Commit and push
Write a commit message that describes what actually changed, not just "address review feedback".
git add -A && git commit -m "Refactor auth middleware to validate tokens before routing" && git push
7. Resolve or reply to comments
For each review comment, decide based on whether action was taken:
If code changes were made to address the comment — resolve the thread silently (no reply needed). Find the thread ID and resolve it:
gh api graphql -f query='
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 1) {
nodes {
databaseId
}
}
}
}
}
}
}
' -f owner="{owner}" -f repo="{repo}" -F pr=<number>
Then resolve the thread using its GraphQL node ID:
gh api graphql -f query='
mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { isResolved }
}
}
' -f threadId="<thread-node-id>"
If no action was taken (e.g., disagree, out of scope, already handled, intentional) — reply explaining why:
gh api "repos/{owner}/{repo}/pulls/<number>/comments/<comment-id>/replies" -f body="<explanation of why no action was taken>"
8. Verify CI
gh pr checks
Top-level review summaries
gh api "repos/{owner}/{repo}/pulls/<number>/reviews" --jq '.[] | select(.state != "COMMENTED") | "[\(.state)] \(.user.login): \(.body)"'