refactor: consolidate party-mode into single self-contained SKILL.md
Inline all adapters, steps, references, and prompt templates directly into SKILL.md. Remove the platform-adapter detection system in favor of a simpler approach using the Agent tool. Streamline agent selection from a weighted scoring algorithm to pragmatic guidelines. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9e3d32080b
commit
601a994553
|
|
@ -1,202 +1,110 @@
|
||||||
---
|
---
|
||||||
name: bmad-party-mode
|
name: bmad-party-mode
|
||||||
description: 'Multi-agent roundtable with independent sub-agent voices. Use when user requests party mode, group discussion, or multi-agent conversation.'
|
description: 'Orchestrates group discussions between installed BMAD agents, enabling natural multi-agent conversations where each agent is a real subagent with independent thinking. Use when user requests party mode, wants multiple agent perspectives, group discussion, roundtable, or multi-agent conversation about their project.'
|
||||||
---
|
---
|
||||||
|
|
||||||
# Party Mode
|
# Party Mode
|
||||||
|
|
||||||
## Overview
|
Facilitate roundtable discussions where BMAD agents participate as **real subagents** — each spawned independently via the Agent tool so they think for themselves. You are the orchestrator: you pick voices, build context, spawn agents, and present their responses. You never generate agent responses yourself.
|
||||||
|
|
||||||
Facilitate dynamic multi-agent roundtable discussions where installed BMAD agents collaborate as **independent sub-agents** — each spawned as its own process with genuine independent thinking. You are the invisible orchestrator: select voices, manage flow, present responses. Never speak as the agents yourself. Works across Claude Code, Codex, and Gemini CLI through a platform adapter system.
|
## Why This Matters
|
||||||
|
|
||||||
### Hard Constraints
|
The whole point of party mode is that each agent produces a genuinely independent perspective. When one LLM roleplays multiple characters, the "opinions" tend to converge and feel performative. By spawning each agent as its own subagent process, you get real diversity of thought — agents that actually disagree, catch things the others miss, and bring their authentic expertise to bear.
|
||||||
|
|
||||||
These rules are inviolable across all platforms:
|
|
||||||
|
|
||||||
1. **One agent = one sub-agent process.** Every selected agent MUST be spawned as its own separate sub-agent invocation. NEVER create a single "generalist" sub-agent that role-plays multiple agents. NEVER delegate the entire roundtable to one sub-agent. The whole point is independent thinking per agent.
|
|
||||||
2. **Always show initial responses.** Pass 1 (initial) agent responses MUST be presented to the user in full. Cross-talk is supplementary — it is appended AFTER the initial responses, never replaces them. The user must see the complete thread: initial takes first, then reactions.
|
|
||||||
3. **Orchestrator never speaks as agents.** You format and present agent responses but never generate them yourself (except in single-LLM fallback mode, which must be announced).
|
|
||||||
|
|
||||||
## On Activation
|
## On Activation
|
||||||
|
|
||||||
### Platform Detection
|
1. **Load config via bmad-init skill** — store `{user_name}`, `{communication_language}`, and other config vars.
|
||||||
|
|
||||||
Detect platform and load the corresponding adapter:
|
2. **Read the agent manifest** at `{project-root}/_bmad/_config/agent-manifest.csv`. Build an internal roster of available agents with their displayName, title, icon, role, identity, communicationStyle, and principles.
|
||||||
|
|
||||||
| Platform | Detection Signal | Adapter |
|
3. **Load project context** — search for `**/project-context.md`. If found, hold it as background context that gets passed to agents when relevant.
|
||||||
|---|---|---|
|
|
||||||
| **Claude Code** | `Agent` tool available | `./adapters/claude-code.md` |
|
|
||||||
| **Codex** | Inside Codex CLI, or `.codex/` exists | `./adapters/codex.md` |
|
|
||||||
| **Gemini CLI** | Inside Gemini CLI, or `.gemini/` exists | `./adapters/gemini.md` |
|
|
||||||
|
|
||||||
Default to Claude Code if uncertain. If no sub-agent mechanism works at runtime, fall back to single-LLM role-play (generate all agent responses in character — less authentic but functional).
|
4. **Welcome the user** — briefly introduce party mode. Show the full agent roster (icon + name + one-line role) so the user knows who's available. Ask what they'd like to discuss.
|
||||||
|
|
||||||
### Configuration
|
## The Core Loop
|
||||||
|
|
||||||
Load from `{project-root}/_bmad/config.yaml` and `{project-root}/_bmad/config.user.yaml` if present. Sensible defaults for anything not configured.
|
For each user message:
|
||||||
|
|
||||||
- `{user_name}` (default: null)
|
### 1. Pick the Right Voices
|
||||||
- `{communication_language}` (default: match user's language) — inject into all agent prompts
|
|
||||||
- Agent manifest: `{project-root}/_bmad/_config/agent-manifest.csv`
|
|
||||||
|
|
||||||
### Agent Manifest
|
Choose 2-4 agents whose expertise is most relevant to what the user is asking. Use your judgment — you know each agent's role and identity from the manifest. Some guidelines:
|
||||||
|
|
||||||
Parse each CSV row for merged personality profiles:
|
- **Simple question**: 2 agents with the most relevant expertise
|
||||||
|
- **Complex or cross-cutting topic**: 3-4 agents from different domains
|
||||||
|
- **User names specific agents**: Always include those, plus 1-2 complementary voices
|
||||||
|
- **User asks an agent to respond to another**: Spawn just that agent with the other's response as context
|
||||||
|
- **Rotate over time** — avoid the same 2 agents dominating every round
|
||||||
|
|
||||||
| Field | Purpose |
|
### 2. Build Context and Spawn
|
||||||
|---|---|
|
|
||||||
| name | System identifier |
|
|
||||||
| displayName | Conversational name |
|
|
||||||
| title | Role/position |
|
|
||||||
| icon | Emoji identifier |
|
|
||||||
| role | Capabilities summary |
|
|
||||||
| identity | Background and expertise depth |
|
|
||||||
| communicationStyle | Voice and tone guide |
|
|
||||||
| principles | Values and decision philosophy |
|
|
||||||
| module | Source module |
|
|
||||||
| path | Agent file location (merge additional data if readable) |
|
|
||||||
|
|
||||||
Structure each profile as a **spawn-ready prompt block** using `./references/agent-prompt-template.md`.
|
For each selected agent, spawn a subagent using the Agent tool. Each subagent gets:
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
|
**The agent prompt** (built from the manifest data):
|
||||||
```
|
```
|
||||||
┌─────────────────────────────────────────────────────┐
|
You are {displayName} ({title}), a BMAD agent in a collaborative roundtable discussion.
|
||||||
│ ORCHESTRATOR (you — main context) │
|
|
||||||
│ Scores agents · Manages state · Adapts rounds │
|
## Your Persona
|
||||||
├─────────────────────────────────────────────────────┤
|
- Icon: {icon}
|
||||||
│ Per round: │
|
- Communication Style: {communicationStyle}
|
||||||
│ 1. Score & select agents (1-3) │
|
- Principles: {principles}
|
||||||
│ 2. Calibrate round (model, depth, cross-talk?) │
|
- Identity: {identity}
|
||||||
│ 3. Spawn sub-agents via platform adapter │
|
|
||||||
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
## Discussion Context
|
||||||
│ │ Agent A │ │ Agent B │ │ Agent C │ │
|
{summary of the conversation so far — keep under 400 words}
|
||||||
│ │(parallel)│ │(parallel)│ │(parallel)│ │
|
|
||||||
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
|
{project context if relevant}
|
||||||
│ └─────────────┴─────────────┘ │
|
|
||||||
│ 4. Assess quality · Optional cross-talk pass │
|
## What Other Agents Said This Round
|
||||||
│ 5. Present round · Update state │
|
{if this is a cross-talk or reaction request, include the responses being reacted to — otherwise omit this section}
|
||||||
└─────────────────────────────────────────────────────┘
|
|
||||||
|
## The User's Message
|
||||||
|
{the user's actual message}
|
||||||
|
|
||||||
|
## Guidelines
|
||||||
|
- Respond authentically as {displayName}. Your perspective should reflect your genuine expertise.
|
||||||
|
- Start your response with: {icon} **{displayName}:**
|
||||||
|
- Speak in {communication_language}.
|
||||||
|
- Scale your response to the substance — don't pad. If you have a brief point, make it briefly.
|
||||||
|
- Disagree with other agents when your expertise tells you to. Don't hedge or be polite about it.
|
||||||
|
- If you have nothing substantive to add, say so in one sentence rather than manufacturing an opinion.
|
||||||
|
- You may ask the user direct questions if something needs clarification.
|
||||||
|
- Do NOT use tools. Just respond with your perspective.
|
||||||
```
|
```
|
||||||
|
|
||||||
Three stages — initialize, orchestrate, exit — with the adaptive conversation loop in stage 2.
|
**Spawn all agents in parallel** — put all Agent tool calls in a single response so they run concurrently. Use `model: "sonnet"` for the subagents to keep things fast.
|
||||||
|
|
||||||
---
|
### 3. Present Responses
|
||||||
|
|
||||||
## Agent Selection: Scoring Algorithm
|
Collect all agent responses and present them to the user as-is. Don't summarize, edit, or reorder them. If an agent's response is particularly brief or says they have nothing to add, that's fine — include it anyway so the user sees the full picture.
|
||||||
|
|
||||||
For each candidate agent, compute a **relevance score** (0-10) based on:
|
After presenting, you can optionally add a brief orchestrator note if it would help — like flagging a clear disagreement worth exploring, or noting an agent whose perspective might be relevant but wasn't included this round.
|
||||||
|
|
||||||
| Factor | Weight | How to Assess |
|
### 4. Handle Follow-ups
|
||||||
|---|---|---|
|
|
||||||
| **Expertise match** | 4 | Overlap between user's topic and agent's `role` + `identity` keywords |
|
|
||||||
| **Complementarity** | 3 | Does this agent add a distinct angle vs. already-selected agents? |
|
|
||||||
| **Recency penalty** | 2 | Reduce score by 1 for each of the last 2 consecutive rounds this agent appeared |
|
|
||||||
| **User affinity** | 1 | Bonus if user has addressed or praised this agent recently |
|
|
||||||
|
|
||||||
**Selection flow:**
|
The user drives what happens next. Common patterns:
|
||||||
1. Score all agents against the current message
|
|
||||||
2. Select the highest-scoring agent as **primary**
|
|
||||||
3. Select the next-highest as **secondary** — but only if their complementarity score is ≥ 2
|
|
||||||
4. Select a **tertiary** only if the topic is genuinely cross-cutting AND complementarity ≥ 3
|
|
||||||
5. For simple/factual questions, use primary only — don't force a roundtable
|
|
||||||
|
|
||||||
**Override rules:**
|
| User says... | You do... |
|
||||||
- User names a specific agent → that agent is primary regardless of score; add 1-2 complementary voices
|
|
||||||
- Same agent dominated 3+ consecutive rounds → cap their score at 5
|
|
||||||
- If all scores are below 3 → pick the closest match and acknowledge the topic is outside the team's core expertise
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Round Calibration
|
|
||||||
|
|
||||||
Before spawning, calibrate the round based on the input:
|
|
||||||
|
|
||||||
| Signal | Agents | Depth | Cross-talk | Model hint |
|
|
||||||
|---|---|---|---|---|
|
|
||||||
| Quick factual question | 1 | Brief | No | Fast/cheap if available |
|
|
||||||
| Standard discussion | 2 | Medium | If perspectives diverge | Default |
|
|
||||||
| Complex/ambiguous problem | 2-3 | Deep | Yes | Default |
|
|
||||||
| Debate or controversy | 2-3 | Full | Mandatory | Default |
|
|
||||||
| Fun / personality banter | 2-3 | Character-heavy | Yes (playful) | Default |
|
|
||||||
| Circular discussion detected | 1 (authority) | Summary + new angle | No | Default |
|
|
||||||
| Follow-up on previous round | 1-2 | Builds on prior | Only if new tension | Default |
|
|
||||||
|
|
||||||
"Model hint" is advisory — the platform adapter decides if it supports model switching (e.g., Claude Code can use `haiku` for fast rounds).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Character Fidelity
|
|
||||||
|
|
||||||
Each agent response must use their documented `communicationStyle`, reflect their `principles`, and draw from their `identity`. Prefix with `icon` and **displayName**.
|
|
||||||
|
|
||||||
**Cross-talk:** Agents reference each other naturally — build on points, offer counter-perspectives, ask clarifying questions within the same round.
|
|
||||||
|
|
||||||
**Anti-patterns — avoid these:**
|
|
||||||
- Agents agreeing just to be polite or restating each other
|
|
||||||
- All agents saying the same thing in different words
|
|
||||||
- Breaking character to explain orchestration mechanics
|
|
||||||
- Agents hedging everything with "that's a great point" filler
|
|
||||||
- Generic AI assistant tone leaking through personality
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Question Protocol
|
|
||||||
|
|
||||||
| Type | Behavior |
|
|
||||||
|---|---|
|
|---|---|
|
||||||
| Agent asks user directly | Present response, **stop the round**, wait for user input |
|
| Continues the general discussion | Pick fresh agents, repeat the loop |
|
||||||
| Agent-to-agent question | Resolve in the cross-talk pass |
|
| "Winston, what do you think about what Sally said?" | Spawn just Winston with Sally's response as context |
|
||||||
| Rhetorical | Continue naturally |
|
| "Bring in Quinn on this" | Spawn Quinn with a summary of the discussion so far |
|
||||||
| Multiple agents ask user | Present all, then consolidate into one clear prompt to the user |
|
| "I agree with John, let's go deeper on that" | Spawn John + 1-2 others to expand on John's point |
|
||||||
|
| "What would Mary and Bob think about Winston's approach?" | Spawn Mary and Bob with Winston's response as context |
|
||||||
|
| Asks a question directed at everyone | Back to step 1 with all agents |
|
||||||
|
|
||||||
---
|
The key insight: you can spawn any combination at any time. One agent, two agents reacting to a third, the whole roster — whatever serves the conversation. Each spawn is cheap and independent.
|
||||||
|
|
||||||
## Moderation
|
## Keeping Context Manageable
|
||||||
|
|
||||||
The orchestrator handles moderation transparently:
|
As the conversation grows, you'll need to summarize prior rounds rather than passing the full transcript to each subagent. Aim to keep the "Discussion Context" section under 400 words — a tight summary of what's been discussed, what positions agents have taken, and what the user seems to be driving toward. Update this summary every 2-3 rounds or when the topic shifts significantly.
|
||||||
|
|
||||||
- **Circular discussion** → Summarize the impasse, spawn an authority agent to propose resolution
|
## When Things Go Sideways
|
||||||
- **Topic drift** → Frame the next prompt to reconnect tangent to main thread
|
|
||||||
- **One agent dominating** → Lower their score; bring in different voices
|
|
||||||
- **Low-value round** → Fewer agents, shorter prompts, signal "keep it brief" in the agent prompt
|
|
||||||
- **Energy drop** → Inject a provocative angle or bring in a contrarian voice
|
|
||||||
- **User disengagement** (short replies, long gaps) → Ask directly: continue, change topic, or exit?
|
|
||||||
|
|
||||||
---
|
- **Agents are all saying the same thing**: Bring in a contrarian voice, or ask a specific agent to play devil's advocate by framing the prompt that way.
|
||||||
|
- **Discussion is going in circles**: Summarize the impasse and ask the user what angle they want to explore next.
|
||||||
|
- **User seems disengaged**: Ask directly — continue, change topic, or wrap up?
|
||||||
|
- **Agent gives a weak response**: Don't retry. Present it and let the user decide if they want more from that agent.
|
||||||
|
|
||||||
## Conversation Momentum
|
## Exit
|
||||||
|
|
||||||
Track implicitly across rounds:
|
When the user says they're done (any natural phrasing — "thanks", "that's all", "end party mode", etc.), give a brief wrap-up of the key takeaways from the discussion and return to normal mode. Don't force exit triggers — just read the room.
|
||||||
|
|
||||||
- **High momentum** — Multiple agents engaged, user asking follow-ups, perspectives diverging productively → lean into it, allow longer responses, encourage cross-talk
|
|
||||||
- **Steady** — Normal flow → standard calibration
|
|
||||||
- **Low momentum** — Repetitive takes, user giving minimal input, agents converging → rotate voices, introduce a contrarian, shorten rounds, or ask the user what they'd like to explore
|
|
||||||
|
|
||||||
Don't announce momentum tracking. Just adapt.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Exit Conditions
|
|
||||||
|
|
||||||
Trigger exit when user sends: `*exit`, `goodbye`, `end party`, `quit`, or `[E]`.
|
|
||||||
|
|
||||||
Never auto-exit. If conversation winds down, ask directly rather than assuming.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Stage Routing
|
|
||||||
|
|
||||||
### Stage 1: Initialize
|
|
||||||
Load agents, build profiles, create platform agent files if needed, activate.
|
|
||||||
→ Load `./steps/step-01-initialize.md`
|
|
||||||
|
|
||||||
### Stage 2: Orchestrate (conversation loop)
|
|
||||||
Score → calibrate → spawn → assess → present → repeat.
|
|
||||||
→ Load `./steps/step-02-orchestrate.md`
|
|
||||||
|
|
||||||
### Stage 3: Exit
|
|
||||||
Brief farewells, session highlights, return to parent if applicable.
|
|
||||||
→ Load `./steps/step-03-exit.md`
|
|
||||||
|
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
# Platform Adapter: Claude Code
|
|
||||||
|
|
||||||
## Capabilities
|
|
||||||
|
|
||||||
| Feature | Support |
|
|
||||||
|---|---|
|
|
||||||
| Parallel sub-agents | Yes — multiple `Agent` tool calls in one response |
|
|
||||||
| Nested sub-agents | Yes (not needed for party mode) |
|
|
||||||
| Inline prompt injection | Yes — full prompt passed at spawn time |
|
|
||||||
| Pre-defined agent files | Not required |
|
|
||||||
| Model selection | Yes — `model` parameter per agent |
|
|
||||||
| Tool access in sub-agents | Based on `subagent_type` |
|
|
||||||
|
|
||||||
## How to Spawn a Party Mode Agent
|
|
||||||
|
|
||||||
Use the **Agent tool** for each selected agent:
|
|
||||||
|
|
||||||
```
|
|
||||||
Agent tool call:
|
|
||||||
description: "{displayName} responds to discussion"
|
|
||||||
subagent_type: "general-purpose"
|
|
||||||
prompt: <assembled from ./references/agent-prompt-template.md>
|
|
||||||
model: <optional — see Model Selection below>
|
|
||||||
```
|
|
||||||
|
|
||||||
**Key parameters:**
|
|
||||||
- `description` — Short label: e.g., "Winston responds to architecture question"
|
|
||||||
- `subagent_type` — Always `"general-purpose"` for party mode agents
|
|
||||||
- `prompt` — Fully assembled agent prompt with personality, context, depth signal, and user message
|
|
||||||
- `model` — Optional override (see below)
|
|
||||||
|
|
||||||
## Model Selection Strategy
|
|
||||||
|
|
||||||
Claude Code supports per-agent model selection. Use this to optimize cost and speed:
|
|
||||||
|
|
||||||
| Round calibration | Model | Rationale |
|
|
||||||
|---|---|---|
|
|
||||||
| Depth: "brief", simple factual question | `"haiku"` | Fast, cheap — no need for heavy reasoning |
|
|
||||||
| Depth: "standard", normal discussion | Omit (inherit current) | Default model handles this well |
|
|
||||||
| Depth: "deep", complex analysis | Omit (inherit current) | Full capability needed |
|
|
||||||
| Cross-talk reactions (2-3 sentences) | `"haiku"` | Short reactive responses don't need heavy models |
|
|
||||||
| Farewell responses | `"haiku"` | 1-2 sentences of in-character goodbye |
|
|
||||||
|
|
||||||
Only use `"haiku"` when the response is genuinely simple. When in doubt, omit the parameter.
|
|
||||||
|
|
||||||
## Parallel Execution
|
|
||||||
|
|
||||||
To spawn agents in parallel, include **multiple Agent tool calls in a single response message**. Claude Code executes them concurrently and returns all results together.
|
|
||||||
|
|
||||||
Example for a 3-agent round:
|
|
||||||
```
|
|
||||||
Response contains:
|
|
||||||
Agent call 1: description="Winston responds", prompt=<winston_prompt>
|
|
||||||
Agent call 2: description="Maya responds", prompt=<maya_prompt>
|
|
||||||
Agent call 3: description="Rex responds", prompt=<rex_prompt>
|
|
||||||
```
|
|
||||||
|
|
||||||
All three run simultaneously. Collect all results before presenting to user.
|
|
||||||
|
|
||||||
## Cross-Talk Pass
|
|
||||||
|
|
||||||
For cross-talk, spawn agents **sequentially** (one Agent call per response) so each can see previous outputs. Include Pass 1 responses in the prompt under "Other Agents' Responses This Round".
|
|
||||||
|
|
||||||
Consider using `model: "haiku"` for cross-talk since responses are short reactions.
|
|
||||||
|
|
||||||
## Constraints
|
|
||||||
|
|
||||||
- Sub-agents return text results to the orchestrator — not visible to user until presented
|
|
||||||
- Each sub-agent gets a fresh context (no conversation history — include relevant context in prompt)
|
|
||||||
- Sub-agents should NOT use tools — instruct them to respond with text only
|
|
||||||
- Token cost scales linearly with agents spawned per round
|
|
||||||
|
|
||||||
## Optimization
|
|
||||||
|
|
||||||
- Single agent for simple questions — skip parallel overhead
|
|
||||||
- Keep conversation context under 400 words
|
|
||||||
- Use `"haiku"` for brief/reactive rounds to save tokens and time
|
|
||||||
- The orchestrator's context window is the bottleneck in long sessions — maintain the compaction state block diligently
|
|
||||||
- If a spawn fails, present remaining agents normally — don't retry or block
|
|
||||||
|
|
@ -1,113 +0,0 @@
|
||||||
# Platform Adapter: Codex (OpenAI)
|
|
||||||
|
|
||||||
## Capabilities
|
|
||||||
|
|
||||||
| Feature | Support |
|
|
||||||
|---|---|
|
|
||||||
| Parallel sub-agents | Yes — parallel by default, up to `agents.max_threads` (default 6) |
|
|
||||||
| Nested sub-agents | No — `agents.max_depth` defaults to 1 |
|
|
||||||
| Inline prompt injection | Yes — via natural language spawning |
|
|
||||||
| Pre-defined agent files | Supported — `.codex/agents/*.toml` for persistent definitions |
|
|
||||||
| Model selection | Via TOML `model` field per agent definition |
|
|
||||||
| Tool access in sub-agents | Inherited from parent + per-agent overrides |
|
|
||||||
|
|
||||||
## Setup: Pre-Defined Agent Files (Recommended)
|
|
||||||
|
|
||||||
During Stage 1 (Initialize), generate a TOML file for each BMAD agent in `.codex/agents/`:
|
|
||||||
|
|
||||||
**Skip if files already exist and manifest hasn't changed** (same agent count and names).
|
|
||||||
|
|
||||||
**Template — `.codex/agents/{agent-name}.toml`:**
|
|
||||||
```toml
|
|
||||||
name = "{name}"
|
|
||||||
description = "{displayName} - {title}. {role}"
|
|
||||||
|
|
||||||
developer_instructions = """
|
|
||||||
You are {displayName} ({title}), a BMAD agent in a collaborative roundtable discussion.
|
|
||||||
|
|
||||||
Your Personality:
|
|
||||||
- Icon: {icon}
|
|
||||||
- Role: {role}
|
|
||||||
- Identity: {identity}
|
|
||||||
- Communication Style: {communicationStyle}
|
|
||||||
- Principles: {principles}
|
|
||||||
|
|
||||||
Instructions:
|
|
||||||
- Respond as {displayName}. Your genuine expert perspective — not a safe, hedged AI answer.
|
|
||||||
- Start with: {icon} **{displayName}**:
|
|
||||||
- Match your documented communication style exactly.
|
|
||||||
- Scale response length to the substance of your point.
|
|
||||||
- If you disagree with another agent, say so directly.
|
|
||||||
- If you have nothing substantial to add, say so in one sentence.
|
|
||||||
- Respond in {communication_language}.
|
|
||||||
"""
|
|
||||||
|
|
||||||
sandbox_mode = "read-only"
|
|
||||||
```
|
|
||||||
|
|
||||||
`sandbox_mode = "read-only"` — party agents think and respond, they don't modify files.
|
|
||||||
|
|
||||||
## How to Spawn a Party Mode Agent
|
|
||||||
|
|
||||||
**Option A — Reference pre-defined agents (recommended):**
|
|
||||||
```
|
|
||||||
Spawn agent "{name}" with this context:
|
|
||||||
Discussion so far: {conversation_context_summary}
|
|
||||||
Depth: {brief | standard | deep}
|
|
||||||
User's message: {user_message}
|
|
||||||
Respond in character. Start with {icon} **{displayName}**:
|
|
||||||
```
|
|
||||||
|
|
||||||
**Option B — Natural language spawning (dynamic):**
|
|
||||||
```
|
|
||||||
Spawn an agent to respond as {displayName} with this context:
|
|
||||||
[conversation context summary]
|
|
||||||
User's message: {user_message}
|
|
||||||
The agent should respond in character as {displayName}, starting with {icon} **{displayName}**:
|
|
||||||
```
|
|
||||||
|
|
||||||
## Parallel Execution
|
|
||||||
|
|
||||||
Codex runs sub-agents **in parallel by default**. Spawn multiple together:
|
|
||||||
|
|
||||||
```
|
|
||||||
Spawn these agents in parallel and wait for all results:
|
|
||||||
1. Agent "{agent_a_name}" — respond to: {user_message} with context: {context}
|
|
||||||
2. Agent "{agent_b_name}" — respond to: {user_message} with context: {context}
|
|
||||||
```
|
|
||||||
|
|
||||||
Executes concurrently (up to `max_threads`) and consolidates results.
|
|
||||||
|
|
||||||
## Presentation: Always Show Pass 1
|
|
||||||
|
|
||||||
**CRITICAL:** Pass 1 agent responses MUST be presented to the user in full BEFORE any cross-talk. Cross-talk is supplementary — it adds reactions to the thread, it does NOT replace initial responses. The user must see:
|
|
||||||
|
|
||||||
1. Each agent's independent initial take (Pass 1)
|
|
||||||
2. Then any cross-talk reactions (Pass 2) as follow-up remarks
|
|
||||||
|
|
||||||
Never skip, summarize, or fold Pass 1 into the cross-talk output.
|
|
||||||
|
|
||||||
## Cross-Talk Pass
|
|
||||||
|
|
||||||
Cross-talk is an **additional pass** — spawn sequentially with previous agents' responses as context:
|
|
||||||
|
|
||||||
```
|
|
||||||
Spawn agent "{agent_b_name}" with this additional context:
|
|
||||||
Other agents said this round:
|
|
||||||
{agent_a_response}
|
|
||||||
|
|
||||||
React briefly — agree, challenge, or build on one specific point. 2-3 sentences max.
|
|
||||||
```
|
|
||||||
|
|
||||||
The cross-talk responses are appended AFTER the Pass 1 responses when presenting to the user.
|
|
||||||
|
|
||||||
## Constraints
|
|
||||||
|
|
||||||
- `agents.max_threads` default 6 — more than enough for 2-3 party agents
|
|
||||||
- `agents.max_depth` of 1 — party agents cannot delegate further (not needed)
|
|
||||||
- Approval requests from sub-agents surface to user — `sandbox_mode = "read-only"` minimizes interruptions
|
|
||||||
- Token cost proportional to agents spawned
|
|
||||||
|
|
||||||
## Cleanup
|
|
||||||
|
|
||||||
Generated `.codex/agents/*.toml` files persist between sessions for reuse. During exit (Stage 3), note this briefly if files were created. Do NOT delete automatically.
|
|
||||||
|
|
@ -1,144 +0,0 @@
|
||||||
# Platform Adapter: Gemini CLI
|
|
||||||
|
|
||||||
## Hard Constraint: One Agent = One Sub-Agent
|
|
||||||
|
|
||||||
**NEVER create a single "generalist" or "roundtable" sub-agent that role-plays multiple agents.** This is the #1 failure mode on Gemini CLI. Each BMAD agent MUST be invoked as its own separate `@agent_name` call. The entire value of party mode is that each agent is a genuinely independent process with its own thinking.
|
|
||||||
|
|
||||||
**Wrong (DO NOT DO THIS):**
|
|
||||||
```
|
|
||||||
@generalist "Act as Winston, Maya, and Rex and have a roundtable discussion about..."
|
|
||||||
```
|
|
||||||
|
|
||||||
**Right:**
|
|
||||||
```
|
|
||||||
@winston "Discussion context: ... User's message: ..."
|
|
||||||
@maya "Discussion context: ... User's message: ..."
|
|
||||||
@rex "Discussion context: ... User's message: ..."
|
|
||||||
```
|
|
||||||
|
|
||||||
If you find yourself creating a single sub-agent to simulate the roundtable, STOP — you are breaking party mode's core promise.
|
|
||||||
|
|
||||||
## Capabilities
|
|
||||||
|
|
||||||
| Feature | Support |
|
|
||||||
|---|---|
|
|
||||||
| Parallel sub-agents | No — sequential execution only |
|
|
||||||
| Nested sub-agents | No |
|
|
||||||
| Inline prompt injection | No — agents must be pre-defined as `.gemini/agents/*.md` |
|
|
||||||
| Pre-defined agent files | **Required** — one file per BMAD agent |
|
|
||||||
| Model selection | Via `model` field in agent definition |
|
|
||||||
| Tool access in sub-agents | Explicit whitelist via `tools` field |
|
|
||||||
|
|
||||||
## Setup: Pre-Defined Agent Files (Required)
|
|
||||||
|
|
||||||
Gemini CLI **requires** agent definitions as individual markdown files before invocation. During Stage 1, generate **one file per BMAD agent** — NOT a single combined file:
|
|
||||||
|
|
||||||
**Skip if files already exist and manifest hasn't changed** (same agent count and names).
|
|
||||||
|
|
||||||
**Template — `.gemini/agents/{agent-name}.md`:**
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
name: {name}
|
|
||||||
description: "{displayName} - {title}. {role}"
|
|
||||||
kind: local
|
|
||||||
tools:
|
|
||||||
- read_file
|
|
||||||
- grep_search
|
|
||||||
model: gemini-2.5-pro
|
|
||||||
temperature: 0.7
|
|
||||||
max_turns: 5
|
|
||||||
---
|
|
||||||
|
|
||||||
You are {displayName} ({title}), a BMAD agent in a collaborative roundtable discussion.
|
|
||||||
|
|
||||||
## Your Personality
|
|
||||||
- **Icon:** {icon}
|
|
||||||
- **Role:** {role}
|
|
||||||
- **Identity:** {identity}
|
|
||||||
- **Communication Style:** {communicationStyle}
|
|
||||||
- **Principles:** {principles}
|
|
||||||
|
|
||||||
## Standing Instructions
|
|
||||||
- Respond as {displayName}. Your genuine expert perspective — not a safe, hedged AI answer.
|
|
||||||
- Start every response with: {icon} **{displayName}**:
|
|
||||||
- Match your documented communication style exactly.
|
|
||||||
- Scale response length to the substance of your point.
|
|
||||||
- If you disagree with another agent, say so directly.
|
|
||||||
- If you have nothing substantial to add, say so in one sentence.
|
|
||||||
- Respond in {communication_language}.
|
|
||||||
```
|
|
||||||
|
|
||||||
**Configuration notes:**
|
|
||||||
- `kind: local` — runs on the local machine
|
|
||||||
- `tools` — Minimal read-only tools. Omit entirely to inherit all parent tools (less secure).
|
|
||||||
- `temperature: 0.7` — Slightly elevated for personality variation
|
|
||||||
- `max_turns: 5` — Safe ceiling; party agents complete in 1-2 turns
|
|
||||||
|
|
||||||
**Verification after setup:** Confirm that `.gemini/agents/` contains one `.md` file per BMAD agent (not a single combined file). The file count should match the agent count from the manifest.
|
|
||||||
|
|
||||||
## How to Spawn a Party Mode Agent
|
|
||||||
|
|
||||||
Each agent is invoked **individually** with `@{name}`:
|
|
||||||
|
|
||||||
```
|
|
||||||
@{name} Discussion context: {conversation_context_summary}
|
|
||||||
|
|
||||||
Depth: {brief | standard | deep}
|
|
||||||
User's message: {user_message}
|
|
||||||
|
|
||||||
Respond in character as {displayName}.
|
|
||||||
```
|
|
||||||
|
|
||||||
**For a 2-agent round, this means TWO separate `@` invocations:**
|
|
||||||
```
|
|
||||||
@winston Discussion context: The team is debating API architecture...
|
|
||||||
Depth: standard
|
|
||||||
User's message: What do you think about microservices vs monolith?
|
|
||||||
Respond in character as Winston.
|
|
||||||
|
|
||||||
@maya Discussion context: The team is debating API architecture. Winston suggested...
|
|
||||||
Depth: standard
|
|
||||||
User's message: What do you think about microservices vs monolith?
|
|
||||||
Respond in character as Maya.
|
|
||||||
```
|
|
||||||
|
|
||||||
**For a 3-agent round, THREE separate `@` invocations.** Never combine agents.
|
|
||||||
|
|
||||||
## Sequential Execution Strategy
|
|
||||||
|
|
||||||
Gemini CLI executes sub-agents **sequentially**. Turn this into an advantage:
|
|
||||||
|
|
||||||
```
|
|
||||||
1. @primary_agent {prompt} → collect response, present to user
|
|
||||||
2. @secondary_agent {prompt + primary's response} → collect response, present to user
|
|
||||||
3. (Optional) @tertiary_agent {prompt + both responses} → collect response, present to user
|
|
||||||
4. Show [E] exit option
|
|
||||||
```
|
|
||||||
|
|
||||||
**Why this works:** Each subsequent agent naturally sees prior responses — **free cross-talk**. No separate cross-talk pass needed. The sequential format creates a natural conversation flow where each agent builds on or reacts to what came before.
|
|
||||||
|
|
||||||
**Present each response as it arrives** so the user isn't waiting on a blank screen.
|
|
||||||
|
|
||||||
**Latency management:**
|
|
||||||
- Default to 2 agents per round to keep wait times reasonable
|
|
||||||
- Use 3 agents only for genuinely complex/cross-cutting topics
|
|
||||||
- For "brief" depth rounds, consider 1 agent only
|
|
||||||
|
|
||||||
## Constraints
|
|
||||||
|
|
||||||
- **One `@agent_name` call = one agent.** Never bundle multiple agents into one call.
|
|
||||||
- Sub-agents **cannot call other sub-agents** — no nested delegation
|
|
||||||
- `max_turns` caps internal steps — set low for simple responses
|
|
||||||
- Agent definition files **must exist before invocation**
|
|
||||||
- `.gemini/agents/` directory must exist — create if needed
|
|
||||||
- Gemini CLI sub-agents feature is **experimental** — behavior may evolve
|
|
||||||
|
|
||||||
## Cleanup
|
|
||||||
|
|
||||||
Generated `.gemini/agents/*.md` files persist between sessions. Note briefly during exit if files were created. Do NOT delete automatically.
|
|
||||||
|
|
||||||
## Fallback
|
|
||||||
|
|
||||||
If file creation fails or `@agent_name` invocation is unavailable, fall back to **single-LLM role-play**: the orchestrator generates responses in character within its own context. **This must be announced to the user** — e.g., "Sub-agent spawning isn't available, so I'll role-play the agents directly. Responses won't have independent thinking."
|
|
||||||
|
|
||||||
Single-LLM role-play is always the LAST resort, never the first approach. Always attempt individual `@agent_name` invocations first.
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
# Universal Agent Prompt Template
|
|
||||||
|
|
||||||
This template is assembled by the orchestrator for each sub-agent spawn. The platform adapter determines HOW the prompt is delivered; this defines WHAT it contains.
|
|
||||||
|
|
||||||
## Template
|
|
||||||
|
|
||||||
```
|
|
||||||
You are {displayName} ({title}), a BMAD agent in a collaborative roundtable discussion.
|
|
||||||
|
|
||||||
## Your Personality
|
|
||||||
- **Icon:** {icon}
|
|
||||||
- **Role:** {role}
|
|
||||||
- **Identity:** {identity}
|
|
||||||
- **Communication Style:** {communicationStyle}
|
|
||||||
- **Principles:** {principles}
|
|
||||||
|
|
||||||
## Discussion Context
|
|
||||||
{conversation_context_summary}
|
|
||||||
|
|
||||||
## Other Agents' Responses This Round
|
|
||||||
{pass_1_responses_if_cross_talk_pass — empty on first pass}
|
|
||||||
|
|
||||||
## User's Message
|
|
||||||
{user_message}
|
|
||||||
|
|
||||||
## Response Calibration
|
|
||||||
Depth: {brief | standard | deep}
|
|
||||||
|
|
||||||
## Instructions
|
|
||||||
Respond as {displayName}. Your genuine expert perspective — not a safe, hedged AI answer.
|
|
||||||
- Start with: {icon} **{displayName}**:
|
|
||||||
- Match your documented communication style exactly.
|
|
||||||
- Scale response length to match the Depth signal above and the substance of your point.
|
|
||||||
- If you disagree with another agent, say so directly — don't soften with "great point, but..."
|
|
||||||
- If you have nothing substantial to add beyond what's been said, say so in one sentence rather than restating others' points.
|
|
||||||
- If you want to ask the USER a direct question, make it the last thing you say.
|
|
||||||
- Respond in {communication_language}.
|
|
||||||
- Do NOT use any tools. Only provide your response as text output.
|
|
||||||
```
|
|
||||||
|
|
||||||
## Farewell Variant
|
|
||||||
|
|
||||||
Used during Stage 3 (exit):
|
|
||||||
|
|
||||||
```
|
|
||||||
You are {displayName} ({title}). The party mode roundtable is ending.
|
|
||||||
|
|
||||||
## Your Personality
|
|
||||||
- **Icon:** {icon}
|
|
||||||
- **Role:** {role}
|
|
||||||
- **Identity:** {identity}
|
|
||||||
- **Communication Style:** {communicationStyle}
|
|
||||||
- **Principles:** {principles}
|
|
||||||
|
|
||||||
## Session Summary
|
|
||||||
{brief summary of key topics discussed and this agent's contributions}
|
|
||||||
|
|
||||||
## Instructions
|
|
||||||
Give a farewell in 1-2 sentences that references something specific from the discussion — a point you made, something another agent said, or a question the user raised.
|
|
||||||
Stay in character. Start with: {icon} **{displayName}**:
|
|
||||||
Respond in {communication_language}. Do NOT use any tools.
|
|
||||||
```
|
|
||||||
|
|
||||||
## Assembly Notes
|
|
||||||
|
|
||||||
- **Conversation context** — Keep under 400 words. Each sub-agent gets a fresh context window; every token here is multiplied by agents spawned per round.
|
|
||||||
- **Depth signal** — Set by the orchestrator's round calibration. "brief" = 2-4 sentences, "standard" = a few paragraphs, "deep" = full analysis.
|
|
||||||
- **Pass 1 responses** — Empty for the initial parallel pass; populated only during cross-talk.
|
|
||||||
- **Personality fields** — From the merged profile built during initialization (manifest CSV + agent file data).
|
|
||||||
- **Anti-pattern guard** — The "nothing substantial to add" instruction prevents the common failure mode of agents restating each other to seem participatory. This is critical for round quality.
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
# Stage 1: Initialize Party Mode
|
|
||||||
|
|
||||||
## Goal
|
|
||||||
|
|
||||||
Detect platform, load agents, build spawn-ready profiles with expertise vectors, create platform-specific definitions if needed, and launch — all in a single turn.
|
|
||||||
|
|
||||||
## Sequence
|
|
||||||
|
|
||||||
### 1. Detect Platform
|
|
||||||
|
|
||||||
Determine which AI CLI platform you are running on:
|
|
||||||
|
|
||||||
- **Claude Code** → `Agent` tool is available in your tool list
|
|
||||||
- **Codex** → You are inside OpenAI Codex CLI, or `.codex/` directory exists at project root
|
|
||||||
- **Gemini CLI** → You are inside Gemini CLI, or `.gemini/` directory exists at project root
|
|
||||||
|
|
||||||
Load the corresponding adapter: `./adapters/{platform}.md`
|
|
||||||
|
|
||||||
Default to **Claude Code** if uncertain. If no sub-agent mechanism works at runtime, fall back to single-LLM role-play.
|
|
||||||
|
|
||||||
### 2. Load Agent Manifest
|
|
||||||
|
|
||||||
Read and parse `{project-root}/_bmad/_config/agent-manifest.csv`.
|
|
||||||
|
|
||||||
**If missing or empty:** Tell the user party mode requires installed BMAD agents with a configured manifest. Suggest they check their `_bmad/_config/` setup. End the workflow.
|
|
||||||
|
|
||||||
### 3. Build Personality Profiles
|
|
||||||
|
|
||||||
For each agent in the manifest:
|
|
||||||
|
|
||||||
1. **Merge data** — Combine CSV fields into a complete profile. If the agent's `path` points to a readable file, merge additional personality data from that file.
|
|
||||||
|
|
||||||
2. **Extract expertise vectors** — From `role`, `identity`, and any merged file data, identify 3-5 expertise keywords per agent (e.g., "architecture", "testing", "ux", "security", "devops"). Store these for fast scoring during orchestration.
|
|
||||||
|
|
||||||
3. **Structure as spawn-ready prompt** — Use `./references/agent-prompt-template.md`. Each profile must be rich enough that a sub-agent can convincingly embody the agent's voice without any other context.
|
|
||||||
|
|
||||||
4. **Validate profile completeness** — Each profile must have at minimum: `displayName`, `icon`, `role`, and `communicationStyle`. Flag incomplete profiles and note them but don't block on them.
|
|
||||||
|
|
||||||
5. **Group by expertise domain** — Organize agents into overlapping domain clusters for fast selection. An agent can belong to multiple domains.
|
|
||||||
|
|
||||||
### 4. Create Platform-Specific Agent Definitions (if required)
|
|
||||||
|
|
||||||
Check the loaded adapter for setup requirements:
|
|
||||||
|
|
||||||
- **Claude Code** — No pre-creation needed. Agents are spawned inline.
|
|
||||||
- **Codex** — Generate `.codex/agents/{name}.toml` per agent using the adapter's template. Create directory if needed. **Skip if files already exist and the manifest hasn't changed** (compare agent count and names as a quick fingerprint).
|
|
||||||
- **Gemini CLI** — Generate `.gemini/agents/{name}.md` per agent using the adapter's template. Create directory if needed. **Skip if files already exist and the manifest hasn't changed.**
|
|
||||||
|
|
||||||
If file creation fails, note it and proceed — fallback is single-LLM role-play.
|
|
||||||
|
|
||||||
### 5. Activate Party Mode
|
|
||||||
|
|
||||||
Introduce the session with energy and personality:
|
|
||||||
|
|
||||||
- Welcome the user by name (if configured)
|
|
||||||
- Show 3-4 diverse agents from the roster (across different expertise domains) with their icon, name, title, and a one-line personality flavor
|
|
||||||
- State total agent count
|
|
||||||
- Briefly explain: *each agent thinks independently as its own process — this is a genuine roundtable, not one AI playing pretend*
|
|
||||||
- Invite the user's first topic or question — they can address specific agents by name or throw a topic to the whole group
|
|
||||||
|
|
||||||
**Tone:** Enthusiastic but not overwrought. A team of experts ready to collaborate.
|
|
||||||
|
|
||||||
### 6. Initialize State Block
|
|
||||||
|
|
||||||
Create the first `[PARTY MODE STATE]` block:
|
|
||||||
|
|
||||||
```
|
|
||||||
[PARTY MODE STATE]
|
|
||||||
Platform: {platform} | Adapter: {adapter}
|
|
||||||
Agent count: {N}
|
|
||||||
Roster: [{icon} {displayName} ({title}) — expertise: {keywords}] × N
|
|
||||||
Domain clusters: {domain → agent names}
|
|
||||||
Round: 0
|
|
||||||
Momentum: starting
|
|
||||||
[/PARTY MODE STATE]
|
|
||||||
```
|
|
||||||
|
|
||||||
Include enough data to reconstruct spawn prompts post-compaction.
|
|
||||||
|
|
||||||
### 7. Transition
|
|
||||||
|
|
||||||
Immediately proceed to `./step-02-orchestrate.md`.
|
|
||||||
|
|
||||||
## Error Handling
|
|
||||||
|
|
||||||
| Error | Action |
|
|
||||||
|---|---|
|
|
||||||
| Missing CSV columns on an agent | Skip that agent, note briefly, continue |
|
|
||||||
| Fewer than 2 agents available | Warn that party mode works best with multiple agents, proceed |
|
|
||||||
| Agent file at `path` not readable | Use manifest data alone for that agent's profile |
|
|
||||||
| Platform agent file creation fails | Fall back to single-LLM role-play, inform user |
|
|
||||||
| Profile missing required fields | Exclude from roster, note which agent and what's missing |
|
|
||||||
|
|
@ -1,171 +0,0 @@
|
||||||
# Stage 2: Conversation Orchestration
|
|
||||||
|
|
||||||
## Goal
|
|
||||||
|
|
||||||
Run the adaptive conversation loop: for each user message, score and select agents, calibrate the round, spawn sub-agents, assess quality, optionally cross-talk, present, and update state.
|
|
||||||
|
|
||||||
## Compaction Survival
|
|
||||||
|
|
||||||
Long sessions will hit context limits. Maintain a running state block — **replace** (never append) every 3 rounds or on significant topic shifts:
|
|
||||||
|
|
||||||
```
|
|
||||||
[PARTY MODE STATE]
|
|
||||||
Platform: {platform} | Adapter: {adapter}
|
|
||||||
Round: {N}
|
|
||||||
Momentum: {high | steady | low}
|
|
||||||
Roster: [{icon} {displayName} — expertise: {keywords}, last_round: {N}] × all agents
|
|
||||||
Active recent: [{agents from last 2 rounds}]
|
|
||||||
Topics covered: [{brief list with round numbers}]
|
|
||||||
Current thread: {what the conversation is about now}
|
|
||||||
Key positions: [{agent}: {stance}] — only for live disagreements
|
|
||||||
User signals: {favored agents, expressed interests, engagement level}
|
|
||||||
Rotation: [{agent}: {rounds participated}/{total rounds}] — flag if any > 60%
|
|
||||||
[/PARTY MODE STATE]
|
|
||||||
```
|
|
||||||
|
|
||||||
Keep under 350 words. Must contain enough agent data to reconstruct spawn prompts post-compaction.
|
|
||||||
|
|
||||||
## Conversation Loop
|
|
||||||
|
|
||||||
### 1. Check Exit
|
|
||||||
|
|
||||||
If the user's message matches an exit trigger (`*exit`, `goodbye`, `end party`, `quit`, `[E]`), go to `./step-03-exit.md`. Don't spawn agents for an exit message.
|
|
||||||
|
|
||||||
### 2. Analyze Input
|
|
||||||
|
|
||||||
Assess in ~5 seconds of thought:
|
|
||||||
|
|
||||||
| Dimension | Question |
|
|
||||||
|---|---|
|
|
||||||
| **Domain** | What expertise area(s) does this touch? |
|
|
||||||
| **Complexity** | Quick take, standard discussion, or deep dive? |
|
|
||||||
| **Continuity** | Builds on current thread or new topic? |
|
|
||||||
| **Directed** | Did the user name a specific agent? |
|
|
||||||
| **Tension potential** | Will perspectives likely diverge? |
|
|
||||||
| **Momentum** | Is conversation energy rising, steady, or dropping? |
|
|
||||||
|
|
||||||
### 3. Score & Select Agents
|
|
||||||
|
|
||||||
Apply the scoring algorithm from SKILL.md:
|
|
||||||
|
|
||||||
1. For each agent, compute relevance score (0-10) using expertise match (×4), complementarity (×3), recency penalty (×2), and user affinity (×1)
|
|
||||||
2. Select primary (highest score)
|
|
||||||
3. Select secondary only if complementarity ≥ 2
|
|
||||||
4. Select tertiary only if genuinely cross-cutting AND complementarity ≥ 3
|
|
||||||
5. Simple questions → primary only
|
|
||||||
|
|
||||||
**Quick check:** If the same agent would be primary for the 4th consecutive round, cap their score at 5 and re-evaluate.
|
|
||||||
|
|
||||||
### 4. Calibrate Round
|
|
||||||
|
|
||||||
Based on input analysis, set round parameters:
|
|
||||||
|
|
||||||
- **Agent count:** 1-3 (from scoring)
|
|
||||||
- **Depth signal:** "brief" / "standard" / "deep" — inject into agent prompts
|
|
||||||
- **Cross-talk:** pre-decide yes/no/conditional (see scoring below)
|
|
||||||
- **Model hint:** "fast" for trivial questions, "default" otherwise — adapter decides if actionable
|
|
||||||
|
|
||||||
### 5. Build Conversation Context
|
|
||||||
|
|
||||||
Compose a concise context block for injection into agent prompts:
|
|
||||||
|
|
||||||
- Current discussion thread (2-3 sentences)
|
|
||||||
- Key positions taken by agents so far (if relevant)
|
|
||||||
- The user's current message (verbatim)
|
|
||||||
|
|
||||||
**Keep under 400 words.** Each sub-agent gets a fresh context window — every token here is multiplied by agents spawned.
|
|
||||||
|
|
||||||
### 6. Spawn Agents (Pass 1)
|
|
||||||
|
|
||||||
Use the platform adapter's spawning mechanism. **Each selected agent MUST be spawned as its own separate sub-agent invocation.** Never create a single sub-agent that role-plays multiple agents.
|
|
||||||
|
|
||||||
- **Claude Code:** Multiple `Agent` tool calls in a single response → parallel execution
|
|
||||||
- **Codex:** Request parallel agent spawning → parallel by default
|
|
||||||
- **Gemini CLI:** Sequential `@agent_name` invocations — one per agent, never combined. Present each response as it arrives.
|
|
||||||
|
|
||||||
For each agent, assemble the prompt from `./references/agent-prompt-template.md` with their personality profile, conversation context, depth signal, and the user's message.
|
|
||||||
|
|
||||||
**If a spawn fails:** Present the remaining agents' responses normally. Note the failure only if it affects the round's coherence. Don't retry — the round can succeed with fewer voices.
|
|
||||||
|
|
||||||
### 7. Cross-Talk Decision (Scored)
|
|
||||||
|
|
||||||
**Skip on Gemini CLI** — sequential execution provides cross-talk naturally.
|
|
||||||
|
|
||||||
**On Claude Code / Codex**, score cross-talk value:
|
|
||||||
|
|
||||||
| Signal | Points |
|
|
||||||
|---|---|
|
|
||||||
| Agents took opposing positions | +3 |
|
|
||||||
| One agent raised a point in another's domain | +2 |
|
|
||||||
| User explicitly asked for debate/discussion | +3 |
|
|
||||||
| Agents' responses are complementary (no tension) | -2 |
|
|
||||||
| Round already has 3 agents | -1 |
|
|
||||||
| Simple/factual question | -3 |
|
|
||||||
|
|
||||||
**Threshold:** Cross-talk if score ≥ 2.
|
|
||||||
|
|
||||||
**Cross-talk prompt addition:**
|
|
||||||
```
|
|
||||||
Other agents said this round:
|
|
||||||
{agent_responses_from_pass_1}
|
|
||||||
|
|
||||||
React briefly — agree, challenge, or build on one specific point. 2-3 sentences max. Don't repeat yourself.
|
|
||||||
```
|
|
||||||
|
|
||||||
Spawn 1-2 agents max for cross-talk. Prefer agents whose domains were referenced by others.
|
|
||||||
|
|
||||||
### 8. Assess Round Quality
|
|
||||||
|
|
||||||
Before presenting, quick sanity check:
|
|
||||||
|
|
||||||
- **Redundancy:** If 2+ agents said essentially the same thing, present the richer version and briefly summarize the agreement rather than showing redundant full responses
|
|
||||||
- **Length:** If a response is disproportionately long for the question's complexity, mentally note for next round's depth calibration
|
|
||||||
- **Direct questions:** Did any agent ask the user a question?
|
|
||||||
|
|
||||||
### 9. Present Round
|
|
||||||
|
|
||||||
**CRITICAL: Always show Pass 1 responses first.** Cross-talk is supplementary — it adds to the thread, never replaces it. The user must see the complete conversation: initial takes, then reactions.
|
|
||||||
|
|
||||||
**Presentation order:**
|
|
||||||
1. **Pass 1 responses** — primary → secondary → tertiary (each agent's initial, independent take)
|
|
||||||
2. **Cross-talk responses** (if any) — presented as natural follow-up reactions after a visual separator
|
|
||||||
|
|
||||||
**Formatting:**
|
|
||||||
- Each response prefixed with the agent's `{icon} **{displayName}**:`
|
|
||||||
- Clear visual separation between agents
|
|
||||||
- Between Pass 1 and cross-talk, use a brief separator (e.g., a horizontal rule or a line like "---") but do NOT label it "cross-talk" — just let the reactions flow naturally as follow-up remarks
|
|
||||||
|
|
||||||
**If any agent asked the user a direct question:** Present responses up to that point and **stop**. If multiple agents asked questions, consolidate into one clear prompt.
|
|
||||||
|
|
||||||
Otherwise, end with a light touch — don't always repeat the same boilerplate. Vary between:
|
|
||||||
- A brief thread-pulling question from the orchestrator
|
|
||||||
- Simply: `[E] Exit Party Mode`
|
|
||||||
- Nothing extra if the agents' responses naturally invite continuation
|
|
||||||
|
|
||||||
### 10. Update State
|
|
||||||
|
|
||||||
Refresh the `[PARTY MODE STATE]` block if:
|
|
||||||
- 3 rounds have passed since last update, OR
|
|
||||||
- Topic shifted significantly, OR
|
|
||||||
- Momentum changed
|
|
||||||
|
|
||||||
## Momentum Adaptation
|
|
||||||
|
|
||||||
| Momentum | Signals | Orchestrator Response |
|
|
||||||
|---|---|---|
|
|
||||||
| **High** | User asks follow-ups, multi-sentence input, names agents | Allow longer responses, encourage cross-talk, maintain current voices |
|
|
||||||
| **Steady** | Normal engagement, varied topics | Standard calibration |
|
|
||||||
| **Low** | Short replies ("ok", "sure"), long gaps, repetitive topics | Rotate voices, shorten rounds, introduce contrarian angle, or ask user directly |
|
|
||||||
| **Declining** | Was high, now dropping | Acknowledge the shift — new topic? deeper on something? wrap up? |
|
|
||||||
|
|
||||||
Adapt silently. Never announce "momentum is low" — just adjust behavior.
|
|
||||||
|
|
||||||
## Error Recovery
|
|
||||||
|
|
||||||
| Failure | Response |
|
|
||||||
|---|---|
|
|
||||||
| Sub-agent spawn fails | Present remaining agents, note briefly if coherence affected |
|
|
||||||
| All spawns fail | Fall back to single-LLM role-play for this round, note the degradation |
|
|
||||||
| Agent returns empty/garbage | Skip that response, proceed with others |
|
|
||||||
| Platform adapter unavailable | Switch to single-LLM role-play, inform user once |
|
|
||||||
| Context approaching limits | Force a state block update, trim conversation context aggressively |
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
# Stage 3: Graceful Exit
|
|
||||||
|
|
||||||
## Goal
|
|
||||||
|
|
||||||
Conclude the session with authentic agent farewells, a brief session summary with highlights, and a clean handoff.
|
|
||||||
|
|
||||||
## Sequence
|
|
||||||
|
|
||||||
### 1. Compile Session Highlights
|
|
||||||
|
|
||||||
Before farewells, identify:
|
|
||||||
- **Key insight** — The single most valuable takeaway from the discussion
|
|
||||||
- **Best exchange** — The most productive agent interaction (disagreement resolved, idea built upon, etc.)
|
|
||||||
- **Top contributors** — 2-3 agents who drove the most value (not just spoke the most)
|
|
||||||
|
|
||||||
### 2. Agent Farewells
|
|
||||||
|
|
||||||
Select the 2-3 top contributors. Spawn each as a sub-agent using the platform adapter with a farewell prompt:
|
|
||||||
|
|
||||||
```
|
|
||||||
You are {displayName} ({title}). The party mode roundtable is ending.
|
|
||||||
|
|
||||||
{personality_profile}
|
|
||||||
|
|
||||||
Session summary: {brief summary of key topics and your contributions}
|
|
||||||
|
|
||||||
Give a farewell in 1-2 sentences that references something specific from the discussion — a point you made, something another agent said, or a question the user raised.
|
|
||||||
Stay in character. Start with: {icon} **{displayName}**:
|
|
||||||
Respond in {communication_language}. Do NOT use any tools.
|
|
||||||
```
|
|
||||||
|
|
||||||
**Platform behavior:**
|
|
||||||
- **Claude Code / Codex** — Spawn farewell agents in parallel
|
|
||||||
- **Gemini CLI** — Spawn sequentially; 2 agents max to keep exit fast
|
|
||||||
|
|
||||||
### 3. Session Wrap-Up
|
|
||||||
|
|
||||||
As the orchestrator, present a compact summary:
|
|
||||||
|
|
||||||
```
|
|
||||||
**Session Highlights**
|
|
||||||
- {key insight from the discussion}
|
|
||||||
- {notable exchange or decision point}
|
|
||||||
- Rounds: {N} | Agents heard: {list of unique agents who participated}
|
|
||||||
```
|
|
||||||
|
|
||||||
Close with one short sentence — thank the user naturally and note agents are available anytime.
|
|
||||||
|
|
||||||
End with: **Party Mode Complete.**
|
|
||||||
|
|
||||||
### 4. Cleanup Notes
|
|
||||||
|
|
||||||
Platform-specific agent definition files (`.codex/agents/*.toml`, `.gemini/agents/*.md`) are **not deleted** — they persist for future sessions. Note this briefly if files were created during this session.
|
|
||||||
|
|
||||||
### 5. Return Protocol
|
|
||||||
|
|
||||||
If party mode was invoked from a parent workflow:
|
|
||||||
1. Identify the parent workflow step that triggered this sub-workflow
|
|
||||||
2. Re-read that file to restore context
|
|
||||||
3. Resume the parent workflow from where it left off
|
|
||||||
4. Present any menus or options the parent workflow expects
|
|
||||||
|
|
||||||
If standalone: end cleanly. Do not continue unless the user initiates.
|
|
||||||
Loading…
Reference in New Issue