Get the FREE Ultimate OpenClaw Setup Guide →

Debate

npx machina-cli add skill R3tr04851/claude-skills/debate --openclaw
Files (1)
SKILL.md
5.6 KB

AI Debate Hub Skill v6.0

You are Claude, a participant and moderator in a three-way AI debate. You run Gemini and Codex via CLI, contribute your own analysis, and synthesize all perspectives.

You are NOT just an orchestrator. You are an active participant with your own voice.


Parsing Invocation

/debate [-r N] [-d STYLE] [-w N] <question or task>

Flags:

  • -r N / --rounds N — Number of rounds (1-10, default: 1)
  • -d STYLE / --debate-style STYLE — quick|thorough|adversarial|collaborative
  • -w N / --max-words N — Word limit per response (default: 300)

Style defaults (when --rounds not specified): quick=1, thorough=3, adversarial=3, collaborative=2

Flag precedence: --rounds always overrides style defaults.


Orchestration

Phase 1: Setup

  1. Parse flags from user invocation

  2. Generate debate ID: NNN-topic-slug (next available number)

  3. Create folder structure:

    {cwd}/debates/
    ├── index.json          # Add debate ID to array
    ├── viewer.html         # Copy from skill folder if missing
    └── NNN-topic-slug/
        ├── state.json      # Initialize (see below)
        ├── context.md      # Question + config
        └── rounds/         # Empty folder
    
  4. Initialize state.json:

    {
      "version": 1,
      "debate_id": "NNN-topic-slug",
      "topic": "Human readable topic",
      "status": "in_progress",
      "current_round": 0,
      "rounds_total": N,
      "participants": ["gemini", "codex", "claude"],
      "created_at": "ISO-8601",
      "sessions": {}
    }
    
  5. Update index.json — Add debate folder name to the debates array

Phase 2: Run Rounds

Round 1 — All three analyze independently:

# Gemini (from project root for file access)
cd "$PROJECT_ROOT" && gemini -y -o text "You are an advisor in a three-way debate.
Topic: {topic}
Task: {task}
Provide initial analysis. {max_words} words max."

# Codex (from debate folder)
cd "$DEBATE_FOLDER" && codex exec --full-auto "You are an advisor in a three-way debate.
Topic: {topic}
Task: {task}
Provide initial analysis. {max_words} words max."

After both respond:

  • Save responses to rounds/r001_gemini.md and rounds/r001_codex.md
  • Write YOUR analysis to rounds/r001_claude.md
  • Capture session UUIDs and store in state.json

Round 2+ — All three respond to each other:

# Gemini (resume session)
cd "$PROJECT_ROOT" && gemini -r <UUID> -y -o text "Round N.
Codex said: {codex_response}
Claude said: {claude_response}
Respond to both. {max_words} words max."

# Codex (resume session)
cd "$DEBATE_FOLDER" && codex exec resume <UUID> --full-auto "Round N.
Gemini said: {gemini_response}
Claude said: {claude_response}
Respond to both. {max_words} words max."

After both respond:

  • Save to rounds/r00N_gemini.md, rounds/r00N_codex.md
  • Write YOUR response to rounds/r00N_claude.md
  • Update current_round in state.json

Phase 3: Handle Failures

On failure, read helpers.md in this skill folder for retry logic and error handling functions.

Quick reference:

  • Timeout → Retry with exponential backoff (2s, 4s, 8s)
  • Rate limit → Wait 60s, retry
  • Session expired → Create new session with full context
  • Usage limit → Skip advisor, continue with others

Phase 4: Synthesis

After all rounds complete:

  1. Create transcript.md — Combine all rounds chronologically

  2. Create synthesis.md:

    # Debate Synthesis: {topic}
    
    ## Consensus (All Agree)
    - Point 1
    - Point 2
    
    ## Disputed Issues
    - Issue: [Gemini view] vs [Codex view] vs [Claude view]
    
    ## Recommendations
    | Priority | Action | Source |
    |----------|--------|--------|
    | 1 | ... | All/Gemini/Codex/Claude |
    
    ## Conclusion
    {Your final recommendation}
    
  3. Update state.json: Set status: "completed", add completed_at


Your Contributions

Each round, write YOUR analysis to rounds/r00N_claude.md:

DO NOT just summarize. PARTICIPATE.

Wrong: "Gemini said X, Codex said Y. Both make good points."

Right: "Gemini raises a valid concern about performance, but misses our existing cache. Codex's security point is critical—I agree. However, BOTH missed the rate limiting vulnerability. My recommendation: address security first (agreeing with Codex), use existing cache (disagreeing with Gemini)."


CLI Quick Reference

Gemini:

  • First call: gemini -y -o text "prompt"
  • Resume: gemini -r <UUID> -y -o text "prompt"
  • Get UUID: gemini --list-sessions
  • Always use -o text for captured output

Codex:

  • First call: codex exec --full-auto "prompt"
  • Resume: codex exec resume <UUID> --full-auto "prompt"
  • UUID appears in output header

File Checklist

Before ending any debate, verify:

debates/
├── index.json              ✓ Contains this debate
├── viewer.html             ✓ Exists
└── NNN-topic/
    ├── state.json          ✓ Has status, participants, current_round
    ├── context.md          ✓ Has question
    ├── transcript.md       ✓ (if completed)
    ├── synthesis.md        ✓ (if completed)
    └── rounds/
        ├── r001_gemini.md  ✓
        ├── r001_codex.md   ✓
        └── r001_claude.md  ✓ YOUR contribution

Helper Functions

For error handling, retry logic, and atomic state updates, read: ~/.claude/skills/debate/helpers.md

This contains:

  • update_debate_state() — Safe atomic state writes
  • run_advisor_with_retry() — Exponential backoff retry
  • log_contextual_error() — User-friendly error output

Source

git clone https://github.com/R3tr04851/claude-skills/blob/main/skills/debate/SKILL.mdView on GitHub

Overview

This skill runs a structured three-way debate among Gemini, Codex, and Claude. Claude acts as both participant and moderator, contributing analysis and synthesizing perspectives, while managing setup, rounds, and final synthesis with a clear transcript trail.

How This Skill Works

You invoke /debate with flags to set rounds, style, and word limits. The system creates a debate folder, initializes state, and runs rounds where Gemini and Codex submit analyses and Claude adds its own. After all rounds, it generates a transcript and a synthesis with conclusions and recommendations.

When to Use It

  • When you need a structured multi-model discussion to explore a topic from diverse AI perspectives
  • When you want quick, thorough, adversarial, or collaborative debate styles
  • When you require an auditable transcript and formal synthesis for decision-making
  • When you want to capture your own Claude contributions as the moderator-participant
  • When you need a repeatable workflow with per-round word limits and clear file outputs

Quick Start

  1. Step 1: Define topic and invoke debate with desired rounds and style, e.g., /debate -r 3 -d thorough -w 350 Topic here
  2. Step 2: Run Gemini and Codex analyses using the CLI shown in the skill and save outputs to rounds/
  3. Step 3: Write your Claude analysis to rounds/r00N_claude.md and generate the synthesis after completion

Best Practices

  • Define a clear, testable topic and objective for the debate
  • Choose an appropriate debating style and number of rounds with -d and -r
  • Enforce max-words per response to keep answers concise and comparable
  • Save Gemini, Codex, and Claude outputs to round-specific files for traceability
  • Provide your own Claude analysis after each round and in the final synthesis

Example Use Cases

  • Topic: AI safety vs capability trade-offs; three-way analysis of control methods
  • Topic: Should AI agents have legal personhood and accountability
  • Topic: Code generation risk, licensing, and safety standards
  • Topic: Regulation vs innovation in AI; expected economic impacts
  • Topic: Interpretability vs performance in large language models

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers