GitHub Pull Request Review Assistant
Review the Pull Request at the provided URL and analyze unresolved review comments to provide comprehensive code review feedback.
PR Information
PR URL: $1
Fetch the PR details using GitHub CLI:
- PR metadata: !gh pr view "$1" --json number,title,author,state,isDraft,files
- Review threads with resolution status: !gh api graphql -F query=@.claude/commands/queries/pr-review-threads.graphql -f owner="$(echo "$1" | sed -E 's#https://github.com/([^/]+)/.*#\1#')" -f repo="$(echo "$1" | sed -E 's#https://github.com/[^/]+/([^/]+)/.*#\1#')" -F number=$(echo "$1" | sed -E 's#./pull/([0-9]+).#\1#')
Task Instructions
Fetch PR Details
- Use
gh pr view to get basic PR information
- Use
gh api graphql with external query file to fetch review threads
- GraphQL query includes
isResolved field for each thread
- Only process threads where
isResolved: false
- Ignore all resolved threads (user intentionally closed them)
Analyze Code Changes
- Parse GraphQL response to extract unresolved threads (
isResolved: false)
- For each unresolved thread, read the referenced file using Read tool
- Verify if the issue mentioned in the comment still exists
- Skip threads where issue was already fixed
- Focus only on legitimate remaining issues
Review Criteria
Apply appropriate coding guidelines based on the project's language and framework.
Focus on:
- Coding Style: Consistency, readability, naming conventions
- Architecture: Design patterns, separation of concerns, modularity
- Side Effects: Unintended consequences, race conditions, state mutations
- Potential Bugs: Edge cases, error handling, null/undefined checks
Provide Review Feedback & Apply Fixes
For each comment that points to a real issue:
- Comment Context: Quote the original review comment
- File & Location:
filepath:line_number
- Code Analysis: Examine the relevant code section
- Assessment:
- Is the concern valid?
- What are the implications?
- What's the recommended solution?
- Decision:
- If the concern is valid and the fix is straightforward: IMMEDIATELY APPLY THE FIX using Edit/Write tools
- If the concern requires discussion or design decisions: ASK USER for clarification before making changes
- Alternative Approaches: If applicable, suggest better implementations
- Guideline References: Cite relevant coding guidelines when explaining fixes
Summary
Provide an overall assessment:
- Total number of review threads
- Number of resolved threads (skipped)
- Number of unresolved threads processed
- Number of issues automatically fixed
- Issues requiring user discussion (if any)
- Overall PR quality assessment
Output Format
# PR Review: [PR Title]
**PR**: [PR URL]
**Status**: [open/draft/closed]
**Files Changed**: [count]
## Review Threads Analysis & Fixes
### 1. [File Path]:[Line]
**Thread Status**: Unresolved
**Comment by @[username]**:
> [quoted comment]
**Current Code Status**:
- ✅ **Already fixed** - [explanation of how it was addressed]
- OR
- ⚠️ **Issue still present** - proceeding with fix
**Analysis** (if issue still present):
[Your detailed analysis based on review criteria]
**Action Taken**:
- ✅ **Fixed automatically**: [description of fix applied]
- OR
- ⏸️ **Requires discussion**: [reason why user input is needed]
**Relevant Guideline**: [Coding guideline reference if applicable]
---
### 2. [File Path]:[Line]
...
## Overall Assessment
- **Total Review Threads**: [count]
- **Resolved Threads (Skipped)**: [count]
- **Unresolved Threads Processed**: [count]
- **Issues Fixed Automatically**: [count]
- **Issues Requiring Discussion**: [count]
- **Overall Status**: [All issues resolved / Partial / Awaiting user input]
## Additional Observations
[Any other observations about the PR quality, architecture, or patterns used]
Important Notes
- Private Repositories: Works with
gh CLI authentication
- Resolution Filtering: Uses GraphQL
isResolved field to skip resolved threads
- Smart Filtering: Also verifies if issues still exist in current code
- Focus: Only review and fix unresolved threads with real, existing issues
- Guidelines: Apply appropriate coding guidelines based on project language/framework
- Auto-Fix: Automatically apply fixes for straightforward issues without asking
- User Consultation: Only ask user when the fix involves:
- Architectural or design decisions
- Multiple valid approaches
- Potential breaking changes
- Ambiguous requirements
Example Usage
/review-pr https://github.com/owner/repo/pull/123
The command will fetch all review threads on PR #123, filter to only unresolved threads (isResolved: false), verify which issues still exist in current code, and provide fixes based on the appropriate coding guidelines.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: review-pr-23description: Review GitHub Pull Request and analyze unresolved review comments Use when this capability is needed.4---56# GitHub Pull Request Review Assistant78Review the Pull Request at the provided URL and analyze unresolved review comments to provide comprehensive code review feedback.910## PR Information1112**PR URL**: $11314Fetch the PR details using GitHub CLI:1516- PR metadata: !gh pr view "$1" --json number,title,author,state,isDraft,files17- Review threads with resolution status: !gh api graphql -F query=@.claude/commands/queries/pr-review-threads.graphql -f owner="$(echo "$1" | sed -E 's#https://github.com/([^/]+)/.*#\1#')" -f repo="$(echo "$1" | sed -E 's#https://github.com/[^/]+/([^/]+)/.*#\1#')" -F number=$(echo "$1" | sed -E 's#._/pull/([0-9]+)._#\1#')1819## Task Instructions20211. **Fetch PR Details**22 - Use `gh pr view` to get basic PR information23 - Use `gh api graphql` with external query file to fetch review threads24 - GraphQL query includes `isResolved` field for each thread25 - **Only process threads where `isResolved: false`**26 - Ignore all resolved threads (user intentionally closed them)27282. **Analyze Code Changes**29 - Parse GraphQL response to extract unresolved threads (`isResolved: false`)30 - For each unresolved thread, read the referenced file using Read tool31 - Verify if the issue mentioned in the comment still exists32 - Skip threads where issue was already fixed33 - Focus only on legitimate remaining issues34353. **Review Criteria**3637 Apply appropriate coding guidelines based on the project's language and framework.3839 Focus on:40 - **Coding Style**: Consistency, readability, naming conventions41 - **Architecture**: Design patterns, separation of concerns, modularity42 - **Side Effects**: Unintended consequences, race conditions, state mutations43 - **Potential Bugs**: Edge cases, error handling, null/undefined checks44454. **Provide Review Feedback & Apply Fixes**4647 For each comment that points to a real issue:48 - **Comment Context**: Quote the original review comment49 - **File & Location**: `filepath:line_number`50 - **Code Analysis**: Examine the relevant code section51 - **Assessment**:52 - Is the concern valid?53 - What are the implications?54 - What's the recommended solution?55 - **Decision**:56 - If the concern is valid and the fix is straightforward: **IMMEDIATELY APPLY THE FIX** using Edit/Write tools57 - If the concern requires discussion or design decisions: **ASK USER** for clarification before making changes58 - **Alternative Approaches**: If applicable, suggest better implementations59 - **Guideline References**: Cite relevant coding guidelines when explaining fixes60615. **Summary**6263 Provide an overall assessment:64 - Total number of review threads65 - Number of resolved threads (skipped)66 - Number of unresolved threads processed67 - Number of issues automatically fixed68 - Issues requiring user discussion (if any)69 - Overall PR quality assessment7071## Output Format7273```markdown74# PR Review: [PR Title]7576**PR**: [PR URL]77**Status**: [open/draft/closed]78**Files Changed**: [count]7980## Review Threads Analysis & Fixes8182### 1. [File Path]:[Line]8384**Thread Status**: Unresolved85**Comment by @[username]**:8687> [quoted comment]8889**Current Code Status**:9091- ✅ **Already fixed** - [explanation of how it was addressed]92- OR93- ⚠️ **Issue still present** - proceeding with fix9495**Analysis** (if issue still present):96[Your detailed analysis based on review criteria]9798**Action Taken**:99100- ✅ **Fixed automatically**: [description of fix applied]101- OR102- ⏸️ **Requires discussion**: [reason why user input is needed]103104**Relevant Guideline**: [Coding guideline reference if applicable]105106---107108### 2. [File Path]:[Line]109110...111112## Overall Assessment113114- **Total Review Threads**: [count]115- **Resolved Threads (Skipped)**: [count]116- **Unresolved Threads Processed**: [count]117- **Issues Fixed Automatically**: [count]118- **Issues Requiring Discussion**: [count]119- **Overall Status**: [All issues resolved / Partial / Awaiting user input]120121## Additional Observations122123[Any other observations about the PR quality, architecture, or patterns used]124```125126## Important Notes127128- **Private Repositories**: Works with `gh` CLI authentication129- **Resolution Filtering**: Uses GraphQL `isResolved` field to skip resolved threads130- **Smart Filtering**: Also verifies if issues still exist in current code131- **Focus**: Only review and fix unresolved threads with real, existing issues132- **Guidelines**: Apply appropriate coding guidelines based on project language/framework133- **Auto-Fix**: Automatically apply fixes for straightforward issues without asking134- **User Consultation**: Only ask user when the fix involves:135 - Architectural or design decisions136 - Multiple valid approaches137 - Potential breaking changes138 - Ambiguous requirements139140## Example Usage141142```bash143/review-pr https://github.com/owner/repo/pull/123144```145146The command will fetch all review threads on PR #123, filter to only unresolved threads (`isResolved: false`), verify which issues still exist in current code, and provide fixes based on the appropriate coding guidelines.147148---149> Converted and distributed by [TomeVault](https://tomevault.io/claim/specvital) — claim your Tome and manage your conversions.150<!-- tomevault:4.0:skill_md:2026-04-13 -->