Review Orchestrator
Dispatches multiple review subagents in parallel, compiles and deduplicates their feedback, and presents a triaged list for human decision.
Configuration
Uses the production API by default. No configuration needed for read operations.
Defaults (no setup required):
- API URL:
https://api-gateway-856475788601.us-central1.run.app - Read-only endpoints at
/public/*require no authentication
For write operations (transitions), set:
export PIPELINE_API_KEY="..." # Get from GCP Secret Manager or ask admin
When to Use
- Quality gates have passed (lint, typecheck, tests)
- Code changes are ready for review
- Before creating a PR
Prerequisites
- CodeRabbit CLI installed:
which coderabbit - Authenticated:
coderabbit auth login - Pro tier allows 8 reviews/hour
Workflow
1. Verify Readiness
# Check CodeRabbit installed
which coderabbit
# Check there are changes to review
git status --porcelain
git diff --stat HEAD~1 # or vs base branch
If no changes or CodeRabbit missing, stop and inform user.
2. Gather Context
Get ticket context from the public API (no auth required):
const API_URL = process.env.PIPELINE_API_URL || 'https://api-gateway-856475788601.us-central1.run.app'
const response = await fetch(`${API_URL}/public/tickets/${ticketId}`)
const ticket = await response.json()
const ticketRequirements = ticket.description
Also collect:
- List of changed files:
git diff --name-only HEAD~1 - Plan file if available locally
3. Dispatch Review Subagents
Use the Task tool to dispatch three parallel review subagents:
Subagent 1: CodeRabbit Review
Run CodeRabbit CLI review on the current changes.
Commands:
cd {REPO_PATH}
coderabbit --prompt-only --type uncommitted
Parse output and categorize findings by severity:
- Critical: Security, race conditions, data loss
- Major: Logic errors, performance, missing error handling
- Minor: Code style, naming
- Nitpick: Formatting preferences
Return structured list with file:line, issue, suggested fix.
Subagent 2: Agent Code Review
Perform comprehensive code review of the changes.
Files to review: {FILES_LIST}
Ticket requirements: {TICKET_REQUIREMENTS}
Review Checklist:
1. Functionality: Implements requirements, handles edge cases, proper error handling
2. Code Quality: TypeScript (no any), Vue (Composition API), Tailwind (no dark:), naming conventions
3. Architecture: Follows existing patterns, no over-engineering, clean separation
4. Testing: Tests added, behavioral not change detectors, edge cases covered
5. Security: No secrets exposed, input validation, no XSS/injection
6. Performance: No unnecessary re-renders, efficient data structures
Return findings with severity (Critical/Major/Minor), location (file:line), and fix suggestion.
Subagent 3: Pattern Compliance Review
Check code against target repository patterns and AGENTS.md guidelines.
Files to review: {FILES_LIST}
Check for violations:
- Vue: Reactive props destructuring (not withDefaults), separate type imports
- Tailwind: No dark: variants (use semantic themes), use cn() utility, no !important
- TypeScript: No any types, no as any assertions
- State: No unnecessary computed/watch when simpler works
- Testing: Behavioral tests, not change detectors or mock tests
Return violations with file:line and the correct pattern to use.
4. Compile and Deduplicate
After all subagents complete:
- Merge findings from all three reviewers
- Remove duplicates: Same issue found by multiple reviewers (note "Found by: CodeRabbit, Agent")
- Resolve conflicts: If reviewers disagree, note both perspectives with recommendation
- Group by file: Organize findings by file path
- Sort by severity: Critical → Major → Minor → Nitpick
5. Generate Review Summary
Create structured output:
# Code Review Summary
## Statistics
- Total findings: {count}
- Critical: {count}
- Major: {count}
- Minor: {count}
- Nitpicks: {count}
- Duplicates removed: {count}
## Critical Issues (Must Fix)
### [C1] {Title}
- **File:** `path/to/file.ts:42`
- **Source:** CodeRabbit / Agent / Pattern
- **Issue:** {description}
- **Fix:**
```typescript
// Suggested fix
```
Major Issues (Should Fix)
[M1] {Title}
- File:
path/to/file.ts:55 - Source: {source}
- Issue: {description}
- Fix: {suggestion}
Minor Issues (Consider)
[m1] {Title}
- File:
path/to/file.ts:10 - Issue: {description}
- Fix: {suggestion}
Nitpicks (Optional)
- [N1]
file.ts:10- {description} - [N2]
file.ts:20- {description}
Conflicting Opinions
{Topic}
- CodeRabbit says: {opinion}
- Agent says: {opinion}
- Recommendation: {which to follow and why}
### 6. Present Triage Interface
Review complete. {X} findings across {Y} files.
For each finding, respond with:
- Numbers to implement (e.g., "C1, M1, M3")
- "all critical" - implement all critical
- "all major" - implement all critical + major
- "all" - implement everything
- "skip N1, N2" - skip specific items
- "clarify M2" - need more info on item
Your response:
Wait for human decision.
### 7. Save Review Locally
Save full review to local `review-comments.md`:
- Complete review summary
- All findings with full details
- Human's triage decisions
- Timestamp
```markdown
## Triage Decisions
- Selected: ["C1", "M1", "M2"]
- Skipped: ["N1", "N2"]
- Timestamp: {timestamp}
8. Handle Implementation
For selected items:
- Dispatch fix subagents for each selected item, OR
- Return to implementation phase with specific fix list
After fixes, re-run affected quality gates to verify.
Severity Definitions
| Severity | Description | Action |
|---|---|---|
| Critical | Security issues, race conditions, data loss, breaking bugs | Must fix before PR |
| Major | Logic errors, performance issues, missing error handling | Should fix |
| Minor | Code style, naming, documentation | Consider fixing |
| Nitpick | Formatting, personal preference | Optional |
Rate Limiting
CodeRabbit Pro: 8 reviews/hour. Track usage and warn if approaching limit.
Fallback
If CodeRabbit is unavailable:
- Skip CodeRabbit subagent
- Note in review summary: "CodeRabbit review skipped: {reason}"
- Continue with Agent and Pattern reviews
Local Working Artifacts
| Artifact | Location | Notes |
|---|---|---|
| Review comments | review-comments.md | Full review output, stays local |
Notes
- Review orchestrator does not change ticket state—it stays in IMPLEMENTATION
- Ticket context comes from the API
- Review output is saved locally as a working artifact
