Skip to content
Agentmart
Submit a tool

handle-code-review-comments

Walk through unresolved human code review comments on the current branch's PR, propose a fix for each, ask the user how to proceed, and optionally reply to…

Skill by rabihkodeih

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/rabihkodeih-handle-code-review-comments

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Walk through unresolved human code review comments on the current branch's PR, propose a fix for each, ask the user how to proceed, and optionally reply to the reviewer. Use when the user asks to handle, address, respond to, or work through PR review comments, or mentions "/handle-code-review-comments".

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/handle-code-review-comments

Tools it pre-approves 7

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash,
  • Read,
  • Edit,
  • Write,
  • Grep,
  • Glob,
  • AskUserQuestion

What's inside

Skill name
handle-code-review-comments
Description
Walk through unresolved human code review comments on the current branch's PR, propose a fix for each, ask the user how to proceed, and optionally reply to the reviewer. Use when the user asks to handle, address, respond to, or work through PR review comments, or mentions "/handle-code-review-comments".
License
MIT
Allowed tools
Bash,, Read,, Edit,, Write,, Grep,, Glob,, AskUserQuestion
Instructions
168 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Handle Code Review Comments

Walk the user through every unresolved human review comment on the current branch's pull request, one at a time: propose a fix, show it, ask how to proceed, then optionally reply to the reviewer.

## Workflow

### 1. Locate the PR for the current branch

```bash
# If GITHUB_TOKEN is set in the environment but lacks repo access,
# unset it for this command so gh falls back to the keyring token.
gh auth status 2>&1 | grep -q "GITHUB_TOKEN" && UNSET_TOKEN="GITHUB_TOKEN= " || UNSET_TOKEN=""
eval "${UNSET_TOKEN}gh pr view --json number,url,headRefName,baseRefName,state"
```

If the command fails with "no pull requests found", stop and tell the user there is no PR for this branch. Do not create one.

Capture: `OWNER`, `REPO`, `PR_NUMBER`. Derive owner/repo from `gh repo view --json owner,name`.

### 2. Fetch unresolved human review threads

Use the GraphQL API, REST does not expose `isResolved` for review threads.

```bash
eval "${UNSET_TOKEN}gh api graphql -F owner='$OWNER' -F name='$REPO' -F number=$PR_NUMBER -f query='
query(\$owner: String!, \$name: String!, \$number: Int!) {
  repository(owner: \$owner, name: \$name) {
    pullRequest(number: \$number) {
      reviewThreads(first: 100) {
        nodes {
          id
          isResolved
          isOutdated
          path
          line
          comments(first: 50) {
            nodes {
              id
              databaseId
              author { login __typename }
              body
              path
              line
              originalLine
              startLine
              diffHunk
              url
              createdAt
            }
          }
        }
      }
    }
  }
}'"
```

Filter the returned threads:

- Drop threads where `isResolved == true`.
- Drop threads where the **first** comment's author has `__typename == "Bot"` or `login` ends with `[bot]` (e.g. `coderabbitai[bot]`, `sonarcloud[bot]`, `github-actions[bot]`).
- Keep `isOutdated` threads but flag them, the line numbers may not match current HEAD.

If zero threads remain, tell the user "No unresolved human review comments." and stop.

### 3. Build the work queue

For each remaining thread, extract:

- `thread_id` (GraphQL node ID, needed to resolve later)
- `first_comment_id` (REST `databaseId` of the first comment, needed to reply)
- `author`, `path`, `line`, `body`, `diffHunk`, `url`
- All follow-up comments in the thread (for context, the reviewer may have clarified)

Order the queue by `path` then `line` so related comments cluster together.

### 4. Loop through comments one at a time

For each thread in the queue:

#### 4a. Present the comment

Show the user, in this exact shape:

```
Comment N of M  •  @<author>  •  <path>:<line>
<url>

> <comment body, blockquoted, preserving line breaks>

[follow-ups, if any, indented and labeled with author]
```

#### 4b. Read the surrounding code

Read the file at `path`. Read at least 30 lines of context around `line`. If the thread is `isOutdated`, search for the original code in the diff hunk to locate the current equivalent, say "thread is outdated, line numbers shifted" if you cannot find an exact match.

#### 4c. Propose a fix

Decide what the reviewer is asking for. If the comment is:

- **A concrete change request** ("rename X to Y", "extract this", "use Z instead"), propose the exact edit.
- **A question** ("why are we doing X?"), propose a reply that answers it; no code change unless the answer reveals a bug.
- **A nit / style preference**, propose the smallest possible edit.
- **Ambiguous**, say so explicitly. Propose your best interpretation but flag the ambiguity in the question to the user.
- **Already addressed** in the current code (common with outdated threads), say so; propose only a reply.

Show the proposed fix as a unified diff (file path + before/after hunks). For reply-only proposals, show the draft reply text in a fenced block.

#### 4d. Ask how to proceed

Use `AskUserQuestion` with these options (omit options that don't apply):

- **Apply**, write the edit to disk.
- **Apply + reply**, write the edit and post a reply to the reviewer.
- **Reply only**, post the reply without editing code.
- **Skip**, leave this comment for later, move to next.
- **Stop**, exit the loop entirely.

From rabihkodeih/agentic-workflow, MIT.

More from rabihkodeih/agentic-workflow

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Sep 19, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from rabihkodeih

Cite this page

handle-code-review-comments skill. Agent Mart. https://agentmart.dev/skills/rabihkodeih-handle-code-review-comments (last updated 2026-10-24)