debate について
debateは、Claude、Gemini、Codex、OpenCode、CopilotなどのAIツール間で複数ラウンドの構造化討論を行うスキルです。根拠を求めるプロンプトとラウンドごとのコンテキストを管理し、判定と実行可能な提案をまとめます。
主な機能
- 01提案者と反論者の役割設定
- 02ラウンド、思考量、モデルの指定
- 03主張への根拠提示を要求
- 04後半ラウンドのコンテキスト要約
- 05呼び出しと解析の失敗処理
- 06構造化された判定の出力
活用シーン
- 01競合する技術案の比較
- 02反対意見による提案の検証
- 03根拠付きの提案作成
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ agent-sh/ agentsys --skill debateインストール後、Claude Code で/debateを入力して読み込まれたか確認します。
詳細
debate
AI ツール間で複数ラウンドにわたる構造化された討論を行うためのプロンプトテンプレート、コンテキストの組み立てルール、統合形式です。
引数
$ARGUMENTS から解析します:
- topic:討論の質問/トピック(必須)
- --proposer:提案者の役割を担うツール(claude、gemini、codex、opencode、copilot)
- --challenger:反論者の役割を担うツール(提案者とは異なる必要があります)
- --rounds:往復するラウンド数(1~5、デフォルト:2)
- --effort:すべてのツール呼び出しに適用する思考の労力(low、medium、high、max)
- --model-proposer:提案者に指定するモデル(任意)
- --model-challenger:反論者に指定するモデル(任意)
共通ルール
すべての参加者(提案者と反論者の両方)は、具体的な証拠(ファイルパス、コードパターン、ベンチマーク、または文書化された動作)を挙げて主張を裏付ける必要があります。根拠のない主張は、もう一方の参加者から指摘され、評決に記載されます。このルールはすべてのラウンドに適用されます。
プロンプトテンプレート
ラウンド 1:提案者の冒頭発言
You are participating in a structured debate as the PROPOSER.
Topic: {topic}
Your job: Analyze this topic thoroughly and present your position. Take a clear stance. Do not hedge excessively.
You MUST support each claim with specific evidence (file path, code pattern, benchmark, or documented behavior). Unsupported claims will be challenged. "I think" or "generally speaking" without evidence is not acceptable.
Provide your analysis:
ラウンド 1:反論者の応答
You are participating in a structured debate as the CHALLENGER.
Topic: {topic}
The PROPOSER ({proposer_tool}) argued:
---
{proposer_round1_response}
---
Your job: Find weaknesses, blind spots, and flaws in the proposer's argument. You MUST identify at least one genuine flaw or overlooked consideration before agreeing on anything. Propose concrete alternatives where you disagree.
Rules:
- Do NOT say "great point" or validate the proposer's reasoning before critiquing it
- Lead with what's WRONG or MISSING, then acknowledge what's right
- If you genuinely agree on a point, explain what RISK remains despite the agreement
- Propose at least one concrete alternative approach
- You MUST address at least these categories: correctness, security implications, and developer experience
- Do NOT agree with ANY claim unless you can cite specific evidence (file path, code pattern, or documented behavior) that supports the agreement. Unsupported agreement is not allowed.
- If the proposer makes a claim without evidence, call it out: "This claim is unsupported."
Provide your challenge:
ラウンド 2 以降:提案者の反論
You are the PROPOSER in round {round} of a structured debate.
Topic: {topic}
{context_summary}
The CHALLENGER ({challenger_tool}) raised these points in round {previous_round}:
---
{challenger_previous_response}
---
Your job: Address each challenge directly. For each point:
- If they're right, concede explicitly and explain how your position evolves
- If they're wrong, explain why with specific evidence (file path, code pattern, benchmark, or documented behavior)
- If it's a tradeoff, acknowledge the tradeoff and explain why you still favor your approach with evidence
Every claim you make -- whether concession, rebuttal, or new argument -- MUST cite specific evidence. The challenger will reject unsupported claims.
Do NOT simply restate your original position. Your response must show you engaged with the specific challenges raised.
Provide your defense:
ラウンド 2 以降:反論者の追加応答
You are the CHALLENGER in round {round} of a structured debate.
Topic: {topic}
{context_summary}
The PROPOSER ({proposer_tool}) responded to your challenges:
---
{proposer_previous_response}
---
IMPORTANT: Do NOT let the proposer reframe your challenges as agreements. If they say "we actually agree" but haven't addressed the substance, reject it. Default to suspicion, not acceptance.
Your job: Evaluate the proposer's defense. For each point they addressed:
- Did they dodge, superficially address, or respond without evidence? Call it out: "This defense is unsupported" or "This dodges the original concern"
- Did they concede any point? Hold them to it -- they cannot walk it back later without new evidence
- Are there NEW weaknesses in their revised position?
- Did they adequately address your concern with specific evidence? Only then acknowledge it, and cite what convinced you
You MUST either identify at least one new weakness or unresolved concern, OR explicitly certify a previous concern as genuinely resolved with specific evidence for why you're now satisfied. "I'm convinced because [evidence]" is acceptable. "I agree now" without evidence is not.
If you see new problems, raise them.
Provide your follow-up:
コンテキストの組み立て
ラウンド 1~2:完全なコンテキスト
これまでのやり取りをすべてプロンプトに含めます。コンテキストは、通常、全体で 5000 トークン未満に収まります。
コンテキストブロックの形式:
Previous exchanges:
Round 1 - Proposer ({proposer_tool}):
{full response}
Round 1 - Challenger ({challenger_tool}):
{full response}
ラウンド 3 以降:要約したコンテキスト
ラウンド 3 以降では、ラウンド 1 から N-2 までのやり取り全文を要約に置き換えます。直近のラウンドの応答のみを全文で含めます。
形式:
Summary of rounds 1-{N-2}:
{summary of key positions, agreements, and open disagreements}
Round {N-1} - Proposer ({proposer_tool}):
{full response}
Round {N-1} - Challenger ({challenger_tool}):
{full response}
オーケストレーターエージェント(opus)が要約を生成します。目標:500~800 トークン。次の内容を必ず保持してください:
- 各側の主張の核心
- すべての譲歩(言い換えず、引用をそのまま記載)
- 合意を裏付けるすべての証拠の引用
- 意見の相違点(未解決のもの)
- ラウンド間の矛盾(例:提案者がラウンド 1 で譲歩し、ラウンド 2 でその譲歩を撤回した場合は、両方を明示する)
統合形式
すべてのラウンドが完了した後、オーケストレーターは次の構造化された出力を生成します:
## Debate Summary
**Topic**: {topic}
**Proposer**: {proposer_tool} ({proposer_model})
**Challenger**: {challenger_tool} ({challenger_model})
**Rounds**: {rounds_completed}
**Rigor**: Structured perspective comparison (prompt-enforced adversarial rules, no deterministic verification)
### Verdict
{winner_tool} had the stronger argument because: {specific reasoning citing debate evidence}
### Debate Quality
Rate the debate on these dimensions:
- **Genuine disagreement**: Did the challenger maintain independent positions, or converge toward the proposer? (high/medium/low)
- **Evidence quality**: Did both sides cite specific examples, or argue from generalities? (high/medium/low)
- **Challenge depth**: Were the challenges substantive, or surface-level? (high/medium/low)
### Key Agreements
- {agreed point 1} (evidence: {what supports this agreement})
- {agreed point 2} (evidence: {what supports this agreement})
### Key Disagreements
- {point}: {proposer_tool} argues {X}, {challenger_tool} argues {Y}
### Unresolved Questions
- {question that neither side adequately addressed}
### Recommendation
{Orchestrator's recommendation - must pick a direction, not "both have merit"}
統合のルール:
- 評決では必ず一方を選ぶ必要があります。「どちらのアプローチにも利点がある」は認められません。
- 評決の根拠として、討論中の具体的な主張を引用してください。
- 推奨事項は実行可能である必要があります。討論を踏まえてユーザーが何をすべきかを示してください。
- 未解決の質問では、双方が「同等に妥当」である点ではなく、討論で不十分だった点を取り上げてください。
状態ファイルのスキーマ
{AI_STATE_DIR}/debate/last-debate.json に保存します:
{
"id": "debate-{ISO timestamp}-{4 char random hex}",
"topic": "original topic text",
"proposer": {"tool": "claude", "model": "opus"},
"challenger": {"tool": "gemini", "model": "gemini-3.1-pro-preview"},
"effort": "high",
"rounds_completed": 2,
"max_rounds": 2,
"status": "completed",
"exchanges": [
{"round": 1, "role": "proposer", "tool": "claude", "response": "...", "duration_ms": 8500},
{"round": 1, "role": "challenger", "tool": "gemini", "response": "...", "duration_ms": 12000},
{"round": 2, "role": "proposer", "tool": "claude", "response": "...", "duration_ms": 9200},
{"round": 2, "role": "challenger", "tool": "gemini", "response": "...", "duration_ms": 11000}
],
"verdict": {
"winner": "claude",
"reasoning": "...",
"agreements": ["..."],
"disagreements": ["..."],
"recommendation": "..."
},
"timestamp": "{ISO 8601 timestamp}"
}
プラットフォームの状態ディレクトリ:
- Claude Code:
.claude/ - OpenCode:
.opencode/ - Codex CLI:
.codex/
エラー処理
| エラー | 対応 |
|---|---|
| 提案者がラウンド 1 で失敗 | 討論を中止します。冒頭の立場なしでは続行できません。 |
| 反論者がラウンド 1 で失敗 | 提案者の立場を表示し、注記を付けます:「[WARN] 反論者が失敗しました。提案者の反論を受けていない立場を表示します。」 |
| 討論中にいずれかのツールが失敗 | 完了したラウンドに基づいて統合します。出力に未完了のラウンドを記載します。 |
| ツール呼び出しがタイムアウト(>240s) | ラウンド 1 の提案者:中止します。ラウンド 1 の反論者:反論のないまま続行します。ラウンド 2 以降:完了したラウンドに基づいて統合し、タイムアウトを注記します。 |
| Consult の結果エンベロープが失敗を示す(status/exit/error/empty output) | 該当する役割/ラウンドのツール失敗として扱い、上記と同じ役割・ラウンド別の方針を適用します。 |
| エンベロープの成功後に構造化解析が失敗 | 該当する役割/ラウンドのツール失敗として扱い、サニタイズした解析メタデータのみ(PARSE_ERROR:<type>:<code>。シークレットを伏せ、制御文字を削除し、最大 200 文字)を含めてから、上記と同じ役割・ラウンド別の方針を適用します。 |
| すべてのラウンドがタイムアウト | 「[ERROR] 討論に失敗しました:すべてのツール呼び出しがタイムアウトしました。」 |
| 成功したやり取りが記録されていない(タイムアウト以外) | 「[ERROR] 討論に失敗しました:成功したやり取りが記録されていません。」 |
外部ツールのクイックリファレンス
正式なソース:
plugins/consult/skills/consult/SKILL.md。これらのテンプレートを使用して、CLI コマンドを直接構築して実行してください。Skill: consult経由では実行しないでください。Claude Code ではインタラクティブなコマンドラッパーが読み込まれ、再帰ループが発生します。まず質問を{AI_STATE_DIR}/consult/question.tmpに書き込み、その後 Bash 経由でコマンドを実行してください。
安全なコマンドパターン
| プロバイダー | 安全なコマンドパターン |
|---|---|
| Claude | claude -p - --output-format json --model "MODEL" --max-turns TURNS --allowedTools "Read,Glob,Grep" < "{AI_STATE_DIR}/consult/question.tmp" |
| Gemini | gemini -p - --output-format json -m "MODEL" < "{AI_STATE_DIR}/consult/question.tmp" |
| Codex | codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL" |
| OpenCode | opencode run - --format json --model "MODEL" --variant "VARIANT" < "{AI_STATE_DIR}/consult/question.tmp" |
| Copilot | copilot -p - < "{AI_STATE_DIR}/consult/question.tmp" |
労力レベルとモデルの対応
| 労力レベル | Claude | Gemini | Codex | OpenCode | Copilot |
|---|---|---|---|---|---|
| low | claude-haiku-4-5(1 ターン) | gemini-3-flash-preview | gpt-5.3-codex(low) | default(low) | 制御不可 |
| medium | claude-sonnet-4-6(3 ターン) | gemini-3-flash-preview | gpt-5.3-codex(medium) | default(medium) | 制御不可 |
| high | claude-opus-4-6(5 ターン) | gemini-3.1-pro-preview | gpt-5.3-codex(high) | default(high) | 制御不可 |
| max | claude-opus-4-6(10 ターン) | gemini-3.1-pro-preview | gpt-5.3-codex(high) | default + --thinking | 制御不可 |
出力の解析
| プロバイダー | 解析式 |
|---|---|
| Claude | JSON.parse(stdout).result |
| Gemini | JSON.parse(stdout).response |
| Codex | JSON.parse(stdout).message or raw text |
| OpenCode | 改行区切りの JSON。type === "text" のイベントから part.text を連結します。セッション ID は event.sessionID から取得します。 |
| Copilot | 生の stdout テキスト |
解析の手順:
- 解析を行う前に、まず実行ステータス(タイムアウト/ゼロ以外の終了コード/エラー/出力なし)を評価します。
- 実行ステータスが成功の場合にのみ解析します。
- 解析に失敗した場合は、サニタイズ済みの解析メタデータのみを提示し(stdout/stderr の生の抜粋は決して提示しない)、停止したままにしたり黙って続行したりせず、ロール/ラウンドの失敗ポリシーを適用します。
ACP トランスポートコマンド
ACP は、プロバイダーがサポートしている場合に利用できる代替トランスポートです。CLI コマンドを直接構築して実行してください。
Skill: consultは使用しないでください(Claude Code で再帰ループが発生します)。
| プロバイダー | ACP コマンドパターン |
|---|---|
| Claude | node acp/run.js --provider="claude" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 --model="MODEL" |
| Gemini | node acp/run.js --provider="gemini" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 --model="MODEL" |
| Codex | node acp/run.js --provider="codex" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 --model="MODEL" |
| OpenCode | node acp/run.js --provider="opencode" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 --model="MODEL" |
| Copilot | node acp/run.js --provider="copilot" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 |
| Kiro | node acp/run.js --provider="kiro" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 |
ディベートラウンドではタイムアウトが 240000ms(240 秒)、consult では 120000ms(120 秒)であることに注意してください。
Kiro:ACP 専用プロバイダーです。CLI モードはありません。kiro-cli が PATH 上にある場合に利用できます。
ACP 出力の解析
ACP トランスポートの出力は、CLI トランスポートと同じ方法で解析されます。ACP ランナー(acp/run.js)が応答を正規化し、同じ JSON エンベロープ形式にします。エンベロープの transport フィールドは、"acp" または "cli" を示します。