multi-agent-voting
Skill94 starsChanged 6 months agoMITView on GitHub
Execute multi-agent voting for critical decisions using MAKER-style first-to-ahead-by-k error correction. Use this skill when: - Making critical decisions that benefit from consensus (code review, breaking changes, spec validation) - Voting is enabled in .spec-flow/config/voting.yaml for the operation type - High-stakes decisions where single-agent errors are unacceptable Based on MAKER paper (arXiv:2511.09030): - First-to-ahead-by-k voting: Candidate must be k votes ahead to win - Formula: p_correct = p^k / (p^k + (1-p)^k) - Scaling: Cost grows log-linearly O(s ln s)…
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
Use this skill when:
- Distinctive: line 67
If any candidate is k votes ahead of all others → Winner.
- Distinctive: line 68
If no winner after all votes → Request more samples (up to max_rounds).
- Distinctive: line 69
If max_rounds reached → Escalate or use tie_breaker.
- Distinctive: line 76
All agents must agree. Any disagreement → Escalate.
- Distinctive: line 101
Use Task tool with multiple parallel invocations:
- Very specific: line 154
Check each response against red-flags.yaml
- Distinctive: line 157
Only count clean responses
- Distinctive: line 217
When voting cannot reach consensus:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Multi-Agent Voting Skill
Execute multi-agent voting for critical decisions using MAKER-style first-to-ahead-by-k error correction.
When to Use
Use this skill when:
- Making critical decisions that benefit from consensus (code review, breaking changes, spec validation)
- Voting is enabled in
.spec-flow/config/voting.yamlfor the operation type - High-stakes decisions where single-agent errors are unacceptable
Theoretical Foundation
Based on MAKER paper (arXiv:2511.09030):
- First-to-ahead-by-k voting: Candidate must be k votes ahead to win
- Formula:
p_correct = p^k / (p^k + (1-p)^k) - Scaling: Cost grows log-linearly O(s ln s) with decomposition
With k=2 and individual agent accuracy of 70%:
- Single agent: 70% accuracy
- 3 agents with k=2: ~84% accuracy
- 5 agents with k=3: ~91% accuracy
Prerequisites
<prerequisites>
<item>Read voting configuration</item>
<action>Read .spec-flow/config/voting.yaml</action>
<reason>Understand voting strategy and parameters for target operation</reason>
</prerequisites>Workflow
<workflow>
<phase name="Configuration">
<step>Determine operation type from context</step>
<step>Load operation-specific voting config from voting.yaml</step>
<step>Validate voting is enabled for this operation</step>
<step>Extract: strategy, k value, agent count, model, decorrelation settings</step>
</phase><phase name="Agent Spawning">
<step>Calculate temperature variations if decorrelation enabled</step>
<step>Prepare prompt variations if enabled</step>
<step>Launch N parallel agents via Task tool</step>
<format>
Each agent receives:
- Same core prompt/task
- Different temperature (if variation enabled)
- Different prompt phrasing (if variation enabled)
- Independent context (no memory of other agents)
</format>
</phase><phase name="Vote Collection">
<step>Collect responses from all agents</step>
<step>Apply red-flag filtering (discard flagged responses)</step>
<step>Parse structured output from each valid response</step>
<step>Extract consensus field value from each</step>
</phase><phase name="Consensus Determination">
<step>Apply voting strategy</step>
<strategies>
<strategy name="first_to_ahead_by_k">
Count votes for each candidate.
If any candidate is k votes ahead of all others → Winner.
If no winner after all votes → Request more samples (up to max_rounds).
If max_rounds reached → Escalate or use tie_breaker.
</strategy>
<strategy name="majority">
Candidate with >50% votes wins.
Ties use tie_breaker.
</strategy>
<strategy name="unanimous">
All agents must agree.
Any disagreement → Escalate.
</strategy>
</strategies>
</phase><phase name="Result Aggregation">
<step>Combine non-voting fields per aggregation rules</step>
<step>Lists: union all items</step>
<step>Numbers: take median</step>
<step>Severity: take maximum (conservative)</step>
<step>Format final result with consensus and aggregated data</step>
</phase><phase name="Learning">
<step>Log voting outcome to observations</step>
<step>Track: rounds to consensus, cost, agreement rate</step>
<step>Update adaptive k if accuracy threshold not met</step>
</phase>
</workflow>Implementation Patterns
Spawning Parallel Agents
Use Task tool with multiple parallel invocations:
<parallel_agents>
<agent id="1" temperature="0.5">
[Core prompt for operation]
</agent>
<agent id="2" temperature="0.7">
[Core prompt for operation]
</agent>
<agent id="3" temperature="0.9">
[Core prompt for operation]
</agent>
</parallel_agents>Structured Output Parsing
Require agents to output in parseable format:
# Expected output structure
verdict: PASS # or FAIL
confidence: 0.85
issues:
- severity: HIGH
description: "..."
- severity: MEDIUM
description: "..."First-to-ahead-by-k Algorithm
function first_to_k_vote(votes, k):
counts = count_each_candidate(votes)
sorted_candidates = sort_by_count_desc(counts)
if len(sorted_candidates) == 1:
return sorted_candidates[0]
leader = sorted_candidates[0]
runner_up = sorted_candidates[1]
if counts[leader] - counts[runner_up] >= k:
return leader
return NO_CONSENSUSRed Flag Integration
Before counting votes:
- Check each response against red-flags.yaml
- Discard responses with red flags
- Request replacement samples if below min_votes_required
- Only count clean responses
Cost Optimization
Minimize c/p (cost per success), not just cost:
<cost_guidance>
<rule>Use haiku for simple validation tasks (spec completeness)</rule>
<rule>Use sonnet for complex analysis (code review, security)</rule>
<rule>Reserve opus for architecture decisions (voting optional)</rule>
<rule>Start with k=2; increase only if accuracy below threshold</rule>
<rule>Track cost vs accuracy tradeoff in learnings</rule>
</cost_guidance>
Example: Code Review Voting
Operation: code_review
Strategy: first_to_ahead_by_k
k: 2
Agents: 3
Model: sonnet
Agent 1 (temp 0.5): PASS, 2 issues
Agent 2 (temp 0.7): PASS, 3 issues
Agent 3 (temp 0.9): PASS, 2 issues
Vote count: PASS=3, FAIL=0
PASS leads by 3 (>= k=2) → Consensus: PASS
Aggregated issues (union): 4 unique issues
Final: PASS with 4 issues to addressExample: Breaking Change Detection
Operation: breaking_change_detection
Strategy: first_to_ahead_by_k
k: 2
Agents: 3
Tie-breaker: BREAKING (conservative)
Agent 1: NON_BREAKING
Agent 2: BREAKING
Agent 3: NON_BREAKING
Vote count: NON_BREAKING=2, BREAKING=1
NON_BREAKING leads by 1 (< k=2) → No consensus yet
Request 2 more samples:
Agent 4: NON_BREAKING
Agent 5: NON_BREAKING
New count: NON_BREAKING=4, BREAKING=1
NON_BREAKING leads by 3 (>= k=2) → Consensus: NON_BREAKINGEscalation
When voting cannot reach consensus:
<escalation>
<condition>Max rounds reached without k-ahead winner</condition>
<action>
1. Present all agent responses to user
2. Show vote distribution
3. Highlight disagreement points
4. Request user decision
</action>
</escalation>References
.spec-flow/config/voting.yaml— Voting configuration.spec-flow/config/red-flags.yaml— Red flag definitionsdocs/maker-integration.md— MAKER concepts documentation
In this repository48 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/Agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- analysis-phaseSkill
- anti-duplicationSkill
- audit-claude-mdSkill
- breaking-change-detectorSkill
- caching-strategySkill
- clarification-phaseSkill
- create-agent-skillsSkill
- create-hooksSkill
- create-meta-promptsSkill
- create-slash-commandsSkill
- create-subagentsSkill
- debug-phaseSkill
- dependency-conflict-resolverSkill
- design-tokensSkill
- domain-memorySkill
- dry-runSkill
- epic-meta-promptingSkill
- epic-scopingSkill
- epic-sprintsSkill
- epic-walkthroughSkill
- error-recoverySkill
- finalize-phaseSkill
- git-workflow-enforcerSkill
- hallucination-detectorSkill
- implementation-phaseSkill
- mockup-extractionSkill
- optimization-phaseSkill
- parallel-execution-optimizerSkill
- planning-phaseSkill
- production-deployment-phaseSkill
- project-initialization-phaseSkill
- regression-test-generatorSkill
- roadmap-integrationSkill
- session-boundarySkill
- shadcn-integrationSkill
- specification-phaseSkill
- staging-deployment-phaseSkill
- staging-validation-phaseSkill
- task-breakdown-phaseSkill
- task-status-syncSkill
- theme-consistencySkill
- ultrathinkSkill
- workflow-detectionSkill
- worktree-contextSkill
- x-announcementSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

