# Consensus Calculation Skill

This skill provides consensus calculation functionality for multi-agent systems.

## Description

Calculates consensus among multiple agents using various algorithms including voting consensus and deliberation consensus. The skill can be used to determine agreement levels on specific topics or decisions.

## Usage

The skill can be called when you need to calculate consensus among agents based on their inputs or votes.

## Input Format

The skill accepts a JSON object with the following structure:
```json
{
  "messages": [
    {
      "agent_name": "string",
      "content": "string"
    }
  ],
  "algorithm": "voting|deliberation|weighted",
  "threshold": "number (0-1)",
  "max_rounds": "number (for deliberation)"
}
```

## Output Format

The skill returns a JSON object with the following structure:
```json
{
  "achieved": "boolean",
  "agreement_ratio": "number (0-1)",
  "summary": "string",
  "votes": "object (for voting algorithms)"
}
```

## Examples

### Voting Consensus
```
Calculate voting consensus with 70% threshold
Input: {"messages": [{"agent_name": "proponent", "content": "vote: yes"}, {"agent_name": "opponent", "content": "vote: no"}], "algorithm": "voting", "threshold": 0.7}
Output: {"achieved": false, "agreement_ratio": 0.5, "summary": "...", "votes": {"proponent": true, "opponent": false}}
```

### Deliberation Consensus
```
Calculate deliberation consensus over multiple rounds
Input: {"messages": [{"agent_name": "agent1", "content": "round: 1, stance: support"}, {"agent_name": "agent2", "content": "round: 1, stance: oppose"}], "algorithm": "deliberation", "max_rounds": 5, "convergence_threshold": 0.8}
Output: {"achieved": false, "agreement_ratio": 0.3, "summary": "...", "convergence_history": [...]}
```