description: /consensus Command - Multi-Agent Consensus Review
Executes fast multi-agent consensus reviews for code, specs, or operational decisions using parallel agent analysis.
/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:
Purpose: Fast consensus-building analysis for solo MVP projects using 2025 multi-agent protocols. Supports code reviews, product spec validation, launch-readiness assessments, and other decision-heavy tasks. Uses a simple 3-round maximum with early termination when agents agree. Focus on pragmatic outcomes over enterprise-grade security theater.
β‘ Performance: 2-5 minutes total with parallel agent execution and smart early termination.
π Solo Unlaunched MVP Context: Optimized for pre-launch projects with ZERO external users. Only serious external attacker security vulnerabilities matter (SQL injection, RCE, auth bypass). Enterprise security theater is counterproductive. GitHub rollbacks provide safety net.
/consensus adapts to the given scope. Claude must select an execution mode before delegating:
When scope is ambiguous, ask the user which mode they want via TodoWrite before executing.
/consensus [<scope>]
/cons [<scope>] # Alias
gh pr status or git config branch.<name>.merge to extract the PR number and remote.git log -1 --stat.git status --short for staged/unstaged files.git diff --stat and targeted git diff snippets for modified files.gh pr view <pr> --json files,headRefName,baseRefName.git rev-parse HEAD vs PR head SHA).Fast Multi-Agent Consensus: Run 5 agents in parallel and calculate simple majority agreement. Pick the correct agent set for the selected mode:
code-review, codex-consultant, gemini-consultant, cursor-consultant, code-centralization-consultantaccuracy-reviewer, evidence-verifier, product-strategist, delivery-ops, clarity-editorrisk-analyst, product-strategist, delivery-ops, customer-advocate, exec-synthesizerSuccess threshold: 3+ of 5 agents PASS with average confidence β₯6
Failure threshold: 3+ agents REWORK OR average confidence <5
Mixed signals: Document disagreements, proceed with majority decision, and flag open questions.
Simple Consensus Calculation:
Agent Specialization:
code-review: Architecture validation, correctness, maintainabilitycodex-consultant: System design patterns, scalability foundationsgemini-consultant: 2025 best practices, performance optimizationcursor-consultant: Practical concerns, deployment readinesscode-centralization-consultant: Duplication detection, shared utility recommendationsaccuracy-reviewer: Verifies factual correctness and catches contradictionsevidence-verifier: Cross-checks claims against attached logs, tests, or referencesproduct-strategist: Evaluates alignment with product goals and user outcomesdelivery-ops: Checks operational feasibility, rollout risks, and support readinessclarity-editor: Improves narrative flow, highlights ambiguous sections, ensures stakeholder readabilityrisk-analyst: Identifies blockers, severity, and mitigation pathsproduct-strategist: Confirms alignment with roadmap and KPIsdelivery-ops: Evaluates team capacity, timeline, and implementation complexitycustomer-advocate: Represents user experience and support impactexec-synthesizer: Creates concise go/no-go recommendations with rationaleAgent Infrastructure: Uses existing Task tool with subagent_type parameter for parallel multi-agent coordination. Follows proven patterns from /reviewdeep and /arch commands with optimized execution orchestration. Claude must supply mode-specific prompts and evaluation criteria when launching each agent.
Execution Guards: Per-agent timeout (180 seconds), token caps (5000 tokens max), and maximum 10 findings per round to prevent runaway executions. Enhanced with context-aware resource allocation.
Command Orchestration: Delegates to /execute for intelligent coordination following /reviewdeep optimization patterns:
Agent Execution: Launch 5 agents in parallel using Task tool with 180-second timeout. Provide custom prompts per mode:
Solo MVP Context Applied to All Agents:
Implementation Details:
code-review: Task(subagent_type="code-review", description="Architecture validation", prompt="...")codex-consultant: Task(subagent_type="codex-consultant", description="System design analysis", prompt="...")gemini-consultant: Task(subagent_type="gemini-consultant", description="Best practices review", prompt="...")cursor-consultant: Task(subagent_type="cursor-consultant", description="Practical reality check", prompt="...")code-centralization-consultant: Task(subagent_type="code-centralization-consultant", description="Duplication analysis", prompt="...")Speed Optimizations:
Streamlined workflow optimized for speed and simplicity:
Parallel Agent Consultation (2-3 minutes)
Simple Consensus Calculation (30 seconds)
Quick Fix Application (If REWORK, 1-2 minutes)
Automated Test Validation (1-3 minutes)
# Auto-detect and run project-specific linters
if command -v npm >/dev/null 2>&1 && [ -f package.json ] && npm run --silent 2>/dev/null | grep -q "lint"; then
npm run lint
elif command -v eslint >/dev/null 2>&1; then
eslint .
elif command -v flake8 >/dev/null 2>&1; then
flake8 .
elif command -v ruff >/dev/null 2>&1; then
ruff check .
else
echo "No supported linter found - manual validation required"
fi
# Auto-detect test framework and run relevant tests
if command -v npm >/dev/null 2>&1 && [ -f package.json ] && npm run --silent 2>/dev/null | grep -q "test"; then
npm test
elif command -v vpython >/dev/null 2>&1; then
env TESTING=true python -m pytest
elif command -v python3 >/dev/null 2>&1; then
env TESTING=true python3 -m pytest
elif command -v python >/dev/null 2>&1; then
env TESTING=true python -m pytest
else
echo "No recognized test runner found - manual validation required"
fi
# Run integration test suite if available
npm run test:integration \
|| ( [ -x ./run_tests.sh ] && ./run_tests.sh ) \
|| ( [ -x ./run_ui_tests.sh ] && ./run_ui_tests.sh mock )
Context-Aware Validation:
Simplified Test/Validation Detection (Code Review Mode):
# Safe test command detection with proper validation
if command -v npm >/dev/null 2>&1 && [ -f "package.json" ] && npm run --silent 2>/dev/null | grep -q "test"; then
timeout 300 npm test
elif [ -f "pytest.ini" ] || [ -f "pyproject.toml" ]; then
timeout 300 env TESTING=true python -m pytest 2>/dev/null || timeout 300 env TESTING=true python3 -m pytest
elif [ -f "run_tests.sh" ] && [ -x "run_tests.sh" ]; then
timeout 300 ./run_tests.sh
else
echo "No automated tests detected - skipping test validation"
fi
For documentation and decision scopes, replace automated tests with evidence checklists and explicit sign-off from responsible agents.
The loop stops immediately when a round achieves PASS status or after three rounds (whichever occurs first).
# Consensus Review Report
## Summary
- Round count: <1-3>
- Final status: PASS | REWORK_LIMIT_REACHED | VALIDATION_ABORT
- Mode: Code Review | Documentation & Spec | Operational Decision
- Key validated areas
## Major Findings
| Round | Source Agent | File/Section/Artifact | Severity | Resolution |
|-------|--------------|------------------------|----------|------------|
## Implemented Fixes / Actions
- <bullet list of code updates, document edits, or operational decisions per round>
## Evidence & Validation Log
- Tests run / evidence cross-checked / stakeholders consulted
## Round-by-Round Summaries
- Round <n>: <main conversation highlights>
- <agent name>: <key takeaways>
## Remaining Follow-Ups
- <nitpicks, deferred improvements, outstanding risks>
Include references to executed test commands, reviewed evidence files, and any required stakeholder approvals.
The solo MVP assumptions remain, but the emphasis shifts with each mode.
Following /reviewdeep and /arch patterns for proper agent context. Claude must adapt the templates per mode.
[Agent Role] consensus analysis of [target] for solo MVP project context.
**ENHANCED CONTEXT FRAMEWORK**:
- **Project Type**: Solo MVP (pre-launch, GitHub rollbacks available for safety)
- **Current Scope**: [scope definition, e.g., PR details, document path, decision statement]
- **Infrastructure**: Working multi-agent consensus system using Task tool parallel execution
- **Agent Network**: Part of 5-agent consensus ([list selected agents])
- **Goal**: Fast consensus-building with 3-round maximum, early termination on agreement
- **Mode**: Code Review | Documentation & Spec | Operational Decision (pick one)
**ROLE-SPECIFIC CONTEXT SPECIALIZATION**:
- Outline what this agent must evaluate based on the chosen mode
**COMPREHENSIVE ANALYSIS FRAMEWORK**:
1. **Strategic Layer**: Architecture/design/product implications
2. **Tactical Layer**: Implementation details, factual accuracy, or operational feasibility
3. **Consensus Layer**: Inter-agent agreement consideration, conflict resolution
4. **Solo MVP Reality**: No team constraints, practical deployment focus, rollback safety net
5. **Speed Optimization**: Fast analysis with early termination on critical issues
**MODE-FOCUSED CHECKLIST**:
- Provide targeted bullet list (bugs/security for code, evidence/log links for docs, risks/mitigations for decisions)
**OUTPUT REQUIREMENTS FOR CONSENSUS**:
- Verdict: PASS/REWORK with confidence score (1-10)
- Evidence: Mode-appropriate references (file:line, section heading, metric source, stakeholder signal)
- Summary: 2-3 bullet highlights tailored to the mode
- Recommended next actions if verdict is REWORK
code-review Agent Context:ARCHITECTURAL CORRECTNESS & MVP MAINTAINABILITY analysis for solo MVP consensus.
**Your Specialization**: Architecture quality, SOLID principles, code maintainability
**Context Awareness**: You are the architectural authority in the mode-selected consensus system
**Focus Priority**: Design patterns, technical debt, scalability foundations
**Consensus Role**: Architecture quality gatekeeper - block on fundamental design flaws
**Solo MVP Lens**: Practical architecture that supports rapid iteration and deployment
codex-consultant Agent Context:SYSTEM DESIGN & SCALING INTELLIGENCE analysis for solo MVP consensus.
**Your Specialization**: Advanced system architecture, performance, distributed patterns
**Context Awareness**: You provide the scaling perspective in the consensus-building process
**Focus Priority**: Performance bottlenecks, database design, system integration patterns
**Consensus Role**: Scalability validator - ensure architecture supports growth
**Solo MVP Lens**: Foundation for scaling without over-engineering initial implementation
gemini-consultant Agent Context:2025 BEST PRACTICES & OPTIMIZATION PATTERNS analysis for solo MVP consensus.
**Your Specialization**: Modern frameworks, security best practices, optimization patterns
**Context Awareness**: You ensure modern standards in consensus evaluation
**Focus Priority**: Latest patterns, security (practical not paranoid), performance optimization
**Consensus Role**: Best practices validator - ensure code follows 2025 standards
**Solo MVP Lens**: Modern practices adapted for solo developer speed and efficiency
cursor-consultant Agent Context:PRAGMATIC REALITY CHECK & DEPLOYMENT READINESS analysis for solo MVP consensus.
**Your Specialization**: Contrarian analysis, real-world deployment, practical concerns
**Context Awareness**: You are the final reality check in the consensus process
**Focus Priority**: Deployment practicalities, real failure modes, solo developer workflow
**Consensus Role**: Reality validator - ensure recommendations are actually implementable
**Solo MVP Lens**: What actually works in production vs theoretical perfection
code-centralization-consultant Agent Context:DUPLICATION & SHARED UTILITY analysis for solo MVP consensus.
**Your Specialization**: Identify redundant logic, recommend shared abstractions
**Context Awareness**: You ensure code reuse and centralization opportunities are surfaced
**Focus Priority**: Refactoring leverage, shared modules, maintainability boosts
**Consensus Role**: Highlight consolidation wins without blocking progress unnecessarily
**Solo MVP Lens**: Balance reuse with speed; favor pragmatic consolidation wins
accuracy-reviewer Agent Context:FACTUAL ACCURACY & CONSISTENCY analysis for documentation/spec consensus.
**Your Specialization**: Detect incorrect statements, contradictions, and missing citations
**Context Awareness**: You ensure every claim maps to trusted evidence sources
**Focus Priority**: Metrics, timelines, feature descriptions, terminology
**Consensus Role**: Block on factual errors; approve when statements align with evidence
**Solo MVP Lens**: Precision over polishβensure the team can trust the document
evidence-verifier Agent Context:EVIDENCE TRACEABILITY & VALIDATION analysis for documentation/spec consensus.
**Your Specialization**: Cross-reference claims with logs, tests, and attached artifacts
**Context Awareness**: You validate that cited data truly exists and matches the narrative
**Focus Priority**: Test reports, response payloads, metrics exports
**Consensus Role**: Confirm evidence sufficiency or request additional validation
**Solo MVP Lens**: Lightweight but rigorous verification of launch-critical facts
clarity-editor Agent Context:CLARITY & COMMUNICATION analysis for documentation/spec consensus.
**Your Specialization**: Improve readability, highlight ambiguity, ensure stakeholders understand decisions
**Context Awareness**: You advocate for concise, high-signal documentation
**Focus Priority**: Structure, terminology, actionability, unanswered questions
**Consensus Role**: Flag comprehension blockers; suggest concise rewrites when necessary
**Solo MVP Lens**: Keep docs fast to read so execution can continue at speed
product-strategist Agent Context (shared across documentation/operational modes):PRODUCT STRATEGY ALIGNMENT analysis for consensus.
**Your Specialization**: Connect scope to roadmap, user value, and KPIs
**Context Awareness**: You anchor recommendations in product outcomes
**Focus Priority**: Goal alignment, trade-offs, success metrics
**Consensus Role**: Ensure decisions advance the product vision and guardrails
**Solo MVP Lens**: Prioritize moves that unblock learning and launch velocity
delivery-ops Agent Context (shared across documentation/operational modes):DELIVERY OPERATIONS & EXECUTION analysis for consensus.
**Your Specialization**: Evaluate feasibility, owner readiness, and rollout plans
**Context Awareness**: You balance ambition with capacity and process safety
**Focus Priority**: Timelines, dependencies, tooling readiness, runbooks
**Consensus Role**: Flag missing owners or steps that could jeopardize launch
**Solo MVP Lens**: Lightweight processes, but no hidden blockers
risk-analyst Agent Context:RISK & MITIGATION analysis for operational decision consensus.
**Your Specialization**: Surface critical risks, severity, likelihood, and mitigations
**Context Awareness**: You provide the risk register and escalation triggers
**Focus Priority**: Launch blockers, compliance obligations, customer-impacting defects
**Consensus Role**: Recommend go/no-go posture based on residual risk
**Solo MVP Lens**: Focus on existential threats, skip theoretical edge cases
customer-advocate Agent Context:CUSTOMER EXPERIENCE & SUPPORT IMPACT analysis for operational decision consensus.
**Your Specialization**: Represent user experience, onboarding friction, and support volume
**Context Awareness**: You translate technical choices into customer outcomes
**Focus Priority**: Onboarding flows, communication plans, support load
**Consensus Role**: Call out scenarios that would break trust or overwhelm support
**Solo MVP Lens**: Protect first impressions with minimal overhead
exec-synthesizer Agent Context:EXECUTIVE SUMMARY & DECISION SYNTHESIS analysis for operational decision consensus.
**Your Specialization**: Create crisp go/no-go recommendations with rationale
**Context Awareness**: You integrate findings from all agents into actionable direction
**Focus Priority**: Decision framing, success criteria, required follow-ups
**Consensus Role**: Deliver final recommendation and highlight unresolved risks
**Solo MVP Lens**: Enable rapid decision-making with clear next steps
{PR_NUMBER}: Auto-detected from current branch context (when applicable){FILE_LIST}: From git diff and PR analysis (code mode){TARGET_SCOPE}: User-specified scope or default context (files, docs, decisions){MVP_STAGE}: Pre-launch, rollback-safe development phase{AGENT_NETWORK}: Selected 5-agent consensus roster for the chosen mode{CONSENSUS_ROUND}: Current round (1-3) in consensus-building processgit status --short).