Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **`/debate` command inline orchestration** — The `/debate` command now manages the full debate workflow directly (parse → resolve → execute → verdict), following the `/consult` pattern. The `debate-orchestrator` agent is now the programmatic entry point for other agents/workflows that need to spawn a debate via `Task()`. Fixes issue #231.

- **`/debate` External Tool Quick Reference** — Added a "External Tool Quick Reference" section to all copies of the debate skill (`plugins/debate/skills/debate/SKILL.md`, OpenCode and Codex adapters) with safe command patterns, effort-to-model mapping tables, and output parsing expressions. The section includes a canonical-source pointer to `plugins/consult/skills/consult/SKILL.md` so the debate orchestrator doesn't duplicate provider logic. Added pointer notes in `debate-orchestrator` agents. Fixes issue #232.
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar: use “an External Tool Quick Reference section” (External starts with a vowel sound).

Suggested change
- **`/debate` External Tool Quick Reference** — Added a "External Tool Quick Reference" section to all copies of the debate skill (`plugins/debate/skills/debate/SKILL.md`, OpenCode and Codex adapters) with safe command patterns, effort-to-model mapping tables, and output parsing expressions. The section includes a canonical-source pointer to `plugins/consult/skills/consult/SKILL.md` so the debate orchestrator doesn't duplicate provider logic. Added pointer notes in `debate-orchestrator` agents. Fixes issue #232.
- **`/debate` External Tool Quick Reference** — Added an "External Tool Quick Reference" section to all copies of the debate skill (`plugins/debate/skills/debate/SKILL.md`, OpenCode and Codex adapters) with safe command patterns, effort-to-model mapping tables, and output parsing expressions. The section includes a canonical-source pointer to `plugins/consult/skills/consult/SKILL.md` so the debate orchestrator doesn't duplicate provider logic. Added pointer notes in `debate-orchestrator` agents. Fixes issue #232.

Copilot uses AI. Check for mistakes.

- **`/consult` model name updates** — Updated stale model names in the consult skill: Codex models are now `o4-mini` (low/medium) and `o3` (high/max); Gemini models include `gemini-3-flash-preview`, `gemini-3-pro-preview`, and `gemini-3.1-pro-preview`. Synced to OpenCode adapter consult skill. Fixes issue #232.

- **`/next-task` Phase 12 ship invocation** — Phase 12 now invokes `ship:ship` via `await Skill({ name: "ship:ship", args: ... })` instead of `Task({ subagent_type: "ship:ship", ... })`. `ship:ship` is a skill, not an agent; the previous `Task()` call silently failed, leaving the workflow stuck after delivery validation with no PR created. The Codex adapter is updated in parity and regression tests are added. Fixes issue #230.

## [5.1.0] - 2026-02-18
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,10 @@ agent-knowledge/

| Tool | Default Model (high) | Reasoning Control |
|------|---------------------|-------------------|
| Claude | opus | max-turns |
| Gemini | gemini-3-pro | built-in |
| Codex | gpt-5.3-codex | model_reasoning_effort |
| OpenCode | github-copilot/claude-opus-4-6 | --variant |
| Claude | claude-opus-4-6 | max-turns |
| Gemini | gemini-3-pro-preview | built-in |
| Codex | o3 | model_reasoning_effort |
| OpenCode | (user-selected or default) | --variant |
| Copilot | (default) | none |

**Usage:**
Expand Down
85 changes: 85 additions & 0 deletions __tests__/debate-command.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ const codexSkillPath = path.join(adaptersDir, 'codex', 'skills', 'debate', 'SKIL
const openCodeCommandPath = path.join(adaptersDir, 'opencode', 'commands', 'debate.md');
const openCodeSkillPath = path.join(adaptersDir, 'opencode', 'skills', 'debate', 'SKILL.md');
const openCodeAgentPath = path.join(adaptersDir, 'opencode', 'agents', 'debate-orchestrator.md');
const openCodeConsultSkillPath = path.join(adaptersDir, 'opencode', 'skills', 'consult', 'SKILL.md');
const consultSkillPath = path.join(__dirname, '..', 'plugins', 'consult', 'skills', 'consult', 'SKILL.md');

// Load all files once
let commandContent, skillContent, agentContent, pluginJson;
let codexSkillContent, openCodeCommandContent, openCodeSkillContent, openCodeAgentContent;
let openCodeConsultSkillContent, consultSkillContent;

beforeAll(() => {
commandContent = fs.readFileSync(commandPath, 'utf8');
Expand All @@ -37,6 +40,8 @@ beforeAll(() => {
openCodeCommandContent = fs.readFileSync(openCodeCommandPath, 'utf8');
openCodeSkillContent = fs.readFileSync(openCodeSkillPath, 'utf8');
openCodeAgentContent = fs.readFileSync(openCodeAgentPath, 'utf8');
openCodeConsultSkillContent = fs.readFileSync(openCodeConsultSkillPath, 'utf8');
consultSkillContent = fs.readFileSync(consultSkillPath, 'utf8');
});

// ─── Helpers ────────────────────────────────────────────────────────
Expand Down Expand Up @@ -650,3 +655,83 @@ describe('adapter consistency', () => {
expect(openCodeAgentContent).toMatch(/240.second timeout|Track invocation start time/i);
});
});

// ─── 14. External Tool Quick Reference (#232) ────────────────────
describe('external tool quick reference (#232)', () => {
// Use pre-loaded content (no redundant file reads)
const allDebateSkillContents = () => [skillContent, openCodeSkillContent, codexSkillContent];

test('all three debate skill copies contain the External Tool Quick Reference section', () => {
for (const content of allDebateSkillContents()) {
expect(content).toContain('## External Tool Quick Reference');
}
});

test('all five providers mentioned in quick reference of each skill copy', () => {
for (const content of allDebateSkillContents()) {
expect(content).toMatch(/External Tool Quick Reference[\s\S]*claude/i);
expect(content).toMatch(/External Tool Quick Reference[\s\S]*gemini/i);
expect(content).toMatch(/External Tool Quick Reference[\s\S]*codex/i);
expect(content).toMatch(/External Tool Quick Reference[\s\S]*opencode/i);
expect(content).toMatch(/External Tool Quick Reference[\s\S]*copilot/i);
}
});

test('effort-to-model mapping table present in each skill copy', () => {
for (const content of allDebateSkillContents()) {
expect(content).toContain('Effort-to-Model Mapping');
}
});

test('output parsing table present in each skill copy', () => {
for (const content of allDebateSkillContents()) {
expect(content).toContain('Output Parsing');
}
});

test('canonical source note present in each skill copy', () => {
for (const content of allDebateSkillContents()) {
expect(content).toMatch(/canonical source.*consult/i);
}
});

test('current model names present in effort-to-model mapping of each skill copy', () => {
const expectedModels = ['claude-haiku-4-5', 'claude-sonnet-4-6', 'claude-opus-4-6', 'o4-mini', 'o3', 'gemini-2.5-flash'];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The expectedModels array is missing the updated Gemini preview models (gemini-3-flash-preview, gemini-3-pro-preview, gemini-3.1-pro-preview) which were added to the debate skill's quick reference table. Including them ensures that the test verifies the full set of current models.

Suggested change
const expectedModels = ['claude-haiku-4-5', 'claude-sonnet-4-6', 'claude-opus-4-6', 'o4-mini', 'o3', 'gemini-2.5-flash'];
const expectedModels = ['claude-haiku-4-5', 'claude-sonnet-4-6', 'claude-opus-4-6', 'o4-mini', 'o3', 'gemini-2.5-flash', 'gemini-3-flash-preview', 'gemini-3-pro-preview', 'gemini-3.1-pro-preview'];

for (const content of allDebateSkillContents()) {
for (const model of expectedModels) {
expect(content).toMatch(new RegExp(`Effort-to-Model Mapping[\\s\\S]*${model}`));
}
}
});
});

// ─── 15. Consult skill adapter sync (#232) ───────────────────────
describe('consult skill opencode adapter sync (#232)', () => {
test('opencode consult adapter contains all 5 providers', () => {
for (const provider of ['claude', 'gemini', 'codex', 'opencode', 'copilot']) {
expect(openCodeConsultSkillContent.toLowerCase()).toContain(provider);
}
});

test('opencode consult adapter has updated claude model names', () => {
expect(openCodeConsultSkillContent).toContain('claude-haiku-4-5');
expect(openCodeConsultSkillContent).toContain('claude-sonnet-4-6');
expect(openCodeConsultSkillContent).toContain('claude-opus-4-6');
});

test('opencode consult adapter has updated codex model names (no speculative gpt-5.x)', () => {
expect(openCodeConsultSkillContent).not.toContain('gpt-5.3-codex');
expect(openCodeConsultSkillContent).not.toContain('gpt-5.2-codex');
expect(openCodeConsultSkillContent).toContain('o4-mini');
expect(openCodeConsultSkillContent).toContain('o3');
});

test('canonical consult skill has updated model names', () => {
expect(consultSkillContent).toContain('claude-haiku-4-5');
expect(consultSkillContent).toContain('claude-sonnet-4-6');
expect(consultSkillContent).toContain('claude-opus-4-6');
expect(consultSkillContent).not.toContain('gpt-5.3-codex');
expect(consultSkillContent).toContain('o4-mini');
expect(consultSkillContent).toContain('o3');
});
Comment on lines +729 to +736
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new “consult skill adapter sync” tests only validate the OpenCode adapter + canonical consult skill. The Codex adapter consult skill still contains stale model names (e.g., gpt-5.3-codex in adapters/codex/skills/consult/SKILL.md), so the repo can remain inconsistent while these tests pass. Consider updating the Codex adapter consult docs (and/or extending this test to cover it) to ensure the model-name update is applied consistently across platforms.

Copilot uses AI. Check for mistakes.
});
Comment on lines +709 to +737
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Section 15 of the tests verifies the consult skill adapter sync but completely omits the Gemini model updates mentioned in the PR description. Adding assertions for the new Gemini preview models will ensure that both the OpenCode adapter and the canonical consult skill are correctly updated.

describe('consult skill opencode adapter sync (#232)', () => {
  test('opencode consult adapter contains all 5 providers', () => {
    for (const provider of ['claude', 'gemini', 'codex', 'opencode', 'copilot']) {
      expect(openCodeConsultSkillContent.toLowerCase()).toContain(provider);
    }
  });

  test('opencode consult adapter has updated claude model names', () => {
    expect(openCodeConsultSkillContent).toContain('claude-haiku-4-5');
    expect(openCodeConsultSkillContent).toContain('claude-sonnet-4-6');
    expect(openCodeConsultSkillContent).toContain('claude-opus-4-6');
  });

  test('opencode consult adapter has updated gemini model names', () => {
    expect(openCodeConsultSkillContent).toContain('gemini-3-flash-preview');
    expect(openCodeConsultSkillContent).toContain('gemini-3-pro-preview');
    expect(openCodeConsultSkillContent).toContain('gemini-3.1-pro-preview');
  });

  test('opencode consult adapter has updated codex model names (no speculative gpt-5.x)', () => {
    expect(openCodeConsultSkillContent).not.toContain('gpt-5.3-codex');
    expect(openCodeConsultSkillContent).not.toContain('gpt-5.2-codex');
    expect(openCodeConsultSkillContent).toContain('o4-mini');
    expect(openCodeConsultSkillContent).toContain('o3');
  });

  test('canonical consult skill has updated model names', () => {
    expect(consultSkillContent).toContain('claude-haiku-4-5');
    expect(consultSkillContent).toContain('claude-sonnet-4-6');
    expect(consultSkillContent).toContain('claude-opus-4-6');
    expect(consultSkillContent).toContain('gemini-3-flash-preview');
    expect(consultSkillContent).toContain('gemini-3-pro-preview');
    expect(consultSkillContent).toContain('gemini-3.1-pro-preview');
    expect(consultSkillContent).not.toContain('gpt-5.3-codex');
    expect(consultSkillContent).toContain('o4-mini');
    expect(consultSkillContent).toContain('o3');
  });
});

33 changes: 33 additions & 0 deletions adapters/codex/skills/debate/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,39 @@ The consult skill's table covers: Anthropic keys (`sk-*`, `sk-ant-*`), OpenAI pr

Read the consult skill file to get the exact patterns and replacements.

## External Tool Quick Reference

> Canonical source: `plugins/consult/skills/consult/SKILL.md`. This table is for **planning reference only** -- always invoke via `Skill: consult`, which handles safe question passing, temp file creation, and cleanup. Do NOT execute these commands directly.

### Safe Command Patterns

| Provider | Safe Command Pattern |
|----------|---------------------|
| 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"` |
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Codex safe command pattern uses nested unescaped double quotes ("$(cat "{AI_STATE_DIR}/...")"), which breaks shell parsing. Update the quoting (e.g., single-quote the file path or escape inner quotes) to make the reference command syntactically valid.

Suggested change
| Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` |
| Codex | `codex exec "$(cat '{AI_STATE_DIR}/consult/question.tmp')" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` |

Copilot uses AI. Check for mistakes.
| OpenCode | `opencode run - --format json --model "MODEL" --variant "VARIANT" < "{AI_STATE_DIR}/consult/question.tmp"` |
| Copilot | `copilot -p - < "{AI_STATE_DIR}/consult/question.tmp"` |

### Effort-to-Model Mapping

| Effort | Claude | Gemini | Codex | OpenCode | Copilot |
|--------|--------|--------|-------|----------|---------|
| low | claude-haiku-4-5 (1 turn) | gemini-2.5-flash | o4-mini (low) | default (low) | no control |
| medium | claude-sonnet-4-6 (3 turns) | gemini-3-flash-preview | o4-mini (medium) | default (medium) | no control |
| high | claude-opus-4-6 (5 turns) | gemini-3-pro-preview | o3 (high) | default (high) | no control |
| max | claude-opus-4-6 (10 turns) | gemini-3.1-pro-preview | o3 (high) | default + --thinking | no control |

### Output Parsing

| Provider | Parse Expression |
|----------|-----------------|
| Claude | `JSON.parse(stdout).result` |
| Gemini | `JSON.parse(stdout).response` |
| Codex | `JSON.parse(stdout).message` or raw text |
| OpenCode | Parse JSON events, extract final text block |
| Copilot | Raw stdout text |

## Error Handling

| Error | Output |
Expand Down
4 changes: 4 additions & 0 deletions adapters/opencode/agents/debate-orchestrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ Args: "{proposer_prompt}" --tool=[proposer] --effort=[effort] [--model=[model_pr

Track invocation start time. If the invocation takes longer than 240 seconds to complete, treat it as a tool failure for this round (external tools can hang indefinitely).

> For planning reference on command patterns, model mappings, and output parsing per provider, see the debate skill's **External Tool Quick Reference** section. Always invoke via `Skill: consult` — never construct commands directly.

Parse the JSON result. Extract the response text. Record: round, role="proposer", tool, response, duration_ms.

Display to user immediately:
Expand Down Expand Up @@ -109,6 +111,8 @@ Args: "{challenger_prompt}" --tool=[challenger] --effort=[effort] [--model=[mode

Track invocation start time. If the invocation takes longer than 240 seconds to complete, treat it as a tool failure for this round (external tools can hang indefinitely).

> For planning reference on command patterns, model mappings, and output parsing per provider, see the debate skill's **External Tool Quick Reference** section. Always invoke via `Skill: consult` — never construct commands directly.

Parse the JSON result. Record: round, role="challenger", tool, response, duration_ms.

Display to user immediately:
Expand Down
33 changes: 33 additions & 0 deletions adapters/opencode/commands/debate.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,39 @@ The consult skill's table covers: Anthropic keys (`sk-*`, `sk-ant-*`), OpenAI pr

Read the consult skill file to get the exact patterns and replacements.

## External Tool Quick Reference

> Canonical source: `plugins/consult/skills/consult/SKILL.md`. This table is for **planning reference only** -- always invoke via `Skill: consult`, which handles safe question passing, temp file creation, and cleanup. Do NOT execute these commands directly.

### Safe Command Patterns

| Provider | Safe Command Pattern |
|----------|---------------------|
| 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"` |
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Codex safe command pattern is not valid shell as written because it includes nested unescaped double quotes inside a double-quoted command substitution. Please fix the quoting so the example can be copied safely.

Suggested change
| Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` |
| Codex | `codex exec "$(cat \"{AI_STATE_DIR}/consult/question.tmp\")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` |

Copilot uses AI. Check for mistakes.
| OpenCode | `opencode run - --format json --model "MODEL" --variant "VARIANT" < "{AI_STATE_DIR}/consult/question.tmp"` |
| Copilot | `copilot -p - < "{AI_STATE_DIR}/consult/question.tmp"` |

### Effort-to-Model Mapping

| Effort | Claude | Gemini | Codex | OpenCode | Copilot |
|--------|--------|--------|-------|----------|---------|
| low | claude-haiku-4-5 (1 turn) | gemini-2.5-flash | o4-mini (low) | default (low) | no control |
| medium | claude-sonnet-4-6 (3 turns) | gemini-3-flash-preview | o4-mini (medium) | default (medium) | no control |
| high | claude-opus-4-6 (5 turns) | gemini-3-pro-preview | o3 (high) | default (high) | no control |
| max | claude-opus-4-6 (10 turns) | gemini-3.1-pro-preview | o3 (high) | default + --thinking | no control |

### Output Parsing

| Provider | Parse Expression |
|----------|-----------------|
| Claude | `JSON.parse(stdout).result` |
| Gemini | `JSON.parse(stdout).response` |
| Codex | `JSON.parse(stdout).message` or raw text |
| OpenCode | Parse JSON events, extract final text block |
| Copilot | Raw stdout text |

## Error Handling

| Error | Output |
Expand Down
36 changes: 18 additions & 18 deletions adapters/opencode/skills/consult/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ Command: claude -p "QUESTION" --output-format json --model "MODEL" --max-turns T
Session resume: --resume "SESSION_ID"
```

Models: haiku, sonnet, opus
Models: claude-haiku-4-5, claude-sonnet-4-6, claude-opus-4-6

| Effort | Model | Max Turns |
|--------|-------|-----------|
| low | haiku | 1 |
| medium | sonnet | 3 |
| high | opus | 5 |
| max | opus | 10 |
| low | claude-haiku-4-5 | 1 |
| medium | claude-sonnet-4-6 | 3 |
| high | claude-opus-4-6 | 5 |
| max | claude-opus-4-6 | 10 |

**Parse output**: `JSON.parse(stdout).result`
**Session ID**: `JSON.parse(stdout).session_id`
Expand All @@ -66,14 +66,14 @@ Command: gemini -p "QUESTION" --output-format json -m "MODEL"
Session resume: --resume "SESSION_ID"
```

Models: gemini-2.5-flash, gemini-2.5-pro, gemini-3-flash, gemini-3-pro
Models: gemini-2.5-flash, gemini-2.5-pro, gemini-3-flash-preview, gemini-3-pro-preview, gemini-3.1-pro-preview

| Effort | Model |
|--------|-------|
| low | gemini-2.5-flash |
| medium | gemini-3-flash |
| high | gemini-3-pro |
| max | gemini-3-pro |
| medium | gemini-3-flash-preview |
| high | gemini-3-pro-preview |
| max | gemini-3.1-pro-preview |

**Parse output**: `JSON.parse(stdout).response`
**Session ID**: `JSON.parse(stdout).session_id`
Expand All @@ -89,14 +89,14 @@ Session resume (latest): codex exec resume --last "QUESTION" --json

Note: `codex exec` is the non-interactive/headless mode. There is no `-q` flag. The TUI mode is `codex` (no subcommand).

Models: gpt-5.3-codex-spark, gpt-5-codex, gpt-5.1-codex, gpt-5.2-codex, gpt-5.3-codex, gpt-5.1-codex-max
Models: o4-mini, o3

| Effort | Model | Reasoning |
|--------|-------|-----------|
| low | gpt-5.3-codex-spark | low |
| medium | gpt-5.2-codex | medium |
| high | gpt-5.3-codex | high |
| max | gpt-5.3-codex | xhigh |
| low | o4-mini | low |
| medium | o4-mini | medium |
| high | o3 | high |
| max | o3 | high |

**Parse output**: `JSON.parse(stdout).message` or raw text
**Session ID**: Codex prints a resume hint at session end (e.g., `codex resume SESSION_ID`). Extract the session ID from stdout or from `JSON.parse(stdout).session_id` if available.
Expand All @@ -110,7 +110,7 @@ Session resume: opencode run "QUESTION" --format json --model "MODEL" --variant
With thinking: add --thinking flag
```

Models: 75+ via providers (format: provider/model). Top picks: claude-sonnet-4-5, claude-opus-4-5, gpt-5.2, gpt-5.1-codex, gemini-3-pro, minimax-m2.1
Models: 75+ via providers (format: provider/model). Top picks: claude-sonnet-4-6, claude-opus-4-6, gpt-5.2, o3, gemini-3-pro-preview, minimax-m2.1

| Effort | Model | Variant |
|--------|-------|---------|
Expand All @@ -129,7 +129,7 @@ Models: 75+ via providers (format: provider/model). Top picks: claude-sonnet-4-5
Command: copilot -p "QUESTION"
```

Models: claude-sonnet-4-5 (default), claude-opus-4-6, claude-haiku-4-5, claude-sonnet-4, gpt-5
Models: claude-sonnet-4-6 (default), claude-opus-4-6, claude-haiku-4-5, gpt-5

| Effort | Notes |
|--------|-------|
Expand Down Expand Up @@ -277,7 +277,7 @@ Return a plain JSON object to stdout (no markers or wrappers):
```json
{
"tool": "gemini",
"model": "gemini-3-pro",
"model": "gemini-3-pro-preview",
"effort": "high",
"duration_ms": 12300,
"response": "The AI's response text here...",
Expand Down Expand Up @@ -315,4 +315,4 @@ This skill is invoked by:
- `consult-agent` for `/consult` command
- Direct invocation: `Skill('consult', '"question" --tool=gemini --effort=high')`

Example: `Skill('consult', '"Is this approach correct?" --tool=gemini --effort=high --model=gemini-3-pro')`
Example: `Skill('consult', '"Is this approach correct?" --tool=gemini --effort=high --model=gemini-3-pro-preview')`
42 changes: 32 additions & 10 deletions adapters/opencode/skills/debate/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,35 @@ Platform state directory:
| Tool invocation timeout (>240s) | Round 1 proposer: abort. Round 1 challenger: proceed with uncontested. Round 2+: synthesize from completed rounds with timeout note. |
| All rounds timeout | "[ERROR] Debate failed: all tool invocations timed out." |

## Consult Skill Integration

Each tool invocation uses the existing `consult` skill from the consult plugin. The orchestrator invokes it as:

```
Skill: consult
Args: "{debate prompt with context}" --tool={tool} --effort={effort} --model={model}
```

The consult skill handles: provider command building, safe question passing (temp file), output parsing, and secret redaction. The debate skill does NOT duplicate this logic.
## External Tool Quick Reference

> Canonical source: consult skill (`consult/SKILL.md`). This table is for **planning reference only** -- always invoke via `Skill: consult`, which handles safe question passing, temp file creation, and cleanup. Do NOT execute these commands directly.

### Safe Command Patterns

| Provider | Safe Command Pattern |
|----------|---------------------|
| 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"` |
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Codex safe command pattern example has invalid shell quoting due to nested unescaped double quotes around the temp-file path. Rewrite the example to avoid nested quotes (single quotes or escaped quotes) so the reference is syntactically correct.

Suggested change
| Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` |
| Codex | `codex exec "$(cat '{AI_STATE_DIR}/consult/question.tmp')" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` |

Copilot uses AI. Check for mistakes.
| OpenCode | `opencode run - --format json --model "MODEL" --variant "VARIANT" < "{AI_STATE_DIR}/consult/question.tmp"` |
| Copilot | `copilot -p - < "{AI_STATE_DIR}/consult/question.tmp"` |

### Effort-to-Model Mapping

| Effort | Claude | Gemini | Codex | OpenCode | Copilot |
|--------|--------|--------|-------|----------|---------|
| low | claude-haiku-4-5 (1 turn) | gemini-2.5-flash | o4-mini (low) | default (low) | no control |
| medium | claude-sonnet-4-6 (3 turns) | gemini-3-flash-preview | o4-mini (medium) | default (medium) | no control |
| high | claude-opus-4-6 (5 turns) | gemini-3-pro-preview | o3 (high) | default (high) | no control |
| max | claude-opus-4-6 (10 turns) | gemini-3.1-pro-preview | o3 (high) | default + --thinking | no control |

### Output Parsing

| Provider | Parse Expression |
|----------|-----------------|
| Claude | `JSON.parse(stdout).result` |
| Gemini | `JSON.parse(stdout).response` |
| Codex | `JSON.parse(stdout).message` or raw text |
| OpenCode | Parse JSON events, extract final text block |
| Copilot | Raw stdout text |
Loading
Loading