/review - Multi-LLM Consensus Code Review
Performs comprehensive code review using Orchestre's multi-LLM review MCP tool to provide consensus-based feedback from multiple AI perspectives.
How It Actually Works
- Parse Arguments: Identifies files to review from input
- File Discovery:
- No args: Uses
git diff --name-only HEAD~5..HEAD - Patterns: Finds matching files with glob
- Specific files: Verifies they exist
- No args: Uses
- Read Contents: Reads up to 10 files (skips >10KB files)
- Call MCP Tool: Invokes
mcp__orchestre__multi_llm_reviewwith file array - Process Results: Organizes findings by priority level
- Present Feedback: Shows actionable review summary
Argument Structure
/review <files|pattern|git-ref>Arguments
- Empty or "." - Review recently changed files
- File paths - Review specific files (e.g.,
src/index.js src/utils.js) - Patterns - Review matching files (e.g.,
*.ts,src/**/*.js) - Git references - Review changes (e.g.,
HEAD~1,main...feature)
Multi-LLM Tool Details
The mcp__orchestre__multi_llm_review tool:
- Sends code to multiple LLMs for analysis
- Builds consensus from different perspectives
- Returns structured feedback including:
- Security vulnerabilities
- Performance issues
- Code quality assessment
- Improvement suggestions
- Best practice violations
Example Usage
Review Recent Changes
bash
/orchestre:review (MCP)
# Then just press enter or type "."Review Specific Files
bash
/orchestre:review (MCP)
# Then: src/auth.js src/user.jsReview by Pattern
bash
/orchestre:review (MCP)
# Then: src/**/*.tsReview PR Changes
bash
/orchestre:review (MCP)
# Then: main...HEADOutput Format
The review provides:
Code Review Summary
==================
Files reviewed: 3
🔴 Critical Issues (2):
- [src/auth.js:45] SQL injection vulnerability in login query
Fix: Use parameterized queries
- [src/api.js:23] API key exposed in client code
Fix: Move to environment variables
🟡 Important Issues (3):
- [src/user.js:67] Missing error handling for database calls
Suggestion: Add try-catch blocks
🟢 Suggestions (5):
- [src/utils.js:12] Function could be simplified
Consider using array methods
Good Practices Observed:
- Consistent error messages
- Clear function naming
- Good test coverage
Next Steps:
1. Fix SQL injection vulnerability immediately
2. Remove API key from client code
3. Add error handling to database operationsFocus Areas
You can specify areas to focus on:
- Security: Authentication, authorization, data validation
- Performance: Database queries, algorithms, caching
- Maintainability: Code structure, naming, documentation
- Best Practices: Error handling, testing, patterns
Requirements
The multi_llm_review tool requires:
GEMINI_API_KEYand/orOPENAI_API_KEYenvironment variables- At least one AI provider configured
- Valid file content (not binary files)
Technical Details
Review Output Organization
The prompt organizes findings by priority:
Priority Levels:
- 🔴 Critical: Security vulnerabilities, data loss risks, breaking bugs
- 🟡 Important: Performance issues, error handling, maintainability
- 🟢 Suggestions: Style improvements, refactoring opportunities
MCP Tool Call Structure
The prompt calls mcp__orchestre__multi_llm_review with:
json
{
"files": [
{
"path": "src/auth.js",
"content": "// Full file content..."
},
{
"path": "src/utils.js",
"content": "// Full file content..."
}
],
"context": "Brief description of what's being reviewed"
}File Discovery Methods
Recent changes (no args):
bashgit diff --name-only HEAD~5..HEAD | head -20Pattern matching:
bashls -la src/**/*.ts 2>/dev/null | head -20Specific files:
bashtest -f "file.js" && echo "Found: file.js"
Integration
This prompt integrates with:
- /orchestre:execute-task (MCP): Review before implementing
- /orchestre:security-audit (MCP): Deeper security analysis
- /orchestre:document-feature (MCP): Document review findings
Common Patterns
Pre-commit Review
bash
# Review staged changes
git diff --cached --name-only | xargs /orchestre:review (MCP)Feature Branch Review
bash
# Review all changes in feature branch
/orchestre:review (MCP) main...feature-branchDirectory Review
bash
# Review entire module
/orchestre:review (MCP) src/auth/**/*Notes
- Reviews are limited to 10 files for performance
- Large files (>10KB) are skipped
- Binary files are automatically excluded
- Consensus building provides balanced feedback
- All findings are actionable with specific fixes
