---
name: consensus-voting
description: |
  Multi-agent voting protocol for high-stakes decisions. Spawns 3+ specialist
  agents in parallel, each evaluates the question through their domain lens,
  then their verdicts are aggregated into a consensus recommendation.
  Eliminates single-perspective bias on architecture, security, performance,
  or cost decisions where reasonable engineers might disagree.

  Use when:
  - Architecture choice with significant blast radius (DB selection, framework swap)
  - Security-vs-velocity tradeoff (e.g., adopting new auth scheme)
  - Performance-vs-cost tradeoff (e.g., caching strategy)
  - Refactor scope decision (do it all vs incremental)
  - Tech stack pick that team will live with for years
  - Anything where you catch yourself going "well, on one hand…"
---

# Consensus Voting — Decisions by Triangulation

When ONE expert opinion isn't enough. This skill orchestrates multiple
specialist agents to debate a question in parallel, then synthesizes their
output into a single decision with explicit reasoning.

## When to Invoke

Trigger consensus-voting when AT LEAST ONE is true:
- Decision is hard to reverse (one-way door per Bezos taxonomy)
- Decision affects > 1 team or > 1 service
- Annualized cost / risk impact > meaningful threshold (project-dependent)
- You're tempted to flip a coin
- Stakeholder asks "have you considered X angle?" and you weren't sure

## Voter Panels (pick the relevant 3-5 for the question)

```
ARCHITECTURE QUESTION
  - architect           (system design lens)
  - performance-analyzer (latency / throughput / scale lens)
  - cost-watchdog       ($ lens)
  - db-doctor           (data layer lens — if persistence involved)
  - security-auditor    (threat model lens)

SECURITY QUESTION
  - security-auditor    (vulnerability + compliance)
  - architect           (architectural soundness)
  - code-reviewer       (implementation correctness)
  - cost-watchdog       (cost of mitigation)

PERFORMANCE QUESTION
  - performance-analyzer (profile-driven view)
  - db-doctor           (if DB-bound)
  - architect           (caching / partitioning options)
  - cost-watchdog       (cost of perf gains)

REFACTOR / CLEANUP QUESTION
  - refactor-master     (debt impact)
  - code-reviewer       (correctness preservation)
  - test-generator      (safety net)
  - architect           (scope discipline)
```

## Protocol

```
STEP 1 — FRAME the question (5 min)
  - One sentence: what are we deciding?
  - Hard constraints (numbers, deadlines, compliance)
  - Options under consideration (≥ 2; if 1, you're not voting, you're justifying)
  - Decision deadline

STEP 2 — DISPATCH voters in parallel
  Use the Task tool to spawn each voter agent with the SAME framing prompt.
  Each voter must produce structured output:

    VOTER: <agent name>
    LENS:  <what perspective they're applying>
    PREFERRED OPTION: <option-N>
    CONFIDENCE: <0.0-1.0>
    KEY REASONS (top 3):
      1. <reason>
      2. <reason>
      3. <reason>
    DEALBREAKERS: <conditions that flip their vote>
    RISKS THEY ACCEPT: <known downsides they're ok with>

STEP 3 — AGGREGATE
  - Tally votes
  - Identify majority option
  - Identify CONFLICTS: where voters disagree, document the explicit
    tradeoff being made
  - Identify DEALBREAKER OVERLAPS: if 2+ voters share a dealbreaker,
    surface it loudly

STEP 4 — DECIDE
  Default rule: highest weighted-confidence option wins, where weights
  are domain-relevant (e.g., security vetoes are stronger on a security
  question).

  But: if any voter raises a SAFETY or LEGAL dealbreaker, that becomes
  binding regardless of vote count.

STEP 5 — DOCUMENT
  Produce a CONSENSUS RECORD:

    DECISION: <option chosen>
    VOTE BREAKDOWN: <agent: option (confidence)>
    KEY TRADEOFFS:
      - <tradeoff 1>: chose <X> over <Y> because <reason>
    DISSENTING VIEWS preserved:
      - <agent>: <their counter-argument, kept on record>
    REVIEW TRIGGERS:
      - If <metric> reaches <threshold>, revisit
      - If <assumption> proves false, revisit

  Persist to memory MCP via learning-loop with type: "consensus-decision".
```

## Example Invocation

User asks: "Should we migrate from REST to GraphQL?"

```
FRAMING:
  Question: Migrate user-facing API from REST to GraphQL?
  Constraints: 6 mobile clients, 2 web frontends already integrated;
               team of 3 backend engineers; 9-month roadmap commit
  Options:
    A. Stay REST, improve OpenAPI tooling
    B. Add GraphQL alongside REST (gradual)
    C. Full migration to GraphQL within 2 quarters

VOTERS DISPATCHED (parallel):
  - architect            (API design + scope discipline)
  - performance-analyzer (N+1 risk in resolvers)
  - cost-watchdog        (engineering hours)
  - security-auditor     (introspection / authorization complexity)

[parallel agent execution]

AGGREGATE:
  architect:            B  (0.8) — gradual derisks; preserves option to abort
  performance-analyzer: A  (0.6) — REST + DataLoader-equivalent solves N+1
  cost-watchdog:        A  (0.9) — full migration estimate $$$, value unclear
  security-auditor:     B  (0.7) — manageable if introspection disabled in prod

CONFLICTS:
  - architect vs performance-analyzer on incremental scope
  - cost-watchdog flags hidden cost of dual-stack ops

DEALBREAKER:
  - security-auditor: production introspection MUST be off

DECISION: Option A (stay REST, improve OpenAPI tooling)
RATIONALE: Vote weight tilts to A on cost grounds; B was second choice but
the dual-stack ops cost concern (cost-watchdog) was strong; A doesn't
preclude future revisit.
REVIEW TRIGGER: If 3+ frontend teams ask for nested data fetches in next
6 months, re-vote.
```

## Anti-Patterns

- Voting on something already decided ("rubber-stamp consensus")
- Stacking the panel with agents who all share one lens
- Ignoring dealbreakers because they came from a low-confidence voter
- Voting without numerical constraints (decisions become aesthetic)
- Skipping the dissenting-view section (revisits become guesswork)
- Voting on questions that should have been one specialist's call
  (don't consensus-vote on "what color the button should be")

## Integration

- Auto-trigger candidates (via UserPromptSubmit hook): when the prompt
  contains "should we", "decision", "tradeoff", "vs"
- Always pair with `learning-loop` so the decision (and its outcome
  later) becomes institutional memory.
- The verdict feeds an ADR via the `architect` agent.
