Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

address-comments

FreeNo executable scriptsNot checked

Walk every unresolved review thread on a PR, triage each one, reply with a rationale of whether or not the comment will be acted upon, make the code change if…

drnby drn★ 23 GitHub stars

About this skill

Arguments

  • $ARGUMENTS — Optional. PR number, PR URL, or branch name. Defaults to the PR for the current branch.

Context

  • Current branch: !git branch --show-current
  • Git status: !git status --short
  • Base ref: !git branch -r 2>/dev/null | grep -oE 'origin/(main|master)' | head -1
  • Default remote: !git remote 2>/dev/null | head -5

Your task

Walk every unresolved review thread on the target PR. For each thread: read the comment in context, decide whether to act on it, make the code change if warranted, post a reply explaining the rationale, then resolve the thread. End with a clean PR (zero unresolved threads) and a one-paragraph summary of what was done.

This skill does not push the branch into CI babysitting or merge it — use /pr or /merge for that. The focused job here is comment hygiene.

Step 1: Identify the PR

First, derive the upstream repo slug. Prefer the upstream remote if it exists, otherwise origin. The rules below all need it.

REPO_SLUG=$(git remote get-url upstream 2>/dev/null | sed -E 's|.*[:/]([^/]+/[^/.]+)(\.git)?$|\1|')
[ -z "$REPO_SLUG" ] && REPO_SLUG=$(git remote get-url origin | sed -E 's|.*[:/]([^/]+/[^/.]+)(\.git)?$|\1|')

Then determine the target PR by applying these rules in order:

  • $ARGUMENTS is a GitHub PR URL (https://github.com/<owner>/<repo>/pull/<n>) → parse owner/repo/number from the URL.
  • $ARGUMENTS matches ^[0-9]+$ (pure digits) → run gh pr view <args> --repo "$REPO_SLUG" --json number to verify it is a real PR. If that succeeds, treat as a PR number. If it fails, fall through to the branch-name rule (a branch literally named 42 should still resolve correctly).
  • $ARGUMENTS is any other non-empty string → treat as a branch name and look up the PR for that branch.
  • $ARGUMENTS is empty → use the current branch (git branch --show-current).

Find the PR number with gh pr list --repo <slug> --head '<branch>' --state open --json number,url.

Cross-fork PRs. If gh pr list --head '<branch>' returns zero results AND an upstream remote exists, the branch may live on a fork. Resolve the fork owner from the origin remote and retry with the qualified --head '<fork-owner>:<branch>':

FORK_OWNER=$(git remote get-url origin | sed -E 's|.*[:/]([^/]+)/[^/.]+(\.git)?$|\1|')
gh pr list --repo "$REPO_SLUG" --head "$FORK_OWNER:<branch>" --state open --json number,url

If no open PR is found after both attempts, stop and tell the user: No open PR found for <branch>. Open one with /pr first. Do not try to open one — that is /pr's job.

Step 2: Fetch every unresolved review thread

Use the GraphQL API to get all threads in one shot — REST does not expose isResolved. The first: 100 page size is GitHub's connection maximum; pagination handles PRs larger than that (see below). The first: 50 comment window per thread is generous enough for the idempotency-guard scan in Step 3(b) on normal threads. Two ID fields matter here and they are easy to confuse:

  • reviewThreads.nodes[].id is the thread node ID (an opaque string). Used by the resolveReviewThread mutation in Step 3(f).
  • reviewThreads.nodes[].comments.nodes[].databaseId is the comment integer ID (REST-style). Used by the reply endpoint in Step 3(e).

Do not swap them — the URL in Step 3(e) takes the comment's databaseId, not the thread's id.

gh api graphql -F owner=<owner> -F repo=<repo> -F number=<n> -f query='
  query($owner: String!, $repo: String!, $number: Int!, $after: String) {
    repository(owner: $owner, name: $repo) {
      pullRequest(number: $number) {
        reviewThreads(first: 100, after: $after) {
          pageInfo { hasNextPage endCursor }
          nodes {
            id
            isResolved
            isOutdated
            path
            line
            comments(first: 50) {
              nodes {
                databaseId
                body
                author { login }
                path
                line
                originalLine
                diffHunk
              }
            }
          }
        }
      }
    }
  }'

Filter to threads where isResolved == false. If there are zero, stop and report: No unresolved review threads on PR #<n>.

Pagination. If pageInfo.hasNextPage is true, the PR has more than 100 review threads. Re-issue the same query with -F after=<endCursor> (the $after variable is already declared in the signature above) and concatenate the pages before continuing. PRs with very large bot-comment volumes (e.g. a CodeRabbit pass on a sweeping refactor) hit this case; do not silently process only the first page.

Step 3: Triage and act on each thread

For each unresolved thread, work through it in this order. Do not parallelize — review threads can suggest conflicting edits to the same lines, and you need to apply them sequentially with the latest file state in mind.

(a) Read the code in context. Open `

Full SKILL.md on GitHub

Install address-comments in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

Read
Edit
Bash(gh api:*)
Bash(gh pr:*)
Bash(git add:*)
Bash(git commit:*)
Bash(git push:*)
Bash(git status:*)
Bash(git remote:*)
Bash(git branch:*)
Bash(git rev-parse:*)
Bash(git diff:*)
Bash(git log:*)

FAQ

What does the address-comments skill do?

Walk every unresolved review thread on a PR, triage each one, reply with a rationale of whether or not the comment will be acted upon, make the code change if warranted, and mark the thread resolved. Use when the user asks to address only the open PR comments without re-running CI, respond to review feedback, resolve review threads, or clear bot comments on a PR.

How do I install the address-comments skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the address-comments skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare address-comments with