consensus-voting
Multi-agent consensus voting with domain-weighted expertise for critical decisions requiring structured validation
What this skill does
# Consensus Voting Skill ## Purpose Execute weighted multi-agent voting for critical decisions where domain expertise matters. Unlike debate (collaborative synthesis) or n-version (parallel generation), this skill focuses on **structured voting with expertise weighting** for security, authentication, and data-handling changes. ## Key Insight from Pattern Analysis From `~/.amplihack/.claude/context/DISCOVERIES.md` (Pattern Applicability Analysis): > **Voting vs Expert Judgment Selection Criteria** > > **When Voting Works:** > > - Adversarial environment (can't trust individual nodes) > - Binary or simple discrete choices > - No objective quality metric available > - Consensus more valuable than correctness > > **When Expert Judgment Works:** > > - Cooperative environment (honest actors) > - Complex quality dimensions > - Objective evaluation criteria exist > - Correctness more valuable than consensus **This skill uses BOTH strategically**: Expert judgment to evaluate, weighted voting to decide. ## When to Use This Skill **AUTO-TRIGGERS (high-risk domains):** - Security implementations (authentication, authorization) - Encryption and cryptographic code - Sensitive data handling (PII, credentials) - Permission and access control changes - Critical algorithm implementations **EXPLICIT TRIGGERS:** - Major design decisions with competing approaches - When stakeholder buy-in matters - Binary or discrete choices needing validation - Risk-mitigating decisions for production code **AVOID FOR:** - Complex trade-off analysis (use `debate-workflow` instead) - Code generation (use `n-version-workflow` instead) - Simple implementation choices - Subjective quality assessments ## Configuration ### Voting Configuration **Voting Mode:** - `simple-majority` - 50%+ votes to pass - `supermajority` - 66%+ votes to pass (DEFAULT for security) - `unanimous` - 100% agreement required **Agent Selection:** - `auto` - Select agents based on detected domain (DEFAULT) - `manual` - Specify agents explicitly - `comprehensive` - All relevant agents vote **Weight Calibration:** - `static` - Fixed weights per domain (DEFAULT) ### Domain Expertise Weights | Agent | Security | Auth | Data | Algorithm | General | | --------- | -------- | ---- | ---- | --------- | ------- | | security | 3.0 | 2.5 | 2.5 | 1.5 | 1.0 | | reviewer | 1.5 | 1.5 | 1.5 | 2.0 | 2.0 | | architect | 1.5 | 2.0 | 2.0 | 2.5 | 2.0 | | tester | 1.0 | 1.5 | 1.5 | 2.0 | 1.5 | | optimizer | 0.5 | 0.5 | 0.5 | 2.5 | 1.0 | | cleanup | 0.5 | 0.5 | 0.5 | 1.0 | 1.5 | **Weight Interpretation:** - 3.0 = Domain expert (vote counts triple) - 2.0 = Significant expertise (vote counts double) - 1.0 = General competence (standard vote) - 0.5 = Peripheral relevance (half vote) ## Execution Process ### Step 1: Detect Decision Domain Analyze the change or decision to determine primary domain: - **Use analyzer agent** to examine code/proposal - Detect keywords: auth, encrypt, password, token, permission, credential - Identify file paths: auth/, security/, crypto/ - Classify: SECURITY | AUTH | DATA | ALGORITHM | GENERAL **Domain Detection Triggers:** ``` SECURITY: encrypt, decrypt, hash, salt, vulnerability, CVE, injection AUTH: login, logout, session, token, jwt, oauth, password, credential DATA: pii, gdpr, sensitive, personal, private, secret, key ALGORITHM: sort, search, calculate, compute, process, transform ``` ### Step 2: Select Voting Agents Based on detected domain, select relevant agents with weights: **For SECURITY domain:** - security agent (weight: 3.0) - Primary expert - architect agent (weight: 1.5) - System design perspective - reviewer agent (weight: 1.5) - Code quality check - tester agent (weight: 1.0) - Testability assessment **For AUTH domain:** - security agent (weight: 2.5) - Security implications - architect agent (weight: 2.0) - Integration patterns - reviewer agent (weight: 1.5) - Implementation quality - tester agent (weight: 1.5) - Auth flow testing **For DATA domain:** - security agent (weight: 2.5) - Data protection - architect agent (weight: 2.0) - Data architecture - reviewer agent (weight: 1.5) - Handling patterns - tester agent (weight: 1.5) - Data validation **For ALGORITHM domain:** - optimizer agent (weight: 2.5) - Performance analysis - architect agent (weight: 2.5) - Design patterns - tester agent (weight: 2.0) - Correctness testing - reviewer agent (weight: 2.0) - Code quality ### Step 3: Present Decision to Agents Each selected agent receives: - Clear decision statement - Available options (if applicable) - Relevant context and constraints - Evaluation criteria **Decision Prompt Template:** ```markdown ## Decision Required: [TITLE] **Domain:** [SECURITY | AUTH | DATA | ALGORITHM] **Your Weight:** [X.X] (based on domain expertise) ### Context [Relevant background and constraints] ### Options 1. [Option A]: [Description] 2. [Option B]: [Description] 3. [Reject Both]: Propose alternative ### Evaluation Criteria - Security implications - Implementation complexity - Maintainability - Risk assessment ### Your Vote Provide: 1. Your vote (Option 1, 2, or Reject) 2. Confidence level (HIGH, MEDIUM, LOW) 3. Key reasoning (2-3 sentences max) 4. Any conditions or caveats ``` ### Step 4: Collect Votes For each agent, collect structured vote: ```yaml agent: security weight: 3.0 vote: Option 1 confidence: HIGH reasoning: "Option 1 follows OWASP best practices for credential storage. Option 2 uses deprecated hashing algorithm." conditions: ["Ensure salt length >= 16 bytes", "Use constant-time comparison"] ``` ### Step 5: Calculate Weighted Result **Weighted Vote Calculation:** ``` For each option: weighted_score = sum(agent_weight * confidence_multiplier) Where confidence_multiplier: HIGH = 1.0 MEDIUM = 0.7 LOW = 0.4 ``` **Example Calculation:** | Agent | Weight | Vote | Confidence | Score | | --------- | ------ | ---- | ---------- | ----- | | security | 3.0 | A | HIGH | 3.0 | | architect | 1.5 | A | MEDIUM | 1.05 | | reviewer | 1.5 | B | HIGH | 1.5 | | tester | 1.0 | A | LOW | 0.4 | ``` Option A Score: 3.0 + 1.05 + 0.4 = 4.45 Option B Score: 1.5 Total Weighted Votes: 5.95 Option A Percentage: 74.8% (SUPERMAJORITY) ``` ### Step 6: Apply Voting Threshold Based on configured voting mode: **simple-majority (50%+):** - Option with highest weighted score wins if > 50% - If no option > 50%, proceed to debate or reject **supermajority (66%+):** (DEFAULT for security) - Winning option must have > 66% weighted votes - Provides stronger validation for high-risk decisions **unanimous (100%):** - All agents must agree (rare, highest bar) - Any dissent blocks decision ### Step 7: Report Consensus Result **If Consensus Reached:** ```markdown ## Consensus Voting Result **Decision:** [Selected Option] **Domain:** SECURITY **Threshold:** Supermajority (66%+) **Result:** PASSED (74.8%) ### Vote Summary | Agent | Weight | Vote | Confidence | | --------- | ------ | ---- | ---------- | | security | 3.0 | A | HIGH | | architect | 1.5 | A | MEDIUM | | reviewer | 1.5 | B | HIGH | | tester | 1.0 | A | LOW | ### Key Reasoning (from highest-weighted agents) - **security (3.0):** "Option 1 follows OWASP best practices..." ### Conditions/Caveats - Ensure salt length >= 16 bytes - Use constant-time comparison ### Dissenting View - **reviewer (1.5):** "Option B has simpler implementation..." ``` **If No Consensus:** ```markdown ## Consensus Voting Result **Decision:** NO CONSENSUS **Domain:** AUTH **Threshold:** Supermajority (66%+) **Result:** FAILED (52.3%) ### Recommendation - Escalate to `/amplihack:debate` for structured trade-off analysis - OR: Gather more information and re-vote - OR: Accept simple majority with docu
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.