/pr-review
Ultra-fast PR review with 8-10x speedup through parallel sub-agent analysis
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/pr-review
Context preview
What this command does when you run it.
Ultra-fast PR review with 8-10x speedup through parallel sub-agent analysis
Command definition
pr-review.mdallowed-tools: Task, Bash(gh pr view:*), Bash(gh pr list:*), Bash(gh pr review:*), Bash(gh pr diff:*), Bash(gh pr checks:*), Bash(gh pr edit:*), Bash(gh api:*), Bash(git branch:*), Bash(rg:*), Bash(delta:*), Bash(jq:*), Bash(gdate:*), Read, Write, Grep
name: "Pr Review"
description: "Ultra-fast PR review with 8-10x speedup through parallel sub-agent analysis"
author: "wcygan"
tags: ["git","pr"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"
Context
- Session ID: !`gdate +%s%N`
- Current branch: !`git branch --show-current 2>/dev/null || echo "detached-head"`
- Current branch PR: !`gh pr list --head "$(git branch --show-current 2>/dev/null || echo none)" --json number,title,state | jq -r '.[0].number // "none"' 2>/dev/null || echo "none"`
- PRs for review: !`gh pr list --search "review-requested:@me" --json number,title,author | jq length 2>/dev/null || echo "0"`
- Mentioned in PRs: !`gh pr list --search "mentions:@me" --json number,title | jq length 2>/dev/null || echo "0"`
- Open PRs count: !`gh pr list --state open --json number | jq length 2>/dev/null || echo "0"`
- Repository: !`gh repo view --json nameWithOwner,url | jq -r '.nameWithOwner // "unknown"' 2>/dev/null || echo "unknown"`
- GitHub auth status: !`gh auth status 2>&1 | head -1 || echo "Not authenticated"`
Your task
**CRITICAL: This command leverages 8-10 parallel sub-agents for instant comprehensive PR analysis, achieving 8-10x faster reviews than sequential analysis.**
STEP 1: Initialize PR review session
- CREATE session state: `/tmp/pr-review-state-$SESSION_ID.json`
- INITIALIZE review session with timestamp and context
- PARSE arguments from $ARGUMENTS for action and PR number
- SET session data:
{
"sessionId": "$SESSION_ID",
"timestamp": "ISO_8601_TIMESTAMP",
"action": "auto-detect",
"prNumber": null,
"repository": "auto-detect",
"reviewPhase": "initialization",
"analysisResults": {},
"parallelAgentResults": {},
"reviewDecisions": [],
"errorLog": []
}STEP 2: Parse arguments and determine review action
IF $ARGUMENTS is empty:
- SET action = "discover_prs"
- FOCUS on PRs assigned for review and current branch PR
ELSE IF $ARGUMENTS starts with action keyword (approve|comment|request-changes|diff|checks|files):
- EXTRACT action and optional PR number
- SET review_action = detected action
ELSE IF $ARGUMENTS is numeric:
- SET prNumber = $ARGUMENTS
- SET action = "review_specific_pr"
ELSE:
- LOG invalid arguments to session state
- PROVIDE usage examples and available PRs
STEP 3: Execute PR discovery or direct review
CASE action: WHEN "discover_prs":
TRY:
- FETCH PRs assigned for review: `gh pr list --search "review-requested:@me" --json number,title,author,createdAt`
- FETCH current branch PR: `gh pr list --head $(git branch --show-current) --json number,title,state`
- FETCH mentioned PRs: `gh pr list --search "mentions:@me" --json number,title,state`
- DISPLAY interactive PR selection with priorities:
1. PRs explicitly assigned for review (highest priority) 2. Current branch PR (if exists) 3. PRs where mentioned (lowest priority)
- SAVE PR list to session state
WHEN "review_specific_pr":
- VALIDATE PR number exists and is accessible
- PROCEED to comprehensive PR analysis
CATCH (github_api_error):
- LOG API errors to session state
- CHECK GitHub authentication status
- PROVIDE troubleshooting guidance
- FALLBACK to manual PR specification
STEP 4: Ultra-Fast Parallel PR Analysis
**CRITICAL: IMMEDIATELY DEPLOY 8-10 PARALLEL SUB-AGENTS for instant comprehensive PR review. NO SEQUENTIAL ANALYSIS.**
TRY:
- FETCH PR metadata: `gh pr view $PR_NUMBER --json title,body,state,author,assignees,labels,milestone,files,changedFiles,additions,deletions`
- SAVE PR metadata to: `/tmp/pr-review-$SESSION_ID/pr-metadata.json`
**LAUNCH ALL 8-10 AGENTS SIMULTANEOUSLY IN A SINGLE RESPONSE:**
1. **Code Quality & Architecture Agent**
- ANALYZE: Design patterns, SOLID principles, code smells, cyclomatic complexity
- SCAN: Architecture violations, coupling issues, abstraction levels
- OUTPUT: `/tmp/pr-review-$SESSION_ID/code-quality.json`
- FOCUS: "Review PR #$PR_NUMBER for code quality, design patterns, and architectural concerns"
2. **Security Vulnerability Agent**
- SCAN: OWASP Top 10 patterns, credential exposure, injection vulnerabilities
- CHECK: Authentication/authorization flaws, cryptographic issues
- OUTPUT: `/tmp/pr-review-$SESSION_ID/security-analysis.json`
- FOCUS: "Perform security audit of PR #$PR_NUMBER for vulnerabilities and exposed secrets"
3. **Performance & Scalability Agent**
- IDENTIFY: N+1 queries, memory leaks, inefficient algorithms
- ANALYZE: Bundle size impact, database query optimization
- OUTPUT: `/tmp/pr-review-$SESSION_ID/performance-impact.json`
- FOCUS: "Assess performance implications of PR #$PR_NUMBER including algorithmic complexity"
4. **Test Coverage & Quality Agent**
- VERIFY: Test completeness, edge case coverage, test quality
- CHECK: Mocking strategies, integration test presence
- OUTPUT: `/tmp/pr-review-$SESSION_ID/testing-analysis.json`
- FOCUS: "Analyze test coverage and quality for PR #$PR_NUMBER"
5. **Documentation & API Contract Agent**
- REVIEW: Documentation updates, API contract changes, breaking changes
- CHECK: README updates, inline documentation, changelog entries
- OUTPUT: `/tmp/pr-review-$SESSION_ID/documentation.json`
- FOCUS: "Review documentation completeness and API changes in PR #$PR_NUMBER"
6. **Dependencies & Compatibility Agent**
- ANALYZE: New dependencies, version conflicts, security advisories
- CHECK: Breaking changes in dependencies, license compatibility
- OUTPUT: `/tmp/pr-review-$SESSION_ID/dependencies.json`
- FOCUS: "Analyze dependency changes and compatibility issues in PR #$PR_NUMBER"
7. **Code Style & Consistency Agent**
- ENFORCE: Style guide adhe
Read more
allowed-tools: Task, Bash(gh pr view:*), Bash(gh pr list:*), Bash(gh pr review:*), Bash(gh pr diff:*), Bash(gh pr checks:*), Bash(gh pr edit:*), Bash(gh api:*), Bash(git branch:*), Bash(rg:*), Bash(delta:*), Bash(jq:*), Bash(gdate:*), Read, Write, Grep name: "Pr Review" description: "Ultra-fast PR review with 8-10x speedup through parallel sub-agent analysis" author: "wcygan" tags: ["git","pr"] version: "1.0.0" created_at: "2025-07-14T00:00:00Z" updated_at: "2025-07-14T00:00:00Z"
Context
- Session ID: !`gdate +%s%N`
- Current branch: !`git branch --show-current 2>/dev/null || echo "detached-head"`
- Current branch PR: !`gh pr list --head "$(git branch --show-current 2>/dev/null || echo none)" --json number,title,state | jq -r '.[0].number // "none"' 2>/dev/null || echo "none"`
- PRs for review: !`gh pr list --search "review-requested:@me" --json number,title,author | jq length 2>/dev/null || echo "0"`
- Mentioned in PRs: !`gh pr list --search "mentions:@me" --json number,title | jq length 2>/dev/null || echo "0"`
- Open PRs count: !`gh pr list --state open --json number | jq length 2>/dev/null || echo "0"`
- Repository: !`gh repo view --json nameWithOwner,url | jq -r '.nameWithOwner // "unknown"' 2>/dev/null || echo "unknown"`
- GitHub auth status: !`gh auth status 2>&1 | head -1 || echo "Not authenticated"`
Your task
**CRITICAL: This command leverages 8-10 parallel sub-agents for instant comprehensive PR analysis, achieving 8-10x faster reviews than sequential analysis.**
STEP 1: Initialize PR review session
- CREATE session state: `/tmp/pr-review-state-$SESSION_ID.json`
- INITIALIZE review session with timestamp and context
- PARSE arguments from $ARGUMENTS for action and PR number
- SET session data:
{
"sessionId": "$SESSION_ID",
"timestamp": "ISO_8601_TIMESTAMP",
"action": "auto-detect",
"prNumber": null,
"repository": "auto-detect",
"reviewPhase": "initialization",
"analysisResults": {},
"parallelAgentResults": {},
"reviewDecisions": [],
"errorLog": []
}STEP 2: Parse arguments and determine review action
IF $ARGUMENTS is empty:
- SET action = "discover_prs"
- FOCUS on PRs assigned for review and current branch PR
ELSE IF $ARGUMENTS starts with action keyword (approve|comment|request-changes|diff|checks|files):
- EXTRACT action and optional PR number
- SET review_action = detected action
ELSE IF $ARGUMENTS is numeric:
- SET prNumber = $ARGUMENTS
- SET action = "review_specific_pr"
ELSE:
- LOG invalid arguments to session state
- PROVIDE usage examples and available PRs
STEP 3: Execute PR discovery or direct review
CASE action: WHEN "discover_prs":
TRY:
- FETCH PRs assigned for review: `gh pr list --search "review-requested:@me" --json number,title,author,createdAt`
- FETCH current branch PR: `gh pr list --head $(git branch --show-current) --json number,title,state`
- FETCH mentioned PRs: `gh pr list --search "mentions:@me" --json number,title,state`
- DISPLAY interactive PR selection with priorities:
1. PRs explicitly assigned for review (highest priority) 2. Current branch PR (if exists) 3. PRs where mentioned (lowest priority)
- SAVE PR list to session state
WHEN "review_specific_pr":
- VALIDATE PR number exists and is accessible
- PROCEED to comprehensive PR analysis
CATCH (github_api_error):
- LOG API errors to session state
- CHECK GitHub authentication status
- PROVIDE troubleshooting guidance
- FALLBACK to manual PR specification
STEP 4: Ultra-Fast Parallel PR Analysis
**CRITICAL: IMMEDIATELY DEPLOY 8-10 PARALLEL SUB-AGENTS for instant comprehensive PR review. NO SEQUENTIAL ANALYSIS.**
TRY:
- FETCH PR metadata: `gh pr view $PR_NUMBER --json title,body,state,author,assignees,labels,milestone,files,changedFiles,additions,deletions`
- SAVE PR metadata to: `/tmp/pr-review-$SESSION_ID/pr-metadata.json`
**LAUNCH ALL 8-10 AGENTS SIMULTANEOUSLY IN A SINGLE RESPONSE:**
1. **Code Quality & Architecture Agent**
- ANALYZE: Design patterns, SOLID principles, code smells, cyclomatic complexity
- SCAN: Architecture violations, coupling issues, abstraction levels
- OUTPUT: `/tmp/pr-review-$SESSION_ID/code-quality.json`
- FOCUS: "Review PR #$PR_NUMBER for code quality, design patterns, and architectural concerns"
2. **Security Vulnerability Agent**
- SCAN: OWASP Top 10 patterns, credential exposure, injection vulnerabilities
- CHECK: Authentication/authorization flaws, cryptographic issues
- OUTPUT: `/tmp/pr-review-$SESSION_ID/security-analysis.json`
- FOCUS: "Perform security audit of PR #$PR_NUMBER for vulnerabilities and exposed secrets"
3. **Performance & Scalability Agent**
- IDENTIFY: N+1 queries, memory leaks, inefficient algorithms
- ANALYZE: Bundle size impact, database query optimization
- OUTPUT: `/tmp/pr-review-$SESSION_ID/performance-impact.json`
- FOCUS: "Assess performance implications of PR #$PR_NUMBER including algorithmic complexity"
4. **Test Coverage & Quality Agent**
- VERIFY: Test completeness, edge case coverage, test quality
- CHECK: Mocking strategies, integration test presence
- OUTPUT: `/tmp/pr-review-$SESSION_ID/testing-analysis.json`
- FOCUS: "Analyze test coverage and quality for PR #$PR_NUMBER"
5. **Documentation & API Contract Agent**
- REVIEW: Documentation updates, API contract changes, breaking changes
- CHECK: README updates, inline documentation, changelog entries
- OUTPUT: `/tmp/pr-review-$SESSION_ID/documentation.json`
- FOCUS: "Review documentation completeness and API changes in PR #$PR_NUMBER"
6. **Dependencies & Compatibility Agent**
- ANALYZE: New dependencies, version conflicts, security advisories
- CHECK: Breaking changes in dependencies, license compatibility
- OUTPUT: `/tmp/pr-review-$SESSION_ID/dependencies.json`
- FOCUS: "Analyze dependency changes and compatibility issues in PR #$PR_NUMBER"
7. **Code Style & Consistency Agent**
- ENFORCE: Style guide adhe
A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.
Repo: kiliczsh/claude-cmd
Other commands on claude-cmd.
- /agent-browser-automation
Automate browser interactions for development testing using Puppeteer MCP
Open command - /agent-prep-merge
Prepare branches for merging across multiple worktrees and coordinate integration
Open command - /agent-persona-accessibility-expert
Transform into accessibility expert for WCAG compliance and inclusive design
Open command - /agent-persona-api-designer
Transform into an API design specialist who creates well-structured, developer-friendly APIs
Open command - /agent-persona-backend-specialist
Transform into backend specialist for scalable API and system design
Open command - /agent-persona-cloud-architect
Cloud architect persona for designing scalable, secure cloud infrastructure using modern cloud-native technologies
Open command

