Search
Find a skill, guardrail or mod
Catalog
Skill v1.0.0

pr-address-comments

Pulls review comments on your PR, fixes what is actionable, and pushes, without ever writing to GitHub.

Install

/plugin install pr-address-comments --marketplace rezk2ll/skills

What it does

pr-address-comments pulls the open review comments on your pull request, fixes the ones that ask for a concrete change, and pushes to the PR branch. It never replies, resolves threads, reacts, or posts anything on GitHub. Questions and disagreements come back to you in the report.

When to use it

  • "Address the review feedback on PR 123."
  • "Check the comments on my PR and fix what you can."

How it works

  • Finds the PR for the current branch and checks it out.
  • Pulls review threads with one GraphQL call, then review summaries and conversation comments. It drops resolved, outdated and self-authored comments.
  • Sorts each comment as actionable, nit, question, out of scope or disagreement, and fixes only inside the comment's scope.
  • Runs the project's own checks, folds each fix into the commit it belongs to, and pushes with --force-with-lease.
  • Reports what it fixed, what it skipped, and what needs your reply.

Requirements

  • git and the GitHub CLI (gh), authenticated.

Source

---
name: pr-address-comments
description: Use when the user asks to check, review, address, or fix comments on a pull request. Pulls review threads, fixes what is actionable locally, pushes to the PR branch. NEVER replies, resolves, or posts anything to GitHub.
---

# Address PR Comments

Pull review comments on a PR, fix what is actionable, push. Never write to GitHub.

## When to use

- "check the comments on the PR" / "address the review feedback" / "fix the comments on PR #123"

## Iron rule: never write to GitHub

Allowed writes: local file edits, local commits, `git push` to the PR's own branch.

Forbidden: `gh pr review`, `gh pr comment`, `gh api -X POST` on `/comments` / `/reviews`, emoji reactions, thread resolution, re-requesting review, PR title / body edits unless the user asked.

If a comment seems to need a verbal reply, surface it in the report instead. The user replies themselves.

## Phase 0: Identify the PR

```bash
gh pr view --json number,headRefName,baseRefName,url,state
```

If the current branch has no PR, ask. If the PR is closed/merged, stop. Otherwise:

```bash
gh pr checkout <number>
```

## Phase 1: Pull comments

One GraphQL call covers most of what you need:

```bash
gh api graphql -f query='
  query($owner: String!, $repo: String!, $number: Int!) {
    repository(owner: $owner, name: $repo) {
      pullRequest(number: $number) {
        reviewThreads(first: 100) {
          nodes {
            isResolved
            comments(first: 20) {
              nodes { body path line author { login } createdAt }
            }
          }
        }
      }
    }
  }' -f owner=<owner> -f repo=<repo> -F number=<number>
```

Then top-level review summaries and PR conversation comments:

```bash
gh api repos/<owner>/<repo>/pulls/<n>/reviews --paginate
gh api repos/<owner>/<repo>/issues/<n>/comments --paginate
```

Filter out: comments by the PR author themselves, resolved threads, outdated inline comments (null `position`), bot comments unless relevant.

## Phase 2: Triage

For each remaining comment, classify:

- **Actionable**: concrete change requested → fix locally
- **Nit**: style preference → fix if cheap, skip otherwise
- **Question**: surface to the user, do not answer on GitHub
- **Out of scope**: valid but separate PR; surface to the user
- **Disagreement**: surface to the user, do not "compromise" by half-fixing

## Phase 3: Apply fixes and verify

1. Make each change inside the comment's scope. No "while I'm here" cleanup.
2. Run the sub-project's own checks. For a Node project, run whichever of these its `package.json` actually defines, in this order: `format → check → typecheck → lint → build → test`. Skip what is not defined. Other stacks: use their equivalent (Makefile targets, `cargo`, `go`, `pytest`).
3. Fix any new failures introduced by your edits before committing.

## Phase 4: Commit and push

Fold the fixes into the existing history rather than stacking an "address review feedback" commit. Squash each fix into the commit it logically belongs to (or amend HEAD when they all belong there), then force-push with lease:

```bash
git commit --amend --no-edit                              # all fixes belong on HEAD
# or, to target an earlier commit (non-interactive autosquash):
git commit --fixup <sha> && GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash <sha>^

git push --force-with-lease
```

Always use `--force-with-lease`, never a bare `--force`, so a teammate's push is never clobbered. Keep the sub-project's existing commit prefix style (`git log --oneline -10`).

## Phase 5: Report (inline)

```
## PR #<n> comment review

**Comments**: <count after filtering>

**Fixed**:
- <file>:<line>: <one-line summary>

**Not addressed** (nit / out of scope):
- <file>:<line>: <reason>

**Needs your input** (do not reply on GitHub):
- <reviewer> asked: "<quoted question>"

**Pushed**: <commit sha> to <branch>
```

## Rules

- The Iron rule covers all GitHub-write prohibitions; do not invent more.
- Scope to each comment. No incidental refactors.
- Run the sub-project's defined verify scripts before pushing.
- Surface questions and disagreements; never engage on GitHub for the user.

More skills