pr-review
Perform thorough, constructive pull request reviews using parallel specialized agents. Use when user wants to review a PR, provide code review feedback, or assess code changes. Features confidence-scored issues, validation filtering, and batched GitHub comments.
What this skill does
# PR Review Skill This skill provides a structured approach to reviewing pull requests using **parallel specialized agents** for thorough coverage, with confidence scoring to minimize false positives. **Important**: Any text comment you post must be prefixed with: ``` [AUTOMATED] ``` This is important because you are using the Github CLI with the account of your beloved human, and you want to make it clear that the comment is not coming from the human. --- ## Review Workflow ### Step 1: Pre-Review Validation Before starting, launch a **haiku agent** to check if review should proceed: ``` Check if any of the following are true for the PR: - The PR is closed - The PR is a draft - The PR is trivial (automated, obviously correct single-line change) If any condition is true, stop and explain why. ``` If validation fails, do not proceed with the review. ### Step 2: Gather Context Launch **two haiku agents in parallel**: **Agent A - PR Summary**: ``` Fetch PR details using: uv run scripts/gh_pr.py files owner/repo <number> If there's a linked issue, fetch it: uv run scripts/gh_pr.py issue owner/repo <issue> Return a brief summary of: - What the PR does - Files changed - Author's stated intent — based on code and eventual linked issue ``` **Agent B - Guidelines Discovery**: ``` Find all relevant guideline files: - Root CLAUDE.md (if exists) - CLAUDE.md files in directories containing modified files - Any project-specific style guides Return the file paths and key rules that apply to changed files. ``` ### Step 3: Parallel Review Agents Launch **4 specialized agents in parallel** to review the changes. Each agent should receive: - PR title and description - Relevant guideline summaries (from Step 2) - The diff (via `uv run scripts/gh_pr.py files owner/repo <number> --raw`) **Agent 1: Bug Hunter (opus)** See `agents/bug-hunter.md`. Focus on actual bugs and security issues. **Agent 2: Bug Hunter (opus)** Same as Agent 1, run twice for coverage. Different agents may catch different issues. **Agent 3: Guideline Compliance (sonnet)** See `agents/guideline-compliance.md`. Check CLAUDE.md and project convention adherence. **Agent 4: Error Handling Auditor (sonnet)** See `agents/error-handling-auditor.md`. Hunt for silent failures and poor error handling. **CRITICAL**: We only want **HIGH SIGNAL** issues: - Objective bugs that will cause incorrect behavior at runtime - Clear, unambiguous guideline violations with quoted rules - Silent failures that hide errors from users We do NOT want: - Subjective concerns or suggestions - Style preferences not explicitly required - Potential issues that "might" be problems - Anything requiring interpretation or judgment ### Step 4: Issue Validation For each issue found with confidence >= 80, launch a **validation subagent**: See `agents/issue-validator.md`. The validator independently verifies: - Bug reports are real (trace code, check for defensive handling) - Guideline violations actually apply (rule exists, no exceptions) - The severity assessment is accurate Use **opus** subagents for bug validation, **sonnet** for guideline validation. ### Step 5: Filter Results Only keep issues that: 1. Had original confidence >= 80 2. Were validated in Step 4 3. Are not duplicates This gives us our final list of high-signal issues. ### Step 6: Post Review #### If NO issues found: Post a summary comment (if requested): ```bash gh pr comment <number> --body "[AUTOMATED] ## Code Review No issues found. Checked for bugs, guideline compliance, and error handling." ``` #### If issues found: Use the batched review workflow to post all comments at once. --- ## The Core Standard **Approve changes that improve code health, even if imperfect.** - The goal is continuous improvement, not perfection - Don't block progress over minor issues - use "Nit:" prefix for non-blocking suggestions - Reject only when the change worsens overall code health or is fundamentally unwanted ### Decision Hierarchy When opinions conflict: 1. Technical facts and data override opinions 2. Style guides are authoritative 3. Design decisions require principle-based reasoning, not preference 4. Consistency with existing code (when it maintains health) --- ## What to Look For ### Design - Is the overall architecture sound? - Do code interactions make sense? - Does this belong here, or in a library/different module? - Does it integrate well with existing systems? ### Architectural Consistency - **Identify existing abstractions** - What patterns does this codebase already have? - **Check for pattern reuse** - Is new code following established patterns or reinventing them? - **Look for duplicated abstractions** - Is the PR reimplementing existing helpers? - **Look for useless abstractions** - Is complexity being added unnecessarily? **Key question**: *"How do similar features in this codebase solve this problem?"* ### Functionality - Does the code do what the author intended? - Watch for: edge cases, race conditions, concurrency bugs ### Complexity - Can you understand the code quickly? - Is it over-engineered for hypothetical future needs? - **Principle**: Solve the problem that exists now ### Tests - Are there appropriate tests? - Will tests actually fail when the code breaks? - Are test cases meaningful, not just coverage padding? --- ## Writing Effective Comments ### Severity Labels - **Nit:** Minor issue, should fix but won't block approval - **Optional/Consider:** Suggestion worth considering, not required - **FYI:** Information only, no action expected ### Tone - Be kind - critique code, never the person - Explain the reasoning behind suggestions - Acknowledge when the author knows more than you --- ## Specialized Agents Reference Additional agents available for targeted analysis: ### Test Analyzer See `agents/test-analyzer.md`. Use when: - PR adds significant new functionality - You want to verify test coverage quality - User asks about test thoroughness ### Full Agent List | Agent | Focus | Model | When to Use | |-------|-------|-------|-------------| | bug-hunter | Bugs & security | opus | Default parallel review | | guideline-compliance | CLAUDE.md adherence | sonnet | Default parallel review | | error-handling-auditor | Silent failures | sonnet | Default parallel review | | test-analyzer | Test coverage | sonnet | On request or for new features | | issue-validator | Verify findings | inherit | Validation step | --- ## Scripts Reference This skill includes Python scripts in `scripts/` that wrap GitHub API operations. Run them with `uv`: ### Available Commands | Command | Description | |---------|-------------| | `files` | Get PR files with status and patch info | | `comments` | Get review comments (supports `--unresolved`, `--pending` filters) | | `reviews` | List all reviews on a PR | | `post` | Post a batched review from JSON file | | `reply` | Reply to a specific review comment | | `resolve` | Resolve or unresolve a review thread | | `head` | Get the head commit SHA for a PR | | `checkout` | Create a worktree to review PR locally | | `cleanup` | Remove a PR worktree | | `init-review` | Initialize a review JSON file | | `issue` | Fetch issue details (title, description, labels, assignees) | ### Usage Examples ```bash # Fetch issue details uv run scripts/gh_pr.py issue owner/repo 42 # Get PR files and diff uv run scripts/gh_pr.py files owner/repo 123 # Get raw JSON for agent processing uv run scripts/gh_pr.py files owner/repo 123 --raw # Get unresolved review comments uv run scripts/gh_pr.py comments owner/repo 123 --unresolved # Initialize review file uv run scripts/gh_pr.py init-review owner/repo 123 # Post batched review uv run scripts/gh_pr.py post owner/repo 123 /tmp/pr-review-owner-repo-123.json ``` --- ## Posting the Code Review ### Workflow Overview Reviews are posted in a single batch to avoid spamming notifications. During the review process, accumulate feedback in a transient JSON fi
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.