#!/usr/bin/env bash # council.sh — Reference implementation for council orchestration. # # This script is NOT executed directly. It documents the orchestration # logic the main agent follows when invoking the council skill. # # The main agent uses sessions_spawn (mode=run) to create each subagent. # # ─── PARALLEL FLOW (default) ─────────────────────────────────────── # # 1. Build advisor prompts from references/prompts.md templates. # 2. Spawn 3 advisor subagents simultaneously: # # sessions_spawn( # task = "\n\nTopic: ", # mode = "run", # label = "council-", # e.g. council-pragmatist # model = "", # optional override # ) # # 3. Wait for all 3 completion events (push-based). # 4. Collect advisor outputs. # 5. Spawn referee subagent: # # sessions_spawn( # task = "", # mode = "run", # label = "council-referee", # model = "", # may be stronger than advisors # ) # # 6. Deliver referee output to user with individual advisor perspectives # included as collapsed summaries. # # ─── SEQUENTIAL FLOW ────────────────────────────────────────────── # # Same as parallel but advisors are spawned one at a time. # Each subsequent advisor sees prior outputs in their prompt. # Optional rebuttal round before referee. # # ─── DEBATE FLOW ────────────────────────────────────────────────── # # 1. Parallel initial takes (same as parallel flow steps 1-4). # 2. Rebuttal round: respawn each advisor with all other outputs visible. # 3. Collect rebuttals. # 4. Spawn referee with initial takes + rebuttals. # # ─── MODEL TIER SELECTION ───────────────────────────────────────── # # Light: advisors=default, referee=default # Medium: advisors=default, referee=stronger (e.g. opus-tier) # Heavy: advisors=stronger, referee=stronger # # The main agent decides tier before spawning based on topic complexity.