Skill: fuzzyb33s/fuzzy-multi-agent-team (version 1.0.0)

--- name: multi-agent-team description: "Spawn and orchestrate multiple coordinated AI sub-agents to work in parallel on a single complex task. Use when: (1) a task is too large for one agent and should be decomposed into parallel subtasks, (2) you need multiple specialized agents researcher coder reviewer etc working together, (3) running agent councils or debates for decision-making, (4) parallel web research data processing or content generation across multiple workers, (5) any multi-agent orchestration pattern one-shot teams persistent squads or hierarchical agent trees. Triggers on phrases like spin up agents, spawn a team, parallel agents, agent council, multi-agent, coordinated agents." --- # Multi-Agent Team Spawn, coordinate, and manage multiple AI sub-agents that work together on complex tasks. One agent is the orchestrator — it decomposes the task, assigns roles, collects results, and synthesizes the final output. ## Patterns ### Pattern 1: Disposable Team (one-shot) Spawn multiple agents for a single task, collect results, done. Best for parallel research, generation, or data processing. ``` sessions_spawn(task="<task prompt>", runtime="subagent", mode="run") ``` Each agent gets a unique session. Results are auto-announced to the parent. ### Pattern 2: Persistent Squad (ongoing collaboration) Spawn agents with `mode="session"` so they maintain context across multiple interactions. Use `sessions_send` to message them and `sessions_list` to track who's active. ### Pattern 3: Agent Council (debate/decision) Spawn 3-5 agents with different perspectives/prompts, have each produce an analysis, then synthesize into a decision. Use `sessions_yield` to wait for all results. ### Pattern 4: Hierarchical (orchestrator + workers) One orchestrator agent decomposes the task and spawns worker sub-agents for each subtask, then collects and merges results. ## Spawning Agents ```json sessions_spawn( task="You are a researcher agent. Research <topic> and return findings as a structured markdown summary.", runtime="subagent", runTimeoutSeconds=300, mode="run" // or "session" for persistent ) ``` **Key parameters:** - `runtime="subagent"` — spawn as OpenClaw sub-agent - `mode="run"` — one-shot, exits when done - `mode="session"` — persistent, stays alive for multiple interactions - `runTimeoutSeconds` — kill after N seconds (0 = no timeout) - `task` — the full agent prompt/instruction ## Communicating with Agents ```json sessions_send(sessionKey="<key>", message="Update: the requirements changed to X, please adjust your approach.") sessions_list(kinds=["subagent"], activeMinutes=60) // find active agents sessions_history(sessionKey="<key>", limit=10) // read their recent messages ``` ## Collecting Results **Option A** — Auto-announce: sub-agents announce results automatically (default). **Option B** — Blocking wait: use `sessions_yield` to wait for sub-agent results before continuing: ```json sessions_yield(message="Waiting for research agents to report back...") ``` **Option C** — Poll history: after agents complete, fetch results: ```json sessions_history(sessionKey="<agent-session-key>", limit=20) ``` ## Orchestrator Template When receiving a complex task, follow this sequence: ``` 1. Decompose task into N independent subtasks 2. For each subtask, spawn a sub-agent with sessions_spawn(mode="run") 3. Optionally use sessions_yield to wait for results 4. Collect outputs from each agent session via sessions_history 5. Synthesize findings into a unified response 6. Report back to the parent session ``` **Example orchestrator prompt:** ``` You are a team orchestrator. The user wants: <task> Step 1: Break this into 3-5 independent subtasks Step 2: Spawn research/coder/writer agents for each Step 3: Wait for all results via sessions_yield Step 4: Merge into one coherent output Step 5: Present the final result Start by decomposing the task and spawning the first wave of agents. ``` ## Coordination Patterns ### Fan-Out (parallel map) Spawn N agents, each doing the same operation on different data: ``` Agent 1: process(item=A) Agent 2: process(item=B) Agent 3: process(item=C) → Merge results ``` ### Fan-In (gather) Spawn agents that each contribute a piece, then one agent merges: ``` Agent 1: write introduction Agent 2: write section A Agent 3: write section B Agent 4: write conclusion → Synthesis agent combines all sections ``` ### Sequential Pipeline Each agent's output becomes the next agent's input: ``` Agent 1: research topic → findings Agent 2: analyze findings → insights Agent 3: write article based on insights → draft ``` ## Team Memory For persistent squads, maintain shared context via files: ```json sessions_send(sessionKey="<orchestrator-key>", message="Update the team status in /workspace/team-status.md — mark task-2 as COMPLETE and note the findings.") ``` Workers can read/write to shared workspace files for state. ## Cleanup Use `subagents(action="list")` to find and kill stale agents: ```json subagents(action="kill", target="<session-key>") ``` ## Anti-Patterns - **Don't spawn 50 agents at once** — the system may become unresponsive. Batch into waves of 3-5. - **Don't forget to collect results** — agents that run to completion without reporting back waste their output. - **Don't use mode=session unless needed** — persistent agents accumulate context and cost tokens. Use `run` for one-shot tasks. - **Don't spawn without a clear role** — each agent needs a specific, focused prompt, not a vague "help me". ## See Also - `agent-orchestrator` skill — skill-level orchestration (not task-level) - `agent-council` skill — decision-making with agent debates - `subagent-spawn-command-builder` skill — helper for constructing spawn commands

path: references/team-templates.md
content: # Multi-Agent Team Templates

Pre-built team configurations for common workflows. Each template defines the orchestrator prompt and worker roles.

## Template 1: Research Squad

**Use case:** Deep research on a topic, market analysis, competitive intelligence.

```
Orchestrator:
"You are leading a 4-agent research squad. The user wants: <task>

Break this into:
1. Market context research
2. Competitor analysis  
3. User pain points
4. Trend analysis

Spawn one agent for each area. Wait for all results, then synthesize into a comprehensive report with:
- Executive summary
- Key findings per area
3. Strategic recommendations
4. Next steps

Format output as markdown with clear headers."

Worker prompts:
- Market research: "Research the current market landscape for <topic>. Return findings as bullet points with sources."
- Competitor: "Analyze 5 main competitors in <topic> space. For each: product, pricing, strengths, weaknesses."
- Pain points: "Identify the top 10 pain points users face with <topic>. Be specific and evidence-based."
- Trends: "Identify 5 major trends shaping <topic> in 2025-2026. Include data points and implications."
```

## Template 2: Content Factory

**Use case:** Generate multiple content pieces in parallel.

```
Orchestrator:
"Produce 5 content pieces in parallel for: <topic>

Spawn 5 agents, each producing one of:
1. Twitter thread (10 tweets)
2. LinkedIn post (300 words)
3. Blog intro (500 words)
4. Email newsletter blurb (150 words)
5. Short video script (60 seconds)

Wait for all 5, then compile into a single document organized by content type."

Worker prompt:
"Create a <type> about <topic>. Format correctly for the platform. Be engaging and concrete."
```

## Template 3: Code Review Council

**Use case:** Multiple perspectives on code quality.

```
Orchestrator:
"A 3-agent review council is examining this code: <code or file path>

Spawn:
- Security reviewer: Focus on vulnerabilities, injection risks, auth issues
- Performance reviewer: Look for bottlenecks, N+1 queries, inefficient algorithms
- Code quality reviewer: Assess readability, SOLID principles, testability

Each agent returns a structured report with: issues found (severity: critical/high/medium/low), code locations, recommended fixes.

Synthesize into a unified review report prioritized by severity."
```

## Template 4: Data Processing Pipeline

**Use case:** Large dataset transformation or analysis.

```
Orchestrator:
"Process the dataset at <path> through a 4-stage pipeline.

Stage 1 — Partition: Split the data into 4 roughly equal chunks.
Stage 2 — Workers: Spawn 4 agents, one per chunk, each running transformation logic.
Stage 3 — Validate: Run a 5th agent to validate output completeness and schema.
Stage 4 — Merge: Combine validated outputs into final result.

Report pipeline metrics: records in, records out, errors, duration."
```

## Template 5: Decision Council

**Use case:** Evaluate a decision from multiple angles.

```
Orchestrator:
"Your job is to evaluate <decision/proposal> from 4 perspectives and reach a recommendation.

Spawn:
- Advocate: Build the strongest case FOR this decision
- Critic: Build the strongest case AGAINST
- Analyst: Evaluate the financial/data implications and risks
- Devil's advocate: Find the hidden assumptions and failure modes

Each agent writes a 200-word brief. Then write a 300-word synthesis with:
1. Summary of the debate
2. Your recommendation with confidence level (1-5)
3. Conditions under which the recommendation changes

Be honest about uncertainty. Do not hedge everything — take a stand."
```

## Spawning Pattern Summary

| Template | Workers | Mode | Timeout |
|----------|---------|------|---------|
| Research Squad | 4 | run | 300s |
| Content Factory | 5 | run | 120s |
| Code Review Council | 3 | run | 180s |
| Data Pipeline | 5 | run | 600s |
| Decision Council | 4 | run | 180s |

Adjust timeouts based on task complexity and data size.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)