skills/agent-debate/SKILL.md
Debate and reach a decision with another AI agent (e.g. Claude Code <-> Codex) over one shared markdown file. Use when the user asks two agents to discuss, debate, cross-check, or jointly decide a topic, when the user says "talk to the other agent / Codex / Claude about X", or hands you a name and a topic to debate. Agents take turns, poll every ~3 minutes, and pause to ask the user when stuck.
npx skillsauth add tapforce/agents-skills agent-debateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Two agents hold a structured debate by appending to one shared markdown file. You write your turn, then poll until the other agent replies. When you genuinely need a human decision, you ask the user and both agents pause until they answer.
The engine that handles the file, locking, turn-taking, and polling is
debate.sh next to this file. Always go through it — never hand-edit the
debate file (concurrent edits corrupt it; the script locks).
SKILL_DIR="$(dirname "$(readlink -f ~/.claude/skills/agent-debate 2>/dev/null || echo ~/.agents/skills/agent-debate)")/agent-debate"
# Simpler: the script lives beside this SKILL.md. Resolve it once:
D="$HOME/.agents/skills/agent-debate/debate.sh"
The user gives you your name, the peer's name, and a topic
(default names: claude and codex). If the user only gives a topic, assume
you are claude (Claude Code) or codex (Codex) per whichever tool you are,
and the peer is the other.
The topic is a short slug (a few words) — it becomes the shared filename,
so keep it short and stable. Both agents MUST pass the same topic so they
land on the same file (e.g. modal-vs-selfhost).
The actual subject — the paragraph of detail, requirements, constraints — is the
brief, written into the file at init time, not the filename. The agent
the user told to start passes it:
"$D" init "<short-topic>" <me> <peer> - <<'EOF'
<the full paragraph(s): what we're deciding, context, constraints, success criteria>
EOF
If the user hands you a long paragraph, distill a short topic slug from it and
put the paragraph in the brief. The joining agent just runs
"$D" init "<short-topic>" <me> <peer> (no brief) and reads it via show.
Open the channel. Create (or join) the file (idempotent; first caller is the initiator):
show to confirm, then post your opening position:
"$D" init "<short-topic>" <me> <peer> - <<'EOF'
<the full brief: what we're deciding, context, constraints>
EOF
"$D" post "<short-topic>" <me> - <<'EOF'
<your opening argument>
EOF
"$D" init "<short-topic>" <me> <peer>
"$D" show "<short-topic>" # read the brief + any messages so far
Wait for your turn. Block until it's your turn / a human is needed / it's done:
"$D" wait "<topic>" <me>
run_in_background: true. The harness
re-invokes you when it exits — don't block the foreground (sleep is
blocked there anyway). It polls every 3 min internally.wait also prints the full debate so you have fresh context.Act on the result:
"$D" post "<topic>" <me> - <<'EOF'
<your response>
EOF
Then go back to step 2 (wait).ASK block) and stop to
wait for their reply. When the user answers you, record it:
"$D" answer "<topic>" - <<'EOF'
<what the user said>
EOF
Then go back to step 2 (wait). Both agents see the answer and resume.SUMMARY (the proposed
conclusion). Review it critically against the whole debate: is anything
missing, mis-stated, or unsupported? List concrete gaps.
post them (turn returns to the summarizer to revise).accept it (this converges the debate):
"$D" accept "<topic>" <me> -m "Reviewed — complete and accurate."
accept you STOP.ACCEPT (or DECISION) is the last block. Summarize
the outcome to the user and STOP. Do not start another wait, do
not loop, do not keep polling. The debate is over until the user explicitly
tells you to resume it (see "Stopping & resuming").
"$D" doc "<topic>" prints a
clean standalone document (brief + accepted conclusion); redirect it where
they want, e.g. "$D" doc "<topic>" > decision.md.When YOU need the human (irreconcilable disagreement, missing requirement, a values/priorities call only the user can make) — instead of posting a message, ask the user:
"$D" ask "<topic>" <me> - <<'EOF'
<a crisp question, with the options and the trade-off>
EOF
Surface the same question to your user, then go to step 2 (wait). Both
agents pause on awaiting-user until someone records the answer.
Concluding. Two ways, depending on how formal the outcome needs to be:
(a) Quick decision — for a simple agreed call. The agent whose turn it is:
"$D" decide "<topic>" <me> -m "<the agreed decision + one line of rationale>"
(b) Reviewed summary (recommended for anything you'll act on) — the conclusion gets peer-reviewed before it's final:
"$D" summarize "<topic>" <me> - <<'EOF'
<the full conclusion: what was decided, why, key trade-offs, follow-ups>
EOF
summarize) or accepts it.accept the debate converges. Both agents STOP. "$D" doc "<topic>"
turns the accepted summary into a clean document on demand.After concluding (either way), summarize to the user and stop — do not wait
again. The peer's wait returns 30 and it stops too.
DECISION is the
last block) both agents summarize and stop. Neither agent re-arms wait or
keeps polling. Stay stopped until the user says otherwise — do not resume on
your own."$D" latest # or use the topic the user names
"$D" show "<topic>" # re-read the full history incl. the decision
"$D" post "<topic>" <me> - <<'EOF'
Reopening per the user: <what they want to revisit / new info>.
EOF
Posting after a DECISION reopens the thread (the decision is no longer the
last block), and normal turn-taking resumes. The user must re-engage the peer
too — don't assume the other agent is still listening after a finished debate.post when wait says it's your turn. The engine
enforces turn order (turn = the agent who didn't write the last message), so
trust it rather than posting twice.decide only when there's genuine
agreement or the user has settled it. If you think you're done but the peer
hasn't agreed, post "I propose we conclude with X — agree?" and wait.ask) only for genuine human calls. When you do, make the
question and trade-offs concrete.decide (30) or the user stops you."$D" status "<topic>" # status= turn= last_msg_from= open_ask= file=
"$D" turn "<topic>" <me>
"$D" show "<topic>" # print the whole debate
"$D" path "<topic>" # the resolved file path (under ~/.agent-debates/)
"$D" latest # most recently created debate file (joiner shortcut)
"$D" list # all debate files, newest first
"$D" doc "<topic>" # clean standalone document from the accepted conclusion
If the user starts the other agent and doesn't repeat the topic to you, you can
find the active debate with "$D" latest and derive the topic from its filename
(strip the dir and .md). Prefer an explicit topic when the user gives one.
# Debate: <topic>
<!--DEBATE
participants: architect,reviewer
initiator: architect
created: 2026-06-07T10:00:00Z
-->
<!--BRIEF-->
Decide whether datalabs runs lessons on Modal or self-hosted. Constraints:
budget < $X/mo, cold-start < 3s, must keep CSP/allow_root setup. Success =
cheaper at our scale without losing isolation.
<!--/BRIEF-->
<!--MSG from=architect ts=2026-06-07T10:00:00Z-->
I think we should use approach A because ...
<!--/MSG-->
<!--MSG from=reviewer ts=2026-06-07T10:03:00Z-->
Disagree — approach B handles edge case X ...
<!--/MSG-->
<!--ASK from=architect to=user id=q20260607100500 ts=2026-06-07T10:05:00Z-->
Do we prioritize latency or memory here?
<!--/ASK-->
<!--ANSWER to=q20260607100500 from=user ts=2026-06-07T10:09:00Z-->
Latency.
<!--/ANSWER-->
<!--SUMMARY from=architect ts=2026-06-07T10:12:00Z-->
Decision: approach A, latency-tuned. Rationale, trade-offs, follow-ups ...
<!--/SUMMARY-->
<!--ACCEPT from=reviewer ts=2026-06-07T10:15:00Z-->
Reviewed — complete and accurate.
<!--/ACCEPT-->
Block types: BRIEF (the subject), MSG (a turn), ASK/ANSWER (human
interjection), SUMMARY (proposed conclusion, peer-reviewed), ACCEPT (sign-off,
converges), DECISION (quick one-line conclusion, converges). The conversation
(MSG) and the conclusion (SUMMARY/ACCEPT) live in the same file as distinct
blocks; doc extracts just the conclusion.
AGENT_DEBATE_INTERVAL — poll seconds (default 180 = 3 min).AGENT_DEBATE_TIMEOUT — max seconds wait blocks before returning code 10
(default 0 = wait forever). Useful to cap Codex foreground waits.AGENT_DEBATE_DIR — where debate files live (default ~/.agent-debates).development
Best practices for setting up and developing UX/UI for projects using Tailwind CSS ^4. Use when setting up new projects with Tailwind CSS support or when projects have Tailwind CSS installed.
development
Best practices for setting up and developing Svelte projects using SvelteKit ^2.0.0. Use when considering setup or development based on SvelteKit framework.
development
Best practices for setup and use of shadcn-svelte library to develop UX/UI in Svelte projects. Use this skill when project is using Svelte/SvelteKit framework as main app framework, when user attempts to setup new project or when user is developing on existing project using shadcn-svelte components.
tools
Best practices for using pnpm ^10.0.0 in Node.js projects. Use when working with Node.js-based projects.