/reviewdeep Command
Executes comprehensive multi-perspective code review with parallel technical analysis and solo developer security focus.
/plugin marketplace add jleechanorg/claude-commands/plugin install claude-commands@claude-commands-marketplaceWhen this command is invoked, YOU (Claude) must execute these steps immediately: This is NOT documentation - these are COMMANDS to execute right now. Use TodoWrite to track progress through multi-phase workflows.
Action Steps:
The command delegates to /execute for intelligent orchestration of components:
/execute Perform enhanced consensus + comprehensive review:
1. /consensus [target] # Fast consensus building (2-5 minutes)
- Multi-agent agreement using 4 parallel agents
- Quick architectural and correctness validation
- Early identification of critical issues
- 3-round maximum with early termination
2. /guidelines # Centralized mistake prevention consultation
3. Evaluate consensus result:
- If **CONSENSUS_REWORK**: Summarize blockers, halt here, and request fixes before deep review.
- If **MIXED_SIGNALS**: Proceed to Stage 2 with targeted focus areas provided by consensus agents.
- If **CONSENSUS_PASS**: Proceed to full Stage 2 execution.
4. When Stage 2 runs, launch PARALLEL EXECUTION:
Track A (Technical - Fast): /cerebras comprehensive technical analysis [target] (SOLO DEV FOCUS)
- Security vulnerability scanning (real vulnerabilities only)
- Trusted source detection (GitHub API, package managers)
- Functional bugs and performance issues
- Architecture pattern analysis
- Performance bottleneck identification
- Filter out enterprise paranoia (JSON schema validation for trusted APIs)
Track B (Technical - Deep): /arch [target] + Independent code-review subagent synthesis + gemini-consultant + cursor-consultant + codex-consultant + code-centralization-consultant
- System design and scalability analysis
- Integration patterns and dependencies
- Code quality and maintainability assessment
- Comprehensive multi-dimensional analysis (Gemini CLI consultation)
- Unconventional insights and contrarian analysis (Cursor consultation)
- Multi-stage deep code analysis (Codex CLI consultation)
- Consolidation and duplication remediation roadmap (Code Centralization consultation)
Track C (AI Research): Perplexity MCP comprehensive review [target] (gpt-5 model)
- OWASP security standards and latest vulnerability research
- Industry best practices and proven approaches
- Performance optimization and benchmarking insights
- Emerging security patterns and prevention techniques
- Real-world code review expertise from security communities
5. /reviewe [target] # Enhanced code review with security analysis
6. Synthesis & PR guidelines # Combine consensus + all three tracks + generate docs/pr-guidelines/{PR_NUMBER}/guidelines.md
The /execute delegation ensures optimal execution with:
7. Always-Parallel Review Tracks: Default simultaneous execution of technical (/cerebras), architectural (/arch), and AI research (Perplexity) analysis for significant speed improvement
8. Guidelines Generation: Automatically creates docs/pr-guidelines/{PR_NUMBER}/guidelines.md with PR-specific mistake prevention patterns
9. Guidelines Integration: Consults existing docs/pr-guidelines/base-guidelines.md (general patterns) and generates PR-specific guidelines
10. Anti-Pattern Application: Analyzes review findings to document new mistake patterns and solutions
11. Intelligent Synthesis: Combines technical and strategic findings into comprehensive recommendations
12. Progress tracking via TodoWrite
13. Auto-approval for review workflows
14. Optimized parallel execution for maximum speed
Each command is executed with the same target parameter passed to /reviewdeep.
Action Steps:
/review + /cerebras - code quality, security, performance analysis/arch - structural and architectural concernsAction Steps: 🚨 POSTS TO GITHUB PR
Action Steps:
Action Steps:
/reviewdeep now leverages parallel execution for dramatic speed improvements while maintaining comprehensive analysis quality.
Command Summary: Comprehensive multi-perspective review through parallel execution with significant speed optimization (2.4x overall improvement) and SOLO DEVELOPER SECURITY FOCUS
Purpose: Deep analysis combining code review, architectural assessment, and ultra thinking for complete evaluation with practical security focus for solo developers (filters out enterprise paranoia, emphasizes real vulnerabilities)
/reviewdeep # Review current branch/PR (default)
/reviewdeep <pr_number|file|feature> # Review specific target
/reviewd # Short alias for current branch/PR
/reviewd <pr_number|file|feature> # Short alias with specific target
/reviewdeep = Parallel execution of Technical Track (/cerebras analysis) + Strategic Track (/arch + Claude synthesis) + /reviewe + MCP integrations + SOLO DEVELOPER SECURITY FILTERING
The command executes dual parallel review tracks by default with mandatory MCP integration for comprehensive analysis with significant speed improvement (2.4x overall). Solo developer security focus: Filters out enterprise paranoia, focuses on real exploitable vulnerabilities, and includes trusted source detection. Speed is always prioritized.
/reviewe - Enhanced Review with Official Integration🚨 POSTS COMPREHENSIVE COMMENTS
/review command provides baseline analysis/arch - Architectural Assessment/cerebras Fast Analysis/arch + Independent Code-Review Subagent + Comprehensive External AI AnalysisINPUT: PR/Code/Feature
↓
/EXECUTE ORCHESTRATION:
├─ Plans optimal parallel workflow
├─ Auto-approves review tasks
└─ Tracks progress via TodoWrite
↓
EXECUTE: /guidelines
└─ Centralized mistake prevention consultation
↓
PARALLEL EXECUTION (Speed Optimized):
├─ Track A (Technical - Fast): /cerebras analysis
│ ├─ Solo developer focus: Functional bugs, hangs, and real vulnerabilities only
│ ├─ Architecture pattern analysis
│ └─ Performance bottleneck identification
├─ Track B (Technical - Deep): /arch + Independent code-review subagent + gemini-consultant + cursor-consultant + codex-consultant + code-centralization-consultant
│ ├─ System design and scalability assessment
│ ├─ Integration patterns and dependencies
│ ├─ Code quality and maintainability analysis
│ ├─ Comprehensive multi-dimensional analysis (Gemini CLI consultation)
│ ├─ Unconventional insights and contrarian analysis (Cursor consultation)
│ ├─ Multi-stage deep code analysis (Codex CLI consultation)
│ └─ Consolidation blueprints and duplication risk assessment (Code Centralization consultation)
└─ Track C (AI Research): Perplexity MCP review (gpt-5)
├─ OWASP security standards and vulnerability research
├─ Industry best practices and optimization insights
└─ Emerging security patterns and prevention techniques
↓
EXECUTE: /reviewe [target]
├─ Runs official /review → Native Claude Code review
└─ Runs enhanced analysis → Multi-pass security & quality review
└─ Posts GitHub PR comments
↓
SYNTHESIS & GUIDELINES:
├─ Combines technical and strategic findings from all tracks
├─ **MANDATORY Agent Output Integration**:
│ ├─ Gemini CLI Consultation Summary (correctness, architecture, security findings)
│ ├─ Cursor Consultation Summary (unconventional insights, practical reality checks)
│ ├─ Codex CLI Deep Analysis Summary (bugs, vulnerabilities, performance issues)
│ ├─ Code Centralization Consultation Summary (duplication hotspots, shared utility plans)
│ │ └─ Metrics: Lines of code removed, modules unified, complexity reductions
│ └─ External AI Perspective Synthesis (alternative viewpoints and validation)
├─ Generates prioritized recommendations across all analysis dimensions
└─ Creates docs/pr-guidelines/{PR_NUMBER}/guidelines.md with agent insights
↓
MCP INTEGRATION (automatic within each track):
├─ Context7 MCP → Up-to-date API documentation
├─ Gemini MCP → Multi-role AI analysis
└─ Perplexity MCP → Research-based security insights
↓
OUTPUT: Comprehensive multi-perspective analysis with significant speed improvement (2.4x overall)
The /reviewdeep command now implements intelligent context detection to distinguish between trusted and untrusted data sources, providing security analysis appropriate for solo developers:
IF data_source IN trusted_sources:
SKIP enterprise_paranoia_checks
FOCUS ON implementation_vulnerabilities
VALIDATE integration_points_only
ELSE:
APPLY full_security_analysis
REPORT all_vulnerability_categories
PROVIDE detailed_risk_assessment
END
Default Behavior: --solo-dev-focus (automatically applied)
Override Options:
--enterprise-mode - Full enterprise-level analysis (disables filtering)--trust-level [strict|moderate|lenient] - Adjust trusted source thresholds--include-theoretical - Include low-probability theoretical risksWhen /reviewdeep is invoked, it delegates to /execute for orchestration:
/execute Perform enhanced parallel review with comprehensive multi-perspective analysis:
Step 1: Execute guidelines consultation
/guidelines
Step 2: PARALLEL EXECUTION (Speed Optimized):
Track A (Technical - Fast): /cerebras comprehensive technical analysis [target]
- Solo developer functional issue assessment
- Architecture pattern evaluation
- Performance bottleneck analysis
Track B (Technical - Deep): /arch [target] + Independent code-review subagent
- System design and scalability analysis
- Technical integration patterns
- Code quality and maintainability recommendations
Step 3: Execute enhanced review and post comments
/reviewe [target]
Step 4: Synthesize parallel findings
Combine fast and deep technical analysis into prioritized technical recommendations
Step 5: Generate PR-specific guidelines from combined findings
Create docs/pr-guidelines/{PR_NUMBER}/guidelines.md with documented patterns and solutions
The /execute delegation provides:
Important: Each command must be executed with the same target parameter. If no target is provided, all commands operate on the current branch/PR.
# Review current branch/PR with solo developer security focus (most common usage)
/reviewdeep
# This executes: /guidelines → PARALLEL(/cerebras technical + /arch deep) → /reviewe → synthesis + SOLO DEV FILTERING
/reviewd
# Review a specific PR with solo developer context detection
/reviewdeep 592
# Automatically detects trusted sources (GitHub API calls) and filters enterprise paranoia
/reviewd #592
# Review a file with context-aware security analysis
/reviewdeep ".claude/commands/pr.py"
# Analyzes real vulnerabilities, skips theoretical concerns for solo developers
/reviewd "GitHub integration feature"
# Override for enterprise-level analysis (when needed)
/reviewdeep --enterprise-mode "security-critical-feature"
# Disables trusted source filtering, applies full enterprise security checks
/review: Official built-in code review (basic)/reviewe: Enhanced review (official + advanced analysis)/arch: Architectural assessment only/cerebras: Fast technical analysis (security, architecture, performance)/reviewdeep: Parallel execution of technical + strategic tracks for comprehensive analysis with significant speed improvement + SOLO DEVELOPER SECURITY FOCUS (filters enterprise paranoia)When /reviewdeep completes parallel execution, the final synthesis MUST include:
1. Gemini CLI Analysis Summary
2. Codex CLI Deep Analysis Summary
3. External AI Perspective Synthesis
MANDATORY Output Format:
## 🤖 External AI Consultation Results
### Gemini CLI Multi-Dimensional Analysis
[Detailed summary of architecture, security, performance, correctness findings]
### Codex CLI Deep Code Analysis
[Detailed summary of bug detection, vulnerability analysis, performance issues]
### Cross-Model Validation
[Areas of agreement, divergent perspectives, priority recommendations]
### External AI Priority Issues
[Top 5 issues identified across both consultations with remediation suggestions]
This ensures that the valuable insights from external AI models are captured, synthesized, and presented as part of the comprehensive review output.
Building on the code-level checks from /reviewe, this phase analyzes system-wide patterns:
/reviewdeep automatically generates PR-specific guidelines based on review findings:
PR Context Detection:
pr-1286-feature, fix-1286-bug)docs/branch-guidelines/{BRANCH_NAME}/guidelines.md/reviewdeep --pr 1286File Location:
docs/pr-guidelines/{PR_NUMBER}/guidelines.md (e.g., docs/pr-guidelines/1286/guidelines.md)docs/branch-guidelines/{BRANCH_NAME}/guidelines.md (e.g., docs/branch-guidelines/feature-auth/guidelines.md)Generation Process:
/reviewe, /arch, and /thinku analysisGenerated guidelines file includes:
# PR #{PR_NUMBER} Guidelines - {PR_TITLE}
## 🎯 PR-Specific Principles
- Core principles discovered from this PR's analysis
## 🚫 PR-Specific Anti-Patterns
### ❌ **{Pattern Name}**
{Description of wrong pattern found}
{Code example showing the problem}
### ✅ **{Correct Pattern}**
{Description of correct approach}
{Code example showing the solution}
## 📋 Implementation Patterns for This PR
- Specific patterns and best practices discovered
- Tool selection guidance based on what worked
## 🔧 Specific Implementation Guidelines
- Actionable guidance for similar future work
- Quality gates and validation steps
docs/pr-guidelines/{PR_NUMBER}/ (consistent with base guidelines organization)guidelines.md (standardized name)docs/pr1286/guidelines.mddocs/pr592/guidelines.mddocs/pr1500/guidelines.mdmcp__gemini-cli-mcp__gemini_chat_pro for primary analysismcp__perplexity-ask__perplexity_ask for research insightsTechnical Analysis Component:
Full Review Execution:
Technical Track (Fast):
/cerebras for rapid technical analysisTechnical Deep Track (Comprehensive):
/arch + Independent code-review subagentTotal Execution: 5-8 minutes vs previous 12+ minutes (2.4x overall improvement)
If /cerebras is unavailable, the command gracefully falls back to parallel execution using independent code-review subagent for Track A while maintaining Track B. Sequential execution is only used as final fallback.
/execute's existing parallel execution capabilities