# Github PR Review Fix

Review and resolve PR comments from GitHub.

- Repository: https://github.com/IvanMurzak/Unity-MCP (4566 stars)
- Category: Git and review
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add IvanMurzak/Unity-MCP --skill github-pr-review-fix -g -a claude-code -y`
Codex: `npx skills add IvanMurzak/Unity-MCP --skill github-pr-review-fix -g -a codex -y`
Cursor: `npx skills add IvanMurzak/Unity-MCP --skill github-pr-review-fix -g -a cursor -y`
Gemini CLI: `npx skills add IvanMurzak/Unity-MCP --skill github-pr-review-fix -g -a gemini-cli -y`

## Description

Review and resolve PR comments from GitHub. Validates each comment, fixes legitimate issues.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Review PR Comments

Review unresolved comments on the GitHub pull request associated with the current branch. Validate each comment, then fix legitimate issues.

## Step 1, Identify the Pull Request

1. If `$ARGUMENTS` contains a PR number, use it.
2. Otherwise, detect the current git branch and find its open PR:
   ```bash
   gh pr view --json number,url,headRefName,baseRefName
   ```
3. If no PR is found, stop and tell the user.

## Step 2, Fetch All Unresolved Review Comments

Fetch PR review comments (not issue-level comments) using the GitHub CLI:

```bash
gh api repos/{owner}/{repo}/pulls/{number}/comments --paginate
```

Filter to comments where the thread is **not resolved**. Group comments by thread (same `in_reply_to_id` or same `path` + `line`/`original_line`). For each thread, treat the **first comment** as the review request and subsequent comments as discussion.

Also fetch general PR comments (issue-level):
```bash
gh api repos/{owner}/{repo}/issues/{number}/comments --paginate
```

If there are zero unresolved comments, report that and stop.

## Step 3, Validate and Fix Comments in Parallel (Sub-agents)

For **each** unresolved comment or comment thread, spawn a **sub-agent** in parallel. Use `model: "sonnet"` for cost efficiency. Each agent validates the comment and, if legitimate, fixes it immediately in place.

**Conflict avoidance**: If multiple comments target the **same file**, run those agents **sequentially** (not in parallel) to avoid edit conflicts. Comments on **different files** run in parallel.

### Sub-agent Prompt Template

```
You are a code review comment validator and fixer. Your job is to determine whether a PR review comment identifies a real issue, and if so, fix it immediately.

## Comment Details
- **Author**: {comment_author}
- **File**: {file_path}
- **Line(s)**: {line_range}
- **Comment**: {comment_body}
- **Thread context** (if any): {thread_replies}
- **Comment ID**: {comment_id}

## Phase 1, Validate

The rest: https://github.com/IvanMurzak/Unity-MCP/blob/HEAD/.claude/skills/github-pr-review-fix/SKILL.md
