debate
SKILL.md
Debate - Cross-Model Discussion Loop
Orchestrate multi-round discussion between two models.
crhandles code-focused critique.peer-reviewhandles proposal/viewpoint critique.debateis the routing + loop + decision layer.
Load references when needed:
- Phase 3 (Routing): Read
references/protocols.mdfor I/O contracts, backend call formats, and mixed artifact splitting rules - Phase 4 (Judge Analysis): Read
references/judge-analysis.mdfor critique validation rubric and A/B/C/D/E recommendation logic - Code Snippets (non-git): Read
references/code-snippet-handling.mdwhen reviewing code without git context
Usage
/debate
/debate "explicit content to debate"
/debate --target auto --max-rounds 3 --mode auto
/debate --target code --scope commit:abc1234
/debate --target proposal --max-rounds 2
Script-first execution (recommended for repeatability):
python3 skills/debate/scripts/debate.py
python3 skills/debate/scripts/debate.py --intensity quick --target proposal --mode auto
python3 skills/debate/scripts/debate.py --target code --scope uncommitted --max-rounds 3 --mode manual
python3 skills/debate/scripts/debate.py --target proposal --artifact-file /tmp/proposal.md --mode auto
python3 skills/debate/scripts/debate.py --target proposal --state-dir /tmp/debate-state --mode auto
python3 skills/debate/scripts/debate.py --target proposal --mode auto --skip-materialize-opposite
Parameters
--target:auto|code|proposal|mixed(defaultauto)--scope(code only):- git workspace:
uncommitted|commit:<sha>|base:<branch>|range:<a>..<b>|file:<path> - non-git workspace:
file:<path>or explicit snippet content
- git workspace:
--intensity:quick|standard|extensive(defaultstandard)quick:max_rounds=1,budget=10m,backend_timeout=180sstandard:max_rounds=3,budget=20m,backend_timeout=600sextensive:max_rounds=5,budget=40m,backend_timeout=900s
--max-rounds:1..5(defaults from--intensity; explicit value overrides profile)--mode:auto|manual(defaultauto)--budget-minutes: defaults from--intensity; explicit value overrides profile--backend-timeout-seconds: defaults from--intensity; recommend>=120for proposal/mixed--skip-materialize-opposite: skip the second model call when choosingB(faster, but final artifact is not auto-rewritten)--state-dir: override session storage root
Phase 1 - Resolve Artifact (auto by default)
If user provides explicit content, use it directly.
Else detect from latest context in this order:
- If working tree has changes and user intent is code review, candidate is code (
git diff). - Else inspect last assistant message:
- has fenced code blocks -> candidate code
- has proposal sections (
Design,Proposal,Approach,Decision) -> candidate proposal - short generic text (<2000 chars) -> candidate full message
- If confidence is low, ask one confirmation question:
- "I detected X as debate target. Continue?"
Confidence guideline:
- high: explicit scope or obvious code/proposal markers
- medium: partial markers
- low: ambiguous or multiple candidates
For target=mixed, use deterministic splitting rules from references/protocols.md.
Phase 2 - Package Context
Create session folder:
SESSION_ID="debate-$(date +%Y%m%d-%H%M%S)-$$"
if in_git_repo; then
SESSION_BASE="<git_root>/.git/review-loop"
else
SESSION_BASE="${XDG_STATE_HOME:-$HOME/.local/state}/debate/<workspace-key>/review-loop"
fi
SESSION_DIR="$SESSION_BASE/$SESSION_ID"
mkdir -p "$SESSION_DIR"
Persist:
artifact.md- debated contentmetadata.json- target type, scope, rounds, timestampdecision.json- machine-readable final decision and judge historyround-<n>-input.md/round-<n>-critique.mdsummary.md
Security note:
decision.json/metadata.jsonmay include local paths, backend error strings, and judge rationale.- Keep these files out of version control unless you explicitly need audit artifacts.
Do not stage these files.
Phase 3 - Route to Opposite Model
Use explicit call contracts in references/protocols.md.
Target code
- Run
crprotocol with resolvedscope. - Request structured output:
P1/P2/P3- concrete evidence (
file:linewhen possible) - suggested actions
Target proposal or doc
- Run
peer-reviewprotocol. - Request structured output:
P1/P2/P3- missing alternatives
- recommended decision
Target mixed
- Split artifact into code and proposal segments per protocol rules.
- Run both paths and merge critiques into one round result.
For code snippets (no git diff), follow references/code-snippet-handling.md.
Phase 4 - Multi-Round Loop
For each round n up to max-rounds:
- Send current artifact to opposite model.
- Receive critique and summarize:
- agreements
- concerns
- suggestions
- Judge analyzes critique (current model):
- classify findings:
Valid / Invalid / Missing - score severity concentration (
P1/P2/P3) - generate recommendation:
A|B|C|D|E+ rationale - use rubric in
references/judge-analysis.md
- classify findings:
- Present choices with judge recommendation:
AKeep originalBAccept opposite model recommendationCGenerate compromise versionDContinue with rebuttal (next round)EStop without final decision
- Handle choice:
A/B-> finalize and exitC-> generate v-next and continueD-> attach rebuttal and continueE-> stop and save session
- Save round artifacts in
SESSION_DIR.
Phase 5 - Convergence and Budget Guards
Stop when any condition is met:
max-roundsreached- budget exceeded (
--budget-minutes) - two consecutive rounds have no new
P1/P2 - critique indicates agreement (
no concerns,LGTM, equivalent) - user chooses
A,B, orE
Never run unbounded loops.
Final Output Contract
## Debate Summary
Session: <id>
Target: <code|proposal|mixed>
Rounds: <n>
Converged: <yes|no>
### Final Decision
- Keep Original | Accept Opposite | Compromise | Stopped
### Final Artifact
<content or reference>
### Key Findings
- P1:
- P2:
- P3:
### Judge Recommendation History
- Round 1: <A|B|C|D|E + reason>
- Round 2: <...>
### Unresolved
- ...
### Next Actions
1. [ ] ...
2. [ ] ...
Automation Rules
- Prefer
target=autoand low-friction defaults. - Ask at most one clarifying question per round unless blocked.
- If tool/backend unavailable, provide fallback:
- continue with local model critique
- keep session state for audit/history
Weekly Installs
1
Repository
fancive/claude-skillsFirst Seen
11 days ago
Security Audits
Installed on
codex1