Socratic duel

From rp1-run/rp1 · View interactive version

Socratic duel is an AI agent skill from the GitHub repository rp1-run/rp1. Run a bounded, evidence-driven two-agent debate into a separate rp1 debate artifact with backend locks only.

How to use this skill

Skill file

Socratic Duel

§ROLE: Debate participant and debate artifact steward for /rp1-base:socratic-duel.

§OBJ

§BOUNDARY

§CTX

STATE-MACHINE

stateDiagram-v2
    [*] --> preparing
    preparing --> waiting_for_participant : peer_missing
    preparing --> debating : ready
    waiting_for_participant --> debating : peer_ready
    waiting_for_participant --> closing : wait_timeout
    debating --> debating : yielded
    debating --> waiting_for_participant : peer_wait
    debating --> closing : terminal
    closing --> completed : accepted_or_dissent_or_timeout
    closing --> invalidated : validation_failed
    completed --> [*]
    invalidated --> [*]

References

| File | Purpose | When to Load |

|------|---------|--------------|

| references/protocol.md | Full emit sequences, turn-by-turn procedure, turn structure (TURN_MARKDOWN, TURN_RULES), prohibitions (DONT) | Always -- read after this file before first action |

§EMIT (summary)

On every primary state entry, emit status_change with --step {CURRENT_STATE}.

Key events: participant_registered, participant_waiting, lock_acquired, lock_released as unit events.

Emit artifact_registered once after first Write creates {debate_path}.

Emit turn_composing/artifact_updated per turn with --unit turn:{N}.

Emit btw_update for candidate convergence (duel stays active).

Terminal: --close-run with status:"completed" for ACCEPTED_CONSENSUS/DISSENT/MAX_TURNS/TIMEOUT, status:"failed" for INVALIDATED.

See references/protocol.md EMIT section for all emit block specifications.

§PROC (summary)

  1. preparing -- Validate source path, join duel via backend, emit participant_registered, load artifact template. Transition to waiting_for_participant (< 2 participants) or debating.
  2. waiting_for_participant -- Bounded poll for peer. On timeout: claim-lock with --for-timeout, re-check status; if still < 2 participants, transition to closing with TIMEOUT; if peer appeared, transition to debating.
  3. debating -- Claim lock, read source + artifact, create artifact from template if missing (emit artifact_registered once). Draft one turn per TURN_MARKDOWN/TURN_RULES. Enforce alternation, 6-turn max, topic focus. Release lock; if terminal, transition to closing.
  4. closing -- Write terminal conclusion while holding lease. Run release-lock with --close --outcome. If close returns closed:false, re-run status and follow next_step. Emit lock_released + artifact_updated. Transition to completed or invalidated.
  5. completed -- Emit terminal completion with --close-run. Report outcome and debate artifact path.
  6. invalidated -- Emit terminal invalidation with --close-run and status:"failed". Report reason.

See references/protocol.md for full procedure detail, turn structure, and prohibitions.

§OUTCOMES

| Outcome | Use when |

|---------|----------|

| ACCEPTED_CONSENSUS | Latest turns from both participants explicitly accept consensus with adequate support and no blocking unresolved items. |

| DISSENT | Material disagreement remains after both participants contributed, or blocking unresolved items remain. |

| MAX_TURNS | Turn 6 is accepted without consensus or dissent. |

| TIMEOUT | Bounded waiting expires without valid continuation. |

| INVALIDATED | Source path, topic resolution, artifact structure, local turn sequence, lock ownership, topic focus, or prior-turn immutability fails validation. |

§DONT

See references/protocol.md DONT section for the full prohibitions list.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.