Fix PR Review Comments
Fix PR review comments by implementing the requested changes.
Usage
/pr-review <PR_URL> # Review PR by URL (expects full GitHub URL)
/pr-review <PR_NUMBER> # Review PR by number (expects number, e.g., 123)
/pr-review # Auto-detect PR from current branch
📋 Argument Handling
The command accepts the PR identifier from $ARGUMENTS:
- PR URL: Full GitHub PR URL (e.g.,
https://github.com/owner/repo/pull/123)
- PR Number: Just the PR number (e.g.,
123)
- No Arguments: Auto-detect the PR associated with the current Git branch
If $ARGUMENTS is provided, use it as the PR identifier. Otherwise, auto-detect the current branch's PR using:
gh pr view --json number,url -q '.number'
This extracts the PR number from the current branch's open PR for use in subsequent commands.
If no open PR is found for the current branch, show this error:
Error: No open pull request found for the current branch.
To review a specific PR:
/pr-review <PR_URL>
/pr-review <PR_NUMBER>
Or create a PR first:
gh pr create
Process
- Parse
$ARGUMENTS to determine PR identifier (URL, number, or auto-detect)
- Fetch PR details, review threads, issue comments, and authoritative thread-resolution state using
gh
- Classify each comment as actionable, informational, disputed/ambiguous, or resolved; ask before changing disputed or ambiguous requests
- For each actionable comment, record the comment ID, planned change, and verification command
- Implement the approved fixes
- Run focused tests, then the relevant broader checks
- Recheck the comment-to-change list and confirm every actionable thread is resolved or explicitly deferred
- Commit the changes
Available Scripts
Extract PR Comments
The extract-pr-comments.js script processes GitHub PR review comments and issue comments to create actionable TODO lists.
# Usage
node $SKILL_PATH/scripts/extract-pr-comments.js <review-comments-file> <issue-comments-file> <threads-file> [output-file]
# Example
gh api graphql \
-f owner=OWNER -f name=REPO -F number=4972 \
-f query='query($owner:String!, $name:String!, $number:Int!) { repository(owner:$owner, name:$name) { pullRequest(number:$number) { reviewThreads(first:100) { nodes { isResolved comments(first:100) { nodes { databaseId } } } } } } }' \
> pr-4972-threads.json
node $SKILL_PATH/scripts/extract-pr-comments.js \
pr-4972-review-comments-raw.json \
pr-4972-issue-comments-raw.json \
pr-4972-threads.json \
pr-4972-comments.ndjson
What it does:
- Requires a threads file of GitHub review threads and skips a review comment only when its thread has
isResolved: true
- Does not treat a reply as resolution; an unanswered thread stays actionable
- Classifies comments by severity (critical, high, medium, low)
- Categorizes comments (security, performance, maintainability, etc.)
- Creates 3 output files:
.ndjson - Structured comment data
-todo.md - Prioritized TODO list
-summary.md - Analysis summary with emojis
Severity classification:
- 🔴 Critical: security, vulnerability, exploit
- 🟠 High: bug, error, breaking, crash, fail
- 🟡 Medium: performance, improvement, refactor, optimize
- 🟢 Low: everything else
Categories:
- 🔒 Security
- ⚡ Performance
- 🔧 Maintainability
- ♿ Accessibility
- 🧪 Testing
- 📚 Documentation
- 🏷️ Typing
- 🎨 Style
- ✨ Code Quality
Examples
# Fix review comments for a PR using URL
/pr-review https://github.com/owner/repo/pull/123
# Fix review comments using PR number
/pr-review 123
# Auto-detect PR from current branch
/pr-review
# After extracting comments with the script, work through the TODO list
# The TODO list is ordered by priority: Critical → High → Medium → Low
1---2name: pr-review3description: "Fix PR review comments by implementing requested changes"4license: MIT5compatibility: cline, claude, opencode, amp, codex, gemini, cursor, pi6hint: Use when fixing PR review comments or addressing review feedback. Accepts PR URL, PR number, or auto-detects from current branch7user-invocable: true8metadata:9 source: https://skillmd.com/skills/jellydn/pr-review10 audience: all11 workflow: code-quality12---1314# Fix PR Review Comments1516Fix PR review comments by implementing the requested changes.1718## Usage1920```bash21/pr-review <PR_URL> # Review PR by URL (expects full GitHub URL)22/pr-review <PR_NUMBER> # Review PR by number (expects number, e.g., 123)23/pr-review # Auto-detect PR from current branch24```2526### 📋 Argument Handling2728The command accepts the PR identifier from `$ARGUMENTS`:29301. **PR URL**: Full GitHub PR URL (e.g., `https://github.com/owner/repo/pull/123`)312. **PR Number**: Just the PR number (e.g., `123`)323. **No Arguments**: Auto-detect the PR associated with the current Git branch3334If `$ARGUMENTS` is provided, use it as the PR identifier. Otherwise, auto-detect the current branch's PR using:3536```bash37gh pr view --json number,url -q '.number'38```3940This extracts the PR number from the current branch's open PR for use in subsequent commands.4142If no open PR is found for the current branch, show this error:4344```text45Error: No open pull request found for the current branch.4647To review a specific PR:48 /pr-review <PR_URL>49 /pr-review <PR_NUMBER>5051Or create a PR first:52 gh pr create53```5455## Process56571. Parse `$ARGUMENTS` to determine PR identifier (URL, number, or auto-detect)582. Fetch PR details, review threads, issue comments, and authoritative thread-resolution state using `gh`593. Classify each comment as actionable, informational, disputed/ambiguous, or resolved; ask before changing disputed or ambiguous requests604. For each actionable comment, record the comment ID, planned change, and verification command615. Implement the approved fixes626. Run focused tests, then the relevant broader checks637. Recheck the comment-to-change list and confirm every actionable thread is resolved or explicitly deferred648. Commit the changes6566## Available Scripts6768### Extract PR Comments6970The `extract-pr-comments.js` script processes GitHub PR review comments and issue comments to create actionable TODO lists.7172```bash73# Usage74node $SKILL_PATH/scripts/extract-pr-comments.js <review-comments-file> <issue-comments-file> <threads-file> [output-file]7576# Example77gh api graphql \78 -f owner=OWNER -f name=REPO -F number=4972 \79 -f query='query($owner:String!, $name:String!, $number:Int!) { repository(owner:$owner, name:$name) { pullRequest(number:$number) { reviewThreads(first:100) { nodes { isResolved comments(first:100) { nodes { databaseId } } } } } } }' \80 > pr-4972-threads.json8182node $SKILL_PATH/scripts/extract-pr-comments.js \83 pr-4972-review-comments-raw.json \84 pr-4972-issue-comments-raw.json \85 pr-4972-threads.json \86 pr-4972-comments.ndjson87```8889**What it does:**9091- Requires a threads file of GitHub review threads and skips a review comment only when its thread has `isResolved: true`92- Does not treat a reply as resolution; an unanswered thread stays actionable93- Classifies comments by severity (critical, high, medium, low)94- Categorizes comments (security, performance, maintainability, etc.)95- Creates 3 output files:96 - `.ndjson` - Structured comment data97 - `-todo.md` - Prioritized TODO list98 - `-summary.md` - Analysis summary with emojis99100**Severity classification:**101102- 🔴 **Critical**: security, vulnerability, exploit103- 🟠 **High**: bug, error, breaking, crash, fail104- 🟡 **Medium**: performance, improvement, refactor, optimize105- 🟢 **Low**: everything else106107**Categories:**108109- 🔒 Security110- ⚡ Performance111- 🔧 Maintainability112- ♿ Accessibility113- 🧪 Testing114- 📚 Documentation115- 🏷️ Typing116- 🎨 Style117- ✨ Code Quality118119## Examples120121```bash122# Fix review comments for a PR using URL123/pr-review https://github.com/owner/repo/pull/123124125# Fix review comments using PR number126/pr-review 123127128# Auto-detect PR from current branch129/pr-review130131# After extracting comments with the script, work through the TODO list132# The TODO list is ordered by priority: Critical → High → Medium → Low133```