Comprehensive PR Review
Run a comprehensive pull request review using multiple specialized agents, each focusing on a different aspect of code quality.
Review Aspects (optional): "$ARGUMENTS"
Review Workflow:
Load Configuration
- Read the project config file at
.specify/extensions/review/review-config.yml (if it exists).
- If the file does not exist, fall back to the
defaults.agents section in the extension's extension.yml.
- Extract the
agents map — each key (code, comments, tests, errors, types, simplify) is a boolean toggle.
- Agents set to
false MUST be excluded from this run. Do not launch them.
Determine Review Scope
- Parse arguments to see if user requested specific review aspects.
- If specific aspects were requested, run exactly those — config toggles do not apply (explicit user request overrides config).
- Default (no arguments): Run all applicable reviews that are enabled in config.
Available Review Aspects:
- comments - Analyze code comment accuracy and maintainability
- tests - Review test coverage quality and completeness
- errors - Check error handling for silent failures
- types - Analyze type design and invariants (if new types added)
- code - General code review for project guidelines
- simplify - Simplify code for clarity and maintainability
- all - Run all applicable reviews (default)
Identify Changed Files
- If the user provided a file list or explicit instructions on how to retrieve files (e.g., only staged, only unstaged, a specific folder, etc.), follow those instructions directly.
- Otherwise, you MUST execute the
.specify/scripts/bash/detect-changed-files.sh with --json to detect changed files. Do not attempt to detect changes by running git commands directly, reading git state manually, or using any other method — always delegate to the script.
- The script automatically picks the best detection mode:
- Mode A (feature branch): diffs the current branch against the default branch (
main/master) from the merge-base, plus any staged and unstaged changes.
- Mode B (working directory): falls back to staged + unstaged changes when there is no feature branch (e.g., working directly on the default branch).
- JSON output:
{"branch", "default_branch", "mode", "changed_files": [...]}
- Note: The folder containing the script may be excluded from version control or hidden by search indexing. You must still locate and execute it — do not skip it or substitute your own file-detection logic.
Determine Applicable Reviews
Based on changes and config toggles (skip any agent where agents.<name> is false):
- Always applicable (if enabled):
/speckit.review.code (general quality)
- If test files changed (if enabled):
/speckit.review.tests
- If comments/docs added (if enabled):
/speckit.review.comments
- If error handling changed (if enabled):
/speckit.review.errors
- If types added/modified (if enabled):
/speckit.review.types
- After passing review (if enabled):
/speckit.review.simplify (polish and refine)
- If an agent is disabled by config, note it in the final summary (e.g., "simplify: skipped (disabled in config)").
Launch Review Agents
Sequential approach (one at a time):
- Easier to understand and act on
- Each report is complete before next
- Good for interactive review
Parallel approach (user can request):
- Launch all agents simultaneously
- Faster for comprehensive review
- Results come back together
Aggregate Results
After agents complete, summarize:
- Critical Issues (must fix before merge)
- Important Issues (should fix)
- Suggestions (nice to have)
- Positive Observations (what's good)
Provide Action Plan
Organize findings:
# PR Review Summary
## Critical Issues (X found)
- [agent-name]: Issue description [file:line]
## Important Issues (X found)
- [agent-name]: Issue description [file:line]
## Suggestions (X found)
- [agent-name]: Suggestion [file:line]
## Strengths
- What's well-done in this PR
## Recommended Action
1. Fix critical issues first
2. Address important issues
3. Consider suggestions
4. Re-run review after fixes
Usage Examples:
Full review (default):
/speckit.review.run
Specific aspects:
/speckit.review.run tests errors
# Reviews only test coverage and error handling
/speckit.review.run comments
# Reviews only code comments
/speckit.review.run simplify
# Simplifies code after passing review
Parallel review:
/speckit.review.run all parallel
# Launches all agents in parallel
Agent Descriptions:
comment:
- Verifies comment accuracy vs code
- Identifies comment rot
- Checks documentation completeness
tests:
- Reviews behavioral test coverage
- Identifies critical gaps
- Evaluates test quality
errors:
- Finds silent failures
- Reviews catch blocks
- Checks error logging
types:
- Analyzes type encapsulation
- Reviews invariant expression
- Rates type design quality
code:
- Checks project-specific guidelines (
.specify/memory/constitution.md, CLAUDE.md, .github/copilot-instructions.md, or equivalent) compliance
- Detects bugs and issues
- Reviews general code quality
simplify:
- Simplifies complex code
- Improves clarity and readability
- Applies project standards
- Preserves functionality
Tips:
- Run early: Before creating PR, not after
- Focus on changes: Agents analyze diff by default
- Address critical first: Fix high-priority issues before lower priority
- Re-run after fixes: Verify issues are resolved
- Use specific reviews: Target specific aspects when you know the concern
Notes:
- Agents run autonomously and return detailed reports
- Each agent focuses on its specialty for deep analysis
- Results are actionable with specific file:line references
- Agents use appropriate models for their complexity
1---2name: speckit-review-run3description: Comprehensive code review using specialized agents — orchestrates code, comments, tests, errors, types, and simplify agents sequentially.4---56# Comprehensive PR Review78Run a comprehensive pull request review using multiple specialized agents, each focusing on a different aspect of code quality.910**Review Aspects (optional):** "$ARGUMENTS"1112## Review Workflow:13141. **Load Configuration**15 - Read the project config file at `.specify/extensions/review/review-config.yml` (if it exists).16 - If the file does not exist, fall back to the `defaults.agents` section in the extension's `extension.yml`.17 - Extract the `agents` map — each key (`code`, `comments`, `tests`, `errors`, `types`, `simplify`) is a boolean toggle.18 - Agents set to `false` **MUST** be excluded from this run. Do not launch them.19202. **Determine Review Scope**21 - Parse arguments to see if user requested specific review aspects.22 - If specific aspects were requested, run exactly those — config toggles do **not** apply (explicit user request overrides config).23 - Default (no arguments): Run all applicable reviews that are enabled in config.24253. **Available Review Aspects:**2627 - **comments** - Analyze code comment accuracy and maintainability28 - **tests** - Review test coverage quality and completeness29 - **errors** - Check error handling for silent failures30 - **types** - Analyze type design and invariants (if new types added)31 - **code** - General code review for project guidelines32 - **simplify** - Simplify code for clarity and maintainability33 - **all** - Run all applicable reviews (default)34354. **Identify Changed Files**3637 - If the user provided a file list or explicit instructions on how to retrieve files (e.g., only staged, only unstaged, a specific folder, etc.), follow those instructions directly.38 - Otherwise, you **MUST** execute the `.specify/scripts/bash/detect-changed-files.sh` with `--json` to detect changed files. **Do not** attempt to detect changes by running `git` commands directly, reading git state manually, or using any other method — always delegate to the script.39 - The script automatically picks the best detection mode:40 - **Mode A (feature branch):** diffs the current branch against the default branch (`main`/`master`) from the merge-base, plus any staged and unstaged changes.41 - **Mode B (working directory):** falls back to staged + unstaged changes when there is no feature branch (e.g., working directly on the default branch).42 - JSON output: `{"branch", "default_branch", "mode", "changed_files": [...]}`43 - **Note**: The folder containing the script may be excluded from version control or hidden by search indexing. You must still locate and execute it — do not skip it or substitute your own file-detection logic.44455. **Determine Applicable Reviews**4647 Based on changes **and** config toggles (skip any agent where `agents.<name>` is `false`):48 - **Always applicable** (if enabled): `/speckit.review.code` (general quality)49 - **If test files changed** (if enabled): `/speckit.review.tests`50 - **If comments/docs added** (if enabled): `/speckit.review.comments`51 - **If error handling changed** (if enabled): `/speckit.review.errors`52 - **If types added/modified** (if enabled): `/speckit.review.types`53 - **After passing review** (if enabled): `/speckit.review.simplify` (polish and refine)54 - If an agent is disabled by config, note it in the final summary (e.g., "simplify: skipped (disabled in config)").55566. **Launch Review Agents**5758 **Sequential approach** (one at a time):59 - Easier to understand and act on60 - Each report is complete before next61 - Good for interactive review6263 **Parallel approach** (user can request):64 - Launch all agents simultaneously65 - Faster for comprehensive review66 - Results come back together67687. **Aggregate Results**6970 After agents complete, summarize:71 - **Critical Issues** (must fix before merge)72 - **Important Issues** (should fix)73 - **Suggestions** (nice to have)74 - **Positive Observations** (what's good)75768. **Provide Action Plan**7778 Organize findings:79 ```markdown80 # PR Review Summary8182 ## Critical Issues (X found)83 - [agent-name]: Issue description [file:line]8485 ## Important Issues (X found)86 - [agent-name]: Issue description [file:line]8788 ## Suggestions (X found)89 - [agent-name]: Suggestion [file:line]9091 ## Strengths92 - What's well-done in this PR9394 ## Recommended Action95 1. Fix critical issues first96 2. Address important issues97 3. Consider suggestions98 4. Re-run review after fixes99 ```100101## Usage Examples:102103**Full review (default):**104```105/speckit.review.run106```107108**Specific aspects:**109```110/speckit.review.run tests errors111# Reviews only test coverage and error handling112113/speckit.review.run comments114# Reviews only code comments115116/speckit.review.run simplify117# Simplifies code after passing review118```119120**Parallel review:**121```122/speckit.review.run all parallel123# Launches all agents in parallel124```125126## Agent Descriptions:127128**comment**:129- Verifies comment accuracy vs code130- Identifies comment rot131- Checks documentation completeness132133**tests**:134- Reviews behavioral test coverage135- Identifies critical gaps136- Evaluates test quality137138**errors**:139- Finds silent failures140- Reviews catch blocks141- Checks error logging142143**types**:144- Analyzes type encapsulation145- Reviews invariant expression146- Rates type design quality147148**code**:149- Checks project-specific guidelines (`.specify/memory/constitution.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, or equivalent) compliance150- Detects bugs and issues151- Reviews general code quality152153**simplify**:154- Simplifies complex code155- Improves clarity and readability156- Applies project standards157- Preserves functionality158159## Tips:160161- **Run early**: Before creating PR, not after162- **Focus on changes**: Agents analyze diff by default163- **Address critical first**: Fix high-priority issues before lower priority164- **Re-run after fixes**: Verify issues are resolved165- **Use specific reviews**: Target specific aspects when you know the concern166167## Notes:168169- Agents run autonomously and return detailed reports170- Each agent focuses on its specialty for deep analysis171- Results are actionable with specific file:line references172- Agents use appropriate models for their complexity