一键导入
code-debate
Two coding agents debate code changes through a shared DEBATE.md file. Use when you want adversarial review of a commit, diff, or PR.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Two coding agents debate code changes through a shared DEBATE.md file. Use when you want adversarial review of a commit, diff, or PR.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
MindRoom documentation corpus for accurate product, configuration, and workflow guidance.
Run live end-to-end checks for this repository. Use when booting the local MindRoom stack or SaaS sandbox, starting an isolated local Matrix/backend instance, creating disposable Matrix accounts, sending or reading messages with Matty, hitting live API endpoints, taking frontend screenshots, or verifying behavior through the real UI instead of tests alone. Also use when a live-test workflow struggled and the skill itself should be improved.
Use when the user asks for native Codex sub-agents, parallel PR review agents, unbiased re-review loops, or main-thread fixes after agent findings in the MindRoom repository.
Use when fetching, triaging, or addressing PR review comments from GitHub, copied text, cloud AI reviewers, or other coding agents in the MindRoom repository.
Use when spawning and supervising multiple agent-cli Codex worktrees through tmux, especially when you must poll progress, force prompt rereads against the local TASK file, run current-context and fresh-context pr-review loops, and verify that review fixes are actually pushed before merge.
Zero-tolerance pull request review. Every issue is a blocker. Use when reviewing PRs for merge readiness.
| name | code-debate |
| description | Two coding agents debate code changes through a shared DEBATE.md file. Use when you want adversarial review of a commit, diff, or PR. |
| argument-hint | [A|B] [subject: commit, diff, PR, or file to debate] |
A protocol for two coding agents (Claude Code, Gemini CLI, Codex, or any other) to debate code changes through a shared file (DEBATE.md). Both agents receive this same prompt. Role is determined by the first argument.
This skill assumes the two debate participants are started externally by a human in separate sessions. It is not a peer-orchestration skill.
Open two terminal tabs with coding agents (same or different). Invoke this skill in each, specifying role and subject:
/code-debate A <subject> — opener, creates DEBATE.md with the first analysis/code-debate B <subject> — responder, waits for DEBATE.md then repliesYour role is determined by the first argument ($0):
A → you are Agent A (opener). Create DEBATE.md and write the opening position.B → you are Agent B (responder). Poll and wait for DEBATE.md to exist, then read it and respond.If no role argument is provided, fall back to file existence:
DEBATE.md does not exist → you are Agent A (opener).DEBATE.md already exists → you are Agent B (responder).Do not ask the user which role to play.
spawn_agent, send_input, tmux supervision, background shell automation, or any other tool to manufacture the missing peer.## CONSENSUS.## CONSENSUS.## CONSENSUS from your own role.Use a portable checksum. Pick the first available:
CKSUM() { { md5sum "$1" 2>/dev/null || md5 -q "$1" 2>/dev/null || shasum "$1"; } | awk '{print $1}'; }
Define this function before running the poll loop.
Run polling commands in bash. The timeout example uses Bash's SECONDS.
Before appending a section, check the last ## heading in DEBATE.md:
## Opening → only Agent B may append ## Response 1.## Response N → only Agent A may append ## Follow-up N (or ## CONSENSUS).## Follow-up N → only Agent B may append ## Response N+1.If it is not your turn, re-read the file and go back to polling.
Before appending, also verify the last signature line role:
## CONSENSUS existsDEBATE.md and continue the protocol.## CONSENSUS exists or timeout handling completes.DEBATE.md contains ## CONSENSUS, orDEBATE.md exists and does not contain ## CONSENSUS, do not reply; continue append/poll flow immediately.## Opening, ## Response N, ## Follow-up N), run one blocking poll loop.## CONSENSUS, or timeout.## CONSENSUS exists, or## CONSENSUS was appended.## Opening, ## Response N, or ## Follow-up N without entering the poll loop.DEBATE.md does not yet contain ## CONSENSUS, you must still be in the protocol loop (append or poll).git show, git diff, gh pr view, read files, etc. as appropriate).DEBATE.md using the file format below.CKSUM DEBATE.md.PREV=$(CKSUM DEBATE.md); SECONDS=0; while true; do sleep 5; if grep -q '^## CONSENSUS' DEBATE.md; then break; fi; NOW=$(CKSUM DEBATE.md); if [ "$NOW" != "$PREV" ]; then break; fi; if [ "$SECONDS" -ge 600 ]; then echo "TIMEOUT"; break; fi; done
This step is blocking and mandatory; do not exit the workflow before it finishes.## CONSENSUS noting the timeout and stop.## CONSENSUS section summarizing agreed outcomes and stop.## Follow-up N section addressing unresolved points, then go to step 3.DEBATE.md exists before reading:
DEBATE.md as Agent B and do not start Agent A yourself.
Example:SECONDS=0; while [ ! -f DEBATE.md ]; do sleep 5; if [ "$SECONDS" -ge 600 ]; then echo "TIMEOUT waiting for DEBATE.md"; exit 0; fi; done
git show, git diff, gh pr view, read files, etc. as appropriate).## heading). Example:
LAST=$(grep -E '^## ' DEBATE.md | tail -n1)
If not your turn, poll until it is.## Response N section with a point-by-point reply.## CONSENSUS noting the timeout and stop.## CONSENSUS → stop, debate is over.Each section should end with a signature line: *— Agent A|Agent B (optional tool name), <timestamp>*
# Code Debate: <subject>
## Opening
<Agent A's initial analysis>
*— Agent A, 2025-06-15T14:30:00Z*
---
## Response 1
<Agent B's point-by-point reply>
*— Agent B, 2025-06-15T14:32:00Z*
---
## Follow-up 1
<Agent A's follow-up on unresolved points>
*— Agent A, 2025-06-15T14:35:00Z*
---
## Response 2
<Agent B's reply>
*— Agent B, 2025-06-15T14:38:00Z*
---
## CONSENSUS
<final agreed outcomes and action items>
Every point in a response must be explicitly categorized:
If the agent has already completed its own review of the subject, it must also include an Independent findings section in its next debate turn:
same as other agentnew findingnot reproduced / disagreed## CONSENSUS summarizing what was agreed and listing remaining disagreements.## CONSENSUS heading is the stop signal. When you see it, stop polling and end.DEBATE.md is a scratch file; delete it after the debate unless you want to keep it as a record.