Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

address-comments

БесплатноБез исполняемых скриптовНе проверен

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…

drnот drn★ 23 звезды на GitHub

Об этом скилле

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 `

Полный SKILL.md на GitHub

Установить address-comments в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

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

Что делает скилл address-comments?

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.

Как установить скилл address-comments?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл address-comments запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить address-comments с