with one click
address-review
// If prompted, address review comments on a GitHub PR by gathering context, categorizing by complexity, and preparing a plan.
// If prompted, address review comments on a GitHub PR by gathering context, categorizing by complexity, and preparing a plan.
| name | address-review |
| description | If prompted, address review comments on a GitHub PR by gathering context, categorizing by complexity, and preparing a plan. |
| allowed-tools | Bash(gh pr view:*), AskUserQuestion(*) |
| argument-hint | ["PR number"] |
This skill helps address review comments on a GitHub PR. It gathers context, categorizes comments by complexity, and prepares a plan for addressing them.
Step 1: Determine the PR
Identify which PR to work on. The PR number may be:
The repository is assumed to be oxcaml/oxcaml unless otherwise specified.
Step 2: Gather Context
First, fetch high-level PR information:
gh pr view <PR> --repo oxcaml/oxcaml --json title,body,state,author,baseRefName,headRefName,commits,files | jq '{title, body, state, author: .author.login, base: .baseRefName, head: .headRefName, commits: (.commits | length), files: [.files[].path]}'
Then, fetch unresolved review threads:
python3 scripts/pr-comment-threads.py --pr <PR> --repo oxcaml/oxcaml
For each unresolved thread, understand the context by:
diffHunk to see what code is being discussedStep 3: Produce Summary and Todo Lists
Create a brief summary of the PR (what it does, key changes).
Classify each unresolved comment thread into one of two categories:
Step 4: Plan for Trivial Items
For each trivial item, draft a brief plan for how to address it. This may involve:
Step 5: Present to User
Present the following to the user:
An example of the output is provided below.
Do NOT make any changes yet. Wait for explicit user confirmation before addressing even the trivial items. The user may:
After confirmation, implement the trivial fixes. The user will then collaborate with Claude to address the more involved items.
pr-comment-threads.py: Fetches review comment threads (line-level discussions) using GitHub GraphQL API.
python3 scripts/pr-comment-threads.py --pr <PR> --repo oxcaml/oxcaml [--all]
--all: Include resolved threads (default: only unresolved)gh-comments.py: Fetches PR/Issue comments using GitHub REST API.
# PR review comments (line-level)
python3 scripts/gh-comments.py --pr <PR> --repo oxcaml/oxcaml
# Issue/PR general comments
python3 scripts/gh-comments.py --issue <N> --repo oxcaml/oxcaml
Below is an example of the output to show to the user at the end of the analysis.
| # | File | Line | Comment | Notes |
|---|---|---|---|---|
| 1 | file1.py | 10 | Fix typo |
Thread 1: Clarify the use of foo in bar. Involved, because it requires a larger refactoring of the code base.
Thread 17: Fix a small typo in baz.py. Trivial, because it's a simple edit.
My suggestion is to change pss into pass:
def foo():
pss
into
def foo():
pass
I've identified N nontrivial threads that need to be addressed together with the user. I have also identified M trivial threads that can be addressed by me right away.