feat(council): add council advisory skill with parallel/sequential/debate flows

- 3 advisors (Pragmatist, Visionary, Skeptic) + 1 Referee subagent
- Default: parallel + synthesis flow
- Prompt templates in references/prompts.md
- Model tier selection based on topic complexity
- Added TODO tasks for personality depth and skill name revisit
This commit is contained in:
zap
2026-03-05 08:41:35 +00:00
parent 2ec8209657
commit 7274d399ce
5 changed files with 259 additions and 0 deletions

16
memory/2026-03-05.md Normal file
View File

@@ -0,0 +1,16 @@
# 2026-03-05
## Council skill created
- Built `skills/council/` — multi-perspective advisory council using subagents.
- Design decisions (agreed with Will):
- Implemented as a **skill** (not standalone agents).
- 3 advisors (Pragmatist, Visionary, Skeptic) + 1 Referee = 4 subagents total.
- Referee is a separate subagent (not the session model) — can use a stronger model tier.
- Default flow: **Parallel + Synthesis**. Sequential and Debate flows also available.
- Final output includes individual advisor perspectives (collapsed/summarized) + referee verdict.
- Model tier chosen per-invocation based on topic complexity.
- Files: `SKILL.md`, `references/prompts.md`, `scripts/council.sh` (reference doc).
- Validated with skill-creator quick_validate.
- Two TODOs added to `memory/tasks.json`:
- Revisit advisor personality depth (richer backstories).
- Revisit skill name ("council" is placeholder).

View File

@@ -28,5 +28,29 @@
"Upstream patch committed in external/openclaw-upstream on branch fix/tui-hide-internal-runtime-context commit 0f66a4547 (suppress internal runtime completion context blocks in TUI formatter).",
"Validation: pnpm test:fast completed successfully (812 files / 6599 tests passing) at 2026-03-04T22:53:29Z"
]
},
{
"id": "task-20260305-0838-council-personality-depth",
"created_at": "2026-03-05T08:38:00Z",
"title": "Revisit council subagent personality depth",
"owner": "zap",
"priority": "low",
"status": "open",
"details": "Explore richer personality backstories and communication styles for council advisor agents beyond the current role/lens/stance pattern.",
"notes": [
"From council skill brainstorm session 2026-03-05."
]
},
{
"id": "task-20260305-0838-council-skill-name",
"created_at": "2026-03-05T08:38:00Z",
"title": "Revisit council skill name",
"owner": "zap",
"priority": "low",
"status": "open",
"details": "council works for now but revisit whether a better name fits as the feature matures.",
"notes": [
"From council skill brainstorm session 2026-03-05."
]
}
]

73
skills/council/SKILL.md Normal file
View File

@@ -0,0 +1,73 @@
---
name: council
description: "Convene a council of AI advisor agents with distinct perspectives to deliberate on a topic, then synthesize their views into a verdict. Use when: (1) user asks for multi-perspective analysis, (2) wants to brainstorm with diverse viewpoints, (3) requests a council or advisors opinion, (4) needs a balanced decision on a complex question. Supports parallel (default), sequential, and debate flows. NOT for: simple factual lookups, single-perspective tasks, or quick one-liner answers."
---
# Council Skill
Spawn a council of 3 advisor subagents + 1 referee subagent to deliberate on a topic.
Each advisor has a distinct personality/lens. The referee synthesizes their output into a
final verdict with collapsed advisor perspectives.
## Advisor Roster (default)
| Role | Lens | System stance |
|--------------|---------------------------------|----------------------------------|
| Pragmatist | Feasibility, cost, effort | "Can we actually do this?" |
| Visionary | Long-term potential, innovation | "What if we went bigger?" |
| Skeptic | Risk, failure modes, edge cases | "What could go wrong?" |
The referee is a separate agent: balanced, fair, synthesis-oriented.
## Flows
Three deliberation flows are available. Default is **parallel**.
### 1. Parallel + Synthesis (default)
1. Spawn all 3 advisors simultaneously via `sessions_spawn` (mode=run).
2. Each advisor receives the same topic prompt with their personality instructions.
3. Wait for all 3 to complete (push-based — they announce when done).
4. Spawn the referee with all 3 advisor outputs as context.
5. Referee produces the final verdict.
### 2. Sequential Rounds
1. Spawn advisors one at a time, each seeing prior advisor outputs.
2. After all advisors, spawn referee with full thread.
3. Optionally run a rebuttal round (advisors respond to each other).
### 3. Debate
1. Spawn advisors in parallel for initial takes.
2. Share outputs across advisors for rebuttals (1-2 rounds).
3. Referee moderates and calls convergence.
## Model Selection
Pick model tier based on topic complexity:
- **Light topics** (casual brainstorm, simple pros/cons): use default model for advisors and referee.
- **Medium topics** (architecture decisions, strategy): use default model for advisors, stronger model for referee.
- **Heavy topics** (critical decisions, deep analysis): use stronger model for all agents.
The caller (main agent) determines tier before spawning.
## Prompt Templates
See `references/prompts.md` for full advisor and referee prompt templates with placeholders.
## Implementation
Read `scripts/council.sh` for the orchestration logic.
For programmatic invocation, the main agent can also call `sessions_spawn` directly
following the patterns above.
## Configuration
Advisor personalities can be customized per-invocation by overriding the roster.
Default roster and prompt templates live in `references/prompts.md`.
## TODO (revisit later)
- Revisit subagent personality depth — richer backstories, communication styles
- Revisit skill name — "council" works for now

View File

@@ -0,0 +1,92 @@
# Council Prompt Templates
## Default Advisor Roster
### Pragmatist
- **Role**: Pragmatist
- **Lens**: Feasibility, cost, effort, timeline
- **Stance**: "Can we actually do this?"
- **Style**: Direct, grounded, numbers-oriented. Asks "how" more than "why."
### Visionary
- **Role**: Visionary
- **Lens**: Long-term potential, innovation, opportunity cost of inaction
- **Stance**: "What if we went bigger?"
- **Style**: Ambitious, future-oriented. Pushes boundaries but acknowledges when dreaming.
### Skeptic
- **Role**: Skeptic
- **Lens**: Risk, failure modes, edge cases, unintended consequences
- **Stance**: "What could go wrong?"
- **Style**: Cautious, thorough, devil's advocate. Not negative — protective.
## Advisor System Prompt
```
You are the {ROLE} advisor on a council deliberating a topic.
Your lens: {LENS}
Your typical stance: {STANCE}
Your communication style: {STYLE}
Rules:
- Stay in character. Argue from your perspective consistently.
- Be concise but substantive (200-400 words).
- Acknowledge trade-offs honestly — don't strawman other views.
- Reference specific aspects of the topic, not generic platitudes.
- End with your key recommendation in 1-2 sentences.
Topic:
{TOPIC}
```
## Referee System Prompt
```
You are the Referee of an advisory council. You have received perspectives from multiple advisors with different viewpoints on the same topic.
Your job:
1. Identify points of agreement and disagreement across all advisors.
2. Weigh the arguments fairly — no advisor gets preferential treatment.
3. Produce a final verdict with clear reasoning.
4. Be honest when the answer is genuinely uncertain.
Output format (use these exact headers):
## Advisor Perspectives (Summary)
For each advisor, provide a 2-3 sentence summary of their position and key argument.
## Points of Agreement
What the advisors broadly agree on.
## Key Tensions
Where they disagree and why each side has merit.
## Verdict
Your synthesized recommendation with reasoning. Be specific and actionable.
## Confidence
Rate your confidence: high / medium / low, with a one-line explanation of what would change your mind.
---
Advisor outputs below:
{ADVISOR_OUTPUTS}
```
## Rebuttal Round Prompt (for Sequential/Debate flows)
```
You are the {ROLE} advisor. You've seen the other advisors' perspectives on this topic.
Review their arguments and respond:
- Where do you agree or concede ground?
- Where do you push back, and why?
- Has anything changed your recommendation?
Keep it to 100-200 words.
Other advisor outputs:
{OTHER_OUTPUTS}
```

View File

@@ -0,0 +1,54 @@
#!/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 = "<advisor system prompt>\n\nTopic: <topic>",
# mode = "run",
# label = "council-<role>", # e.g. council-pragmatist
# model = "<chosen model tier>", # optional override
# )
#
# 3. Wait for all 3 completion events (push-based).
# 4. Collect advisor outputs.
# 5. Spawn referee subagent:
#
# sessions_spawn(
# task = "<referee system prompt with all advisor outputs>",
# mode = "run",
# label = "council-referee",
# model = "<chosen model tier>", # 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.