Review & Resolve PR Comments

VerifiedCaution

Fetch unresolved review comments on a PR, assess each, apply fixes, and resolve threads using the GitHub API.

Sby Skills Guide Bot
DevelopmentIntermediate
7/22/2026
Claude CodeCursorCodex
#pull-request#code-review#github-cli#graphql#workflow

Recommended for

Automated summary

Fetches every unresolved review thread on a GitHub pull request, assesses each comment, applies fixes where needed, and resolves the addressed threads through the GitHub API.

Strengths

  • Uses the paginated GraphQL API instead of the REST endpoint, whose output can be truncated
  • Auto-detects the PR from the current branch and switches the gh account when the repo owner differs from the active user
  • Re-reads the code at each commented line and handles outdated threads before deciding on an action
  • Sorts feedback into three buckets and asks the user whenever a decision is genuinely ambiguous

Limitations

  • Assumes gh is installed and authenticated with write access to the repository
  • Works only on GitHub (no GitLab or Bitbucket support)
  • Resolving a thread mutates PR state on GitHub, and the skill does not describe verifying that the fixes build or pass tests
When to use it

Use it when a GitHub PR has piled up review comments that need to be handled and their threads closed out one by one.

When not to use it

Don't use it to write an initial code review, or on any platform other than GitHub.

Security analysis

Caution
Quality score78/100

The skill uses powerful but legitimate tooling — the GitHub CLI, GraphQL mutations, git commit/push — to fix review comments on the user's own PR. There is no destructive filesystem action, no obfuscated payload, and no network exfiltration of secrets or tokens. The main risks are operational rather than malicious: it pushes commits and resolves/posts comments on a live PR without an explicit confirmation step, and its `gh auth switch` is only reverted on the success path, so a failure can leave the user's CLI pointed at another account. That warrants a caution rating rather than safe.

Findings
  • •Runs `git push` to the remote without asking the user for confirmation (Step 6)
  • •Mutates global GitHub CLI auth state via `gh auth switch --user <OWNER>` and restores it only on the happy path — if any step fails mid-way the user is left on a different account
  • •Automatically resolves reviewer threads and posts reply comments on a real PR, which can silently dismiss a reviewer's concerns
  • •Assumes `gh` is authenticated with sufficient scope; no permission/safety check stated before mutating a live PR
How this analysis is made

Examples

Address comments on a PR number
Address the review comments on PR #412 and resolve the threads you fix.
Auto-detect the PR for the current branch
Check the open comments on my PR and fix whatever still needs fixing.
Resolve threads from a URL
Resolve the review threads on https://github.com/acme/api/pull/88

name: review-pr-comments description: > Check a PR for unresolved review comments, assess each one, apply fixes where needed, and resolve addressed threads via the GitHub API. Use this skill whenever the user mentions PR comments, review threads, unresolved feedback, or addressing reviewer suggestions — even if they just say "fix the comments", "close out the review threads", or "address the feedback".

Review & Resolve PR Comments

Fetch every unresolved review thread on a PR, decide for each whether a code fix is needed, apply the fix (or confirm it's already done), then resolve the thread via gh GraphQL. Ask the user whenever a decision is genuinely ambiguous.

When to Use This Skill

  • User says "address the PR comments" or "fix the review comments"
  • User says "resolve comments on PR #N" or pastes a PR URL
  • User says "check the open comments on my PR"

Steps

Execute in order. Stop and report if any step fails.

Step 1: Identify the PR

If the user provided a PR number or URL, extract the number.

Otherwise, try to detect the PR automatically from the current branch/worktree:

gh pr view --json number,url,headRefName 2>/dev/null

If that returns a PR, use it and inform the user which PR was detected (number

  • title) before continuing.

If no PR is found automatically, ask:

Which PR number (or URL) should I review?

Derive OWNER, REPO, PR_NUMBER from the URL or from the current repo's git remote get-url origin. Handle both HTTPS (https://github.com/OWNER/REPO.git) and SSH (git@github.com:OWNER/REPO.git) remote formats.

Step 2: Switch gh to the repo owner account (if needed)

Extract the currently active GitHub username:

gh api user --jq '.login'

If that username does not match OWNER (derived in Step 1), switch:

gh auth switch --user <OWNER>

Note the original username so you can restore it at the end. Do NOT rely on gh auth status to determine the active user — its output format is harder to parse reliably. Use gh api user --jq '.login' instead.

Step 3: Fetch ALL unresolved review threads

Use the GitHub GraphQL API to get every thread — paginate if needed. The REST endpoint can truncate output; always use GraphQL:

gh api graphql -f query='
{
  repository(owner:"OWNER", name:"REPO") {
    pullRequest(number:PR_NUMBER) {
      reviewThreads(first:100) {
        nodes {
          id
          isResolved
          isOutdated
          comments(first:20) {
            nodes {
              databaseId
              path
              line
              body
            }
          }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[]
         | select(.isResolved == false)
         | {
             threadId: .id,
             outdated: .isOutdated,
             commentId: .comments.nodes[0].databaseId,
             path: .comments.nodes[0].path,
             line: .comments.nodes[0].line,
             body: .comments.nodes[0].body
           }'

Record the full list. If there are zero unresolved threads, report that and stop.

Step 4: Read the current file for each thread

For every unresolved thread, read the relevant file at the commented line to understand the current state of the code:

  • If the thread is outdated (isOutdated: true), the code has already changed. Read the file to confirm the concern is addressed.
  • If the thread is not outdated (isOutdated: false), the commented line still exists. Read it and decide:
    • Is the issue already fixed (e.g. a test was added in a new file, or the change was applied elsewhere)?
    • Does it still need a fix?
    • Is the suggestion wrong / inapplicable (stale logic, wrong assumption)?

Step 5: Triage each thread

Categorise every thread into one of three buckets:

| Bucket | Meaning | Action | | ------------------ | ------------------------------------------------------------- | --------------------------------------- | | already-fixed | The code concern is addressed; comment is just not resolved | Resolve the thread, no code change | | needs-fix | The issue is real and present in the current code | Apply the fix, then resolve | | not-applicable | The suggestion is wrong, stale, or intentionally not followed | Post a reply explaining why, then resolve |

When in doubt, pause and ask the user before placing a thread in any bucket. Never silently skip a thread.

Step 6: Apply fixes

For threads in the needs-fix bucket:

  1. Make the minimal correct change to the file.
  2. Build and run tests using the project's standard commands (e.g. pnpm build and pnpm vitest run for pnpm projects; npm test or yarn test for others — check package.json scripts if unsure) to confirm nothing breaks.
  3. If tests fail, fix them or pause and ask the user.
  4. Commit the fix:
git add <files>
git commit -m "fix: <short description of what was fixed>

Addresses PR review comment: <comment body summary>"
git push

Collect the thread IDs of all fixed threads.

Step 7: Resolve threads

For threads in not-applicable, first post a reply comment explaining why the suggestion wasn't followed, so the reviewer isn't left wondering:

gh api repos/OWNER/REPO/pulls/PR_NUMBER/comments \
  --method POST \
  -f in_reply_to=COMMENT_DATABASE_ID \
  -f body="<brief explanation: e.g. 'This is intentional — X because Y'>"

Then, for every thread in already-fixed, needs-fix (now fixed), and not-applicable, resolve via GraphQL:

gh api graphql -f query="
  mutation {
    resolveReviewThread(input: {threadId: \"THREAD_ID\"}) {
      thread { isResolved }
    }
  }
" --jq '.data.resolveReviewThread.thread.isResolved'

Verify the result is true before moving to the next thread.

Step 8: Restore original gh account

If the active account was switched in Step 2, restore it:

gh auth switch --user <ORIGINAL_ACCOUNT>

Step 9: Report

Summarise what was done:

  • How many threads were found
  • How many were already-fixed (just resolved)
  • How many needed and received a fix
  • How many were not-applicable (resolved with explanation)
  • Any that were skipped pending user input (list them explicitly)

Important Notes

  • Never resolve a thread without first confirming the underlying concern is addressed — either in the current code or with a new commit.
  • Outdated ≠ resolved. An outdated thread may still represent a real issue in refactored code.
  • Ask the user for anything that involves a design choice, trade-off, or intentional deviation from the reviewer's suggestion.
  • This skill resolves threads under the repo owner's account. Always restore the original gh account at the end.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/review-resolve-pr-comments-mrwakdha' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/review-resolve-pr-comments-mrwakdha/download' --output '.skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md.part' && mv '.skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md.part' '.skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md' && test -s '.skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/review-pr-comments' && cp -R '.skill-downloads/review-resolve-pr-comments-mrwakdha' '.claude/skills/review-pr-comments'

Cursor
test -f '.skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md' && test -s '.skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/review-pr-comments' && cp -R '.skill-downloads/review-resolve-pr-comments-mrwakdha' '.cursor/skills/review-pr-comments'

Codex
test -f '.skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md' && test -s '.skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/review-pr-comments' && cp -R '.skill-downloads/review-resolve-pr-comments-mrwakdha' '.agents/skills/review-pr-comments'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/review-resolve-pr-comments-mrwakdha'

openskills read 'review-resolve-pr-comments-mrwakdha'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/review-resolve-pr-comments-mrwakdha/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills