claw-multi-agent logo

claw-multi-agent

claw multi agent

SKILL.md

Full skill instructions

claw-multi-agent ๐Ÿ

Replace one AI with a team of AIs. Turn serial into parallel. Turn hours into minutes.


What can it do?

ScenarioExampleSpeedup
Parallel researchSearch 5 frameworks simultaneously, each writes a report~65% โšก
Multi-model compareAsk Claude, Gemini, Kimi the same question at the same time~50% โšก
Code pipelinePlan โ†’ Code โ†’ Review, auto hand-off in sequenceQuality โ†‘
Batch processingTranslate / analyze / summarize multiple docs in parallelScales linearly

โšก Get started in 30 seconds

Just say something like:

  • "Research LangChain, CrewAI, and AutoGen in parallel"
  • "Have multiple agents search these topics and write a combined report"
  • "Compare how Claude and Gemini answer this question"
  • "Use multi-agent mode to do this research"

๐ŸŽญ Interaction Style โ€” How to Talk to the User

This is the recommended pattern. Every multi-agent run must follow this interaction pattern.

Step 0 โ€” Announce skill activation FIRST

โš ๏ธ Iron rule: The activation announcement must be your FIRST reply after receiving the task โ€” before reading any files, before investigating, before spawning.

Why this matters: Reading files, researching background, and spawning all take time. If you do those first, users see long silence. Worse: context compression can happen during that time, and the announcement will never be sent.

Correct order: Receive task โ†’ Send announcement immediately โ†’ Then read files / spawn / wait

The very first thing to say when this skill is triggered โ€” before any planning or spawning:

๐Ÿ **claw-multi-agent ๅทฒๅ”ค้†’**
ๅคšๆ™บ่ƒฝไฝ“ๅนถ่กŒๆจกๅผๅฏๅŠจ๏ผŒๆˆ‘ๆฅ็ป„ๅปบ Agent ๅฐ้˜Ÿๅค„็†่ฟ™ไธชไปปๅŠกใ€‚

This tells the user the skill is active and sets expectations for what's about to happen.

Before spawning โ€” announce the plan

Right after the activation announcement, present the plan BEFORE calling sessions_spawn:

๐Ÿš€ [N]ไธชๆ–นๅ‘ๅŒๆ—ถๅผ€ๆž๏ผŒๅ…จ้ข่ฆ†็›–ไฝ ็š„้—ฎ้ข˜ใ€‚

๐Ÿ“‹ ไปปๅŠก่ง„ๅˆ’๏ผš
๐Ÿ” ็ ”็ฉถๅ‘˜A๏ผˆGLM๏ผ‰โ€” [ไธ€ๅฅ่ฏไปปๅŠกๆ่ฟฐ]
๐Ÿ” ็ ”็ฉถๅ‘˜B๏ผˆGLM๏ผ‰โ€” [ไธ€ๅฅ่ฏไปปๅŠกๆ่ฟฐ]
๐Ÿ“Š ๅˆ†ๆžๅธˆ๏ผˆKimi๏ผ‰โ€” ๅ…ˆ็ญ‰ๅ‰[N]ไธช็ป“ๆžœ๏ผŒๅ•็‹ฌๅฌๅ”ค๏ผˆnote when sequential๏ผ‰

ๆจกๅผ๏ผš๐ŸŽฏ ๆŒ‡ๆŒฅๅฎ˜ๆจกๅผ๏ผˆ่”็ฝ‘ๆœ็ดข๏ผ‰
้ข„่ฎก่€—ๆ—ถ๏ผš~[X]s๏ผˆ[N] Agent ๅนถ่กŒ[๏ผŒๅˆ†ๆžๅธˆไธฒ่กŒ่ทŸ่ฟ›]๏ผ‰
ๆญฃๅœจๆดพๅ‡บ Agent ๅฐ้˜Ÿ...

Role emoji reference:

RoleEmojiExample
Researcher๐Ÿ”๐Ÿ” ็ ”็ฉถๅ‘˜A๏ผˆGLM๏ผ‰โ€” Research XX
Analyst๐Ÿ“Š๐Ÿ“Š ๅˆ†ๆžๅธˆ๏ผˆKimi๏ผ‰โ€” Deep comparison
Writerโœ๏ธโœ๏ธ ๅ†™ไฝœ่€…๏ผˆGemini๏ผ‰โ€” Draft the report
Coder๐Ÿ’ป๐Ÿ’ป ็จ‹ๅบๅ‘˜๏ผˆKimi๏ผ‰โ€” Implement the logic
Reviewer๐Ÿ”Ž๐Ÿ”Ž ๅฎกๆ ธๅ‘˜๏ผˆGLM๏ผ‰โ€” Quality check
Planner๐Ÿ“‹๐Ÿ“‹ ่ง„ๅˆ’ๅธˆ๏ผˆSonnet๏ผ‰โ€” Break down tasks

Key rules:

  • โœ… Always list each agent with: emoji + role + model name + one-line task
  • โœ… State the mode (ๆŒ‡ๆŒฅๅฎ˜/ๆตๆฐด็บฟ/ๆททๅˆ) and estimated time
  • โœ… End announcement with: ๆญฃๅœจๆดพๅ‡บ Agent ๅฐ้˜Ÿ...
  • โœ… Note sequential agents as: "ๅ…ˆ็ญ‰ๅ‰Nไธช็ป“ๆžœ๏ผŒๅ•็‹ฌๅฌๅ”ค"
  • โŒ Never silently call sessions_spawn without announcing

While waiting โ€” brief note

After spawning, say one line:

โณ ๅญ Agent ๅทฒๅ…จ้ƒจๅ‡บๅ‘๏ผŒ็ญ‰็ป“ๆžœๅ›žๆฅ...

After results โ€” structured output (not raw dump)

Never paste sub-agent raw output directly. Always digest and restructure by content logic โ€” NOT by agent order.

Recommended output order:

1. ๆ‰ง่กŒ็ปŸ่ฎกๅก โ† ๅ…ˆ่ฎฉ็”จๆˆท็Ÿฅ้“่ท‘ไบ†ไป€ไนˆ
2. ๆ ธๅฟƒ็ป“่ฎบ๏ผˆ3-5ๆกๆœ€้‡่ฆๅ‘็Žฐ๏ผ‰โ† ๆœ€ๆœ‰ไปทๅ€ผ็š„ๆ”พๆœ€ๅ‰้ข
3. ๅˆ†ไธป้ข˜ๅฑ•ๅผ€็ป†่Š‚๏ผˆๆŒ‰ๅ†…ๅฎน้€ป่พ‘็ป„็ป‡๏ผŒไธๆŒ‰ๅญAgent้กบๅบ๏ผ‰โ† ่ฏป่ตทๆฅๆ˜ฏไธ€็ฏ‡ๅฎŒๆ•ดๆ–‡็ซ 
4. ไธ‹ไธ€ๆญฅ่กŒๅŠจๅปบ่ฎฎ โ† ่ฝๅœฐ็ป“ๅฐพ

็ปŸ่ฎกๅกๆ ผๅผ๏ผš

## ๐Ÿ“Š ๆ‰ง่กŒ็ปŸ่ฎก
| Agent | ๆจกๅž‹ | ่€—ๆ—ถ | ็Šถๆ€ |
|-------|------|------|------|
| ๐Ÿ” ็ ”็ฉถๅ‘˜A | GLM | 58s | โœ… |
| ๐Ÿ” ็ ”็ฉถๅ‘˜B | GLM | 62s | โœ… |
| ๐Ÿ“Š ๅˆ†ๆžๅธˆ  | Kimi | 45s | โœ… |
ไธฒ่กŒ้œ€่ฆ็บฆ 165s โ†’ ๅนถ่กŒๅฎž้™… 62s๏ผŒ่Š‚็œ **62%** โšก

โŒ Wrong โ€” agent order:

ๅญAgent1็š„็ป“ๆžœ...
ๅญAgent2็š„็ป“ๆžœ...
ๅญAgent3็š„็ป“ๆžœ...  โ† ่ฏป่€…่ฆ่‡ชๅทฑๆ‹ผๅ›พ๏ผŒไฝ“้ชŒๅทฎ

โœ… Right โ€” content logic:

## ๆ ธๅฟƒ็ป“่ฎบ
1. ๆœ€้‡่ฆๅ‘็ŽฐA๏ผˆๆฅ่‡ชๅคšไธชAgent็ปผๅˆ๏ผ‰
2. ๆœ€้‡่ฆๅ‘็ŽฐB
...

## ่ฏฆ็ป†ๅˆ†ๆž๏ผš[ไธป้ข˜1]
...๏ผˆๆ•ดๅˆๆ‰€ๆœ‰็›ธๅ…ณAgent็š„ๅ†…ๅฎน๏ผ‰

## ่ฏฆ็ป†ๅˆ†ๆž๏ผš[ไธป้ข˜2]
...

## ไธ‹ไธ€ๆญฅๅปบ่ฎฎ
...

The main agent rewrites everything in its own words. Sub-agent outputs are raw material, not the final answer.

After results โ€” deliver the report (channel-aware)

Always save to file first. Then deliver based on the current channel.

# Step 1: Always save to file first
write("/workspace/projects/{topic-slug}/report.md", content)

Then choose delivery method by channel:

ChannelDelivery method
feishu + has feishu-all-operations skillCreate Feishu doc โ†’ send link (best UX)
feishu + no Feishu skillmessage(filePath=..., filename="report.md") โ€” send as attachment
Discord / Telegram / Slackmessage(message=...) โ€” Markdown renders normally
Other / unknownSave file + tell the user the path

Why this matters: Feishu chat does NOT render Markdown. Sending raw Markdown text shows ##, |---| symbols. Always use attachment or doc link on Feishu.

# Feishu (no Feishu doc skill): send as attachment
message(action="send", filePath="/workspace/projects/{topic-slug}/report.md", filename="report.md")

# Discord/Telegram: send markdown directly
message(action="send", message=report_content)

End with one line:

้œ€่ฆ่ฐƒๆ•ดๆŸไธชๆ–นๅ‘๏ผŒๆˆ–ๆŽจ้€ๅˆฐ้ฃžไนฆๆ–‡ๆกฃๅ—๏ผŸ

Rules:

  • โœ… Always save .md file first โ€” regardless of channel
  • โœ… Check current channel before deciding how to send
  • โŒ Never paste >300 words of Markdown text on Feishu โ€” it won't render
  • โŒ Never just say "ๆŠฅๅ‘Šๅทฒไฟๅญ˜่‡ณ /path/xxx" โ€” user can't open server paths
  • โŒ Never ask "่ฆไธ่ฆๆˆ‘ๅธฎไฝ ๆ•ด็†ๆˆๆ–‡ๆกฃ๏ผŸ" โ€” just do it

Sequential vs parallel โ€” analyst must wait for researchers

Critical: Agents spawned in the same round run in parallel and share NO context with each other.

โŒ Wrong: spawn researcher-A + researcher-B + analyst all at once
          โ†’ analyst has no data, returns empty

โœ… Right: 
  Round 1: spawn researcher-A + researcher-B (parallel, independent)
  Wait for both to return...
  Round 2: main agent consolidates research results
           โ†’ then either: main agent writes analysis itself
           โ†’ or: spawn analyst with research results injected as context

Best practice: Any agent that depends on another agent's output should be spawned in a later round, after collecting the dependency.


๐Ÿค– Model Selection Guide โ€” Which Model for Which Role

Always pick the right model for each agent. State the model explicitly in the announcement.

Model roster

ๆจกๅž‹ๅˆซๅ็‰น็‚น้€‚ๅˆ่ง’่‰ฒ
glmGLMไพฟๅฎœใ€้€Ÿๅบฆๅฟซใ€ไธญๆ–‡ๅฅฝๆœ็ดขใ€็ฎ€ๅ•่ฐƒ็ ”ใ€็Šถๆ€ๆฃ€ๆŸฅ
kimiKimi้•ฟไธŠไธ‹ๆ–‡๏ผˆ128k๏ผ‰ใ€ไปฃ็ ๅผบๆทฑๅบฆๅˆ†ๆžใ€ไปฃ็ ใ€้•ฟๆ–‡ๆ•ดๅˆ
geminiGeminiๅˆ›ๆ„ๅฅฝใ€ๅคšๆจกๆ€ๅ†™ไฝœใ€ๆ–‡ๆกˆใ€ๅ›พๅƒ็†่งฃ
sonnetClaude Sonnetๅ‡่กกใ€ๅทฅๅ…ท่ฐƒ็”จ็จณๅคๆ‚ๆŽจ็†ใ€่ง„ๅˆ’ใ€ๅฎกๆ ธ
opusClaude Opusๆœ€ๅผบๆŽจ็†ๆžๅคๆ‚ๅˆ†ๆžใ€ๆžถๆž„่ฎพ่ฎก

Role โ†’ Model mapping (default)

่ง’่‰ฒ้ป˜่ฎคๆจกๅž‹ๅŽŸๅ› 
๐Ÿ” ็ ”็ฉถๅ‘˜ / ResearcherGLM่ฝป้‡ๆœ็ดข๏ผŒๅคŸ็”จไธ”ไพฟๅฎœ
๐Ÿ“Š ๅˆ†ๆžๅธˆ / AnalystKimi้•ฟไธŠไธ‹ๆ–‡๏ผŒๅค„็†ๅคง้‡่ต„ๆ–™
โœ๏ธ ๅ†™ไฝœ่€… / WriterGeminiๅˆ›ๆ„ๅ†™ไฝœๆ•ˆๆžœๆœ€ๅฅฝ
๐Ÿ’ป ็จ‹ๅบๅ‘˜ / CoderKimi้•ฟไธŠไธ‹ๆ–‡ไปฃ็ ็†่งฃ
๐Ÿ”Ž ๅฎกๆ ธๅ‘˜ / ReviewerGLM็ฎ€ๅ•ๅˆคๆ–ญ๏ผŒไธ้œ€้‡็‚ฎ
๐Ÿ“‹ ่ง„ๅˆ’ๅธˆ / PlannerSonnet็ป“ๆž„ๅŒ–่ง„ๅˆ’่ƒฝๅŠ›ๅผบ
๐Ÿง ๆ‰น่ฏ„่€… / CriticSonnet้€ป่พ‘ไธฅ่ฐจ๏ผŒๆŒ‘ๆˆ˜ๅ‡่ฎพ

When to override defaults

  • ไปปๅŠกๅพˆ็ฎ€ๅ• โ†’ ้™็บงๅˆฐ GLM๏ผˆ็œๆˆๆœฌ๏ผ‰
  • ้œ€่ฆๆœ€้ซ˜่ดจ้‡ โ†’ ๅ‡็บงๅˆฐ Opus
  • ็”จๆˆทๆ˜Ž็กฎๆŒ‡ๅฎšๆจกๅž‹ โ†’ ็…ง็”จๆˆท่ฏด็š„ๆฅ
  • ๅคšๆจกๅž‹ๅฏนๆฏ”ๅœบๆ™ฏ โ†’ ๆฏไธช Agent ็”จไธๅŒๆจกๅž‹๏ผŒๅœจๅ…ฌๅ‘Š้‡Œ่ฏดๆ˜Ž

Always announce the model

In the pre-spawn announcement, every agent line must include the model:

โœ… ่ฟ™ๆ ท๏ผš๐Ÿ” ็ ”็ฉถๅ‘˜A๏ผˆGLM๏ผ‰โ€” ่ฐƒ็ ” LangChain
โŒ ่ฟ™ๆ ท๏ผš๐Ÿ” ็ ”็ฉถๅ‘˜A โ€” ่ฐƒ็ ” LangChain

Step 0: Always plan first (dynamic agent count)

Never hardcode how many agents to spawn. The right number depends on the task complexity. Always start with a planning step:

1. Analyze the task โ†’ identify subtopics / dimensions
2. Decide: how many agents? which roles? which mode?
3. Spawn accordingly (could be 2, could be 10)
4. Consolidate results

Example planning output:

Task: "Research the top AI agent frameworks"
โ†’ Plan: 5 researchers (one per framework) + 1 analyst for comparison
โ†’ Mode: Orchestrator (needs web search)
โ†’ Spawn: 5 parallel sub-agents

The number of agents should match the task, not a template.


Three modes โ€” auto-routed by intent

You don't need to say which mode. Just describe the task. The skill reads these two signals:

  1. Need web search / real-time info? โ†’ use sessions_spawn (has tools)
  2. Want multiple draft versions to compare? โ†’ spawn parallel writers
User says anything
        โ†“
  Wants multiple versions / drafts / angles?
        YES โ”€โ”€โ†’ Also needs web search?
        โ”‚              YES โ†’ ๐Ÿ”€ Hybrid Mode   (search first, then N drafts)
        โ”‚              NO  โ†’ ๐Ÿ”„ Pipeline Mode (N drafts in parallel, pure text)
        โ”‚
        NO  โ”€โ”€โ†’ Needs web search / file ops?
                       YES โ†’ ๐ŸŽฏ Orchestrator Mode (sessions_spawn, parallel)
                       NO  โ†’ ๐Ÿ”„ Pipeline Mode     (pure text, faster)

Trigger signals the skill listens for:

SignalExamplesMode triggered
Multi-draft intent"ๅ‡ ไธช็‰ˆๆœฌ", "ๅคšไธช่ง’ๅบฆ", "่ฎฉๆˆ‘ๆŒ‘", "ๅ„่‡ชๅ†™", "different styles"Pipeline or Hybrid
Search intent"ๆœ็ดข", "ๆœ€ๆ–ฐ", "่ฐƒ็ ”", "่”็ฝ‘", "search", "latest"Orchestrator or Hybrid
Both"ๆœ็ดขๅŽ็ป™ๆˆ‘ๅ‡ ็‰ˆๆŠฅๅ‘Š", "research then write multiple drafts"Hybrid
Neither"็ฟป่ฏ‘", "ๅˆ†ๆž", "ๅ†™ไฝœ", plain text tasksPipeline

You can also check with the router directly:

python scripts/router.py mode "ๆœ็ดข็ซžๅ“่ต„ๆ–™๏ผŒๅธฎๆˆ‘ๅ†™3ไธช็‰ˆๆœฌ็š„ๅˆ†ๆž"
# โ†’ ๐Ÿ”€ HYBRID
python scripts/router.py mode "่ฐƒ็ ”LangChainๅนถๅ†™ไธ€ไปฝๆŠฅๅ‘Š"
# โ†’ ๐ŸŽฏ ORCHESTRATOR
python scripts/router.py mode "็”จไธ‰ไธช่ง’ๅบฆๅˆ†ๆž่ฟ™ไธชๆ–นๆกˆ"
# โ†’ ๐Ÿ”„ PIPELINE

๐ŸŽฏ Orchestrator Mode (with tools, truly parallel)

Sub-agents launched via sessions_spawn. Each has full OpenClaw tools: web search, file read/write, code execution.

โšก How parallelism works: Call multiple sessions_spawn in the same tool-call round โ€” OpenClaw executes them simultaneously. All sub-agents run at once; the main agent collects all results when they finish.

Same round โ†’ parallel execution:

sessions_spawn(task="Search LangChain...") โ”€โ”€โ”
sessions_spawn(task="Search CrewAI...")    โ”€โ”€โ”คโ†’ all run simultaneously
sessions_spawn(task="Search AutoGen...")   โ”€โ”€โ”˜
sessions_spawn(task="Search LangGraph...") โ”€โ”˜

โ†“  (all finish, main agent receives all 4 results)

Main agent consolidates โ†’ writes full report

Sequential = spawn one, wait for result, then spawn next. Use this only when a later task depends on an earlier result (e.g. write report AFTER research is done).

How to spawn โ€” always include role, model hint, and what to return:

# Parallel research: spawn all 4 in the same round โ†’ they run simultaneously
sessions_spawn({
    "task": "[CONTEXT] Comparing AI agent frameworks for a tech team report.\n\n[YOUR TASK] Search LangChain: architecture, pros/cons, GitHub stars, latest version. Return 5 bullet points โ‰ค100 words each. Do NOT write a full report.",
    "label": "๐Ÿ” researcher-langchain [model: default]"
})
sessions_spawn({
    "task": "[CONTEXT] Same report.\n\n[YOUR TASK] Search CrewAI: architecture, pros/cons, GitHub stars, latest version. Return 5 bullet points โ‰ค100 words each.",
    "label": "๐Ÿ” researcher-crewai [model: default]"
})
sessions_spawn({
    "task": "[CONTEXT] Same report.\n\n[YOUR TASK] Search AutoGen: architecture, pros/cons, GitHub stars, latest version. Return 5 bullet points โ‰ค100 words each.",
    "label": "๐Ÿ” researcher-autogen [model: default]"
})
sessions_spawn({
    "task": "[CONTEXT] Same report.\n\n[YOUR TASK] Search LangGraph: architecture, pros/cons, GitHub stars, latest version. Return 5 bullet points โ‰ค100 words each.",
    "label": "๐Ÿ” researcher-langgraph [model: default]"
})
# All 4 run in parallel โ†’ when all return, main agent consolidates and writes report

Mixed: parallel then sequential (most common pattern):

# Phase 1: parallel research (spawn all at once)
sessions_spawn({"task": "[CONTEXT] ...\n\n[TASK] Search LangChain. 5 bullets โ‰ค100 words.", "label": "๐Ÿ” researcher-langchain"})
sessions_spawn({"task": "[CONTEXT] ...\n\n[TASK] Search CrewAI. 5 bullets โ‰ค100 words.", "label": "๐Ÿ” researcher-crewai"})
sessions_spawn({"task": "[CONTEXT] ...\n\n[TASK] Search AutoGen. 5 bullets โ‰ค100 words.", "label": "๐Ÿ” researcher-autogen"})

# Phase 2: after all 3 return โ†’ main agent writes report (sequential, depends on research)
# (main agent does this directly, no need to spawn a writer)

Key rules:

  • โœ… Same round = parallel: spawn multiple agents at once for independent tasks
  • โœ… Sequential: spawn one, wait for result, then spawn next โ€” only when tasks depend on each other
  • โœ… Sub-agents return summaries only (โ‰ค100 words per point)
  • โœ… Main agent writes the full report (avoids token limit failures)
  • โœ… Label each agent clearly: role + what model it's using
  • โŒ Don't ask a sub-agent to both search AND write a long report

๐Ÿ”„ Pipeline Mode (pure text, any task)

Runs agents via Python CLI. No web search, but works for any pure-text task: writing, analysis, translation, multi-model comparison, brainstorming, code generation.

cd ~/.openclaw/skills/claw-multi-agent

# Parallel: multiple agents tackle different angles simultaneously
python run.py --mode parallel \
  --agents "fast:๐Ÿ” researcher:summarize the pros of microservice architecture" \
           "fast:๐Ÿ” researcher:summarize the cons of microservice architecture" \
           "fast:๐Ÿ” researcher:list real-world companies using microservices and outcomes" \
           "smart:๐Ÿ“Š analyst:compare microservices vs monolith for a 10-person startup" \
  --aggregation synthesize

# Sequential: chain agents, each builds on the previous output
python run.py --mode sequential \
  --agents "fast:๐Ÿ“‹ planner:break down how to build a REST API in Python" \
           "smart:๐Ÿ’ป coder:implement the API based on the plan above" \
           "fast:๐Ÿ”Ž reviewer:review the code for bugs and security issues" \
  --aggregation last

# Auto-route: router classifies task and picks tiers automatically
python run.py --auto-route --task "write a technical blog post about GRPO vs PPO"

# Dry-run: preview the plan without executing
python run.py --dry-run \
  --agents "fast:researcher:research X" "smart:writer:write report"

Pipeline mode works great for:

  • Multi-angle analysis (spawn one agent per dimension)
  • Multi-model comparison (same task, different models)
  • Code pipeline (plan โ†’ code โ†’ review)
  • Batch writing (translate/summarize N documents in parallel)

๐Ÿ”€ Hybrid Mode (search + multi-draft)

Best of both worlds: sub-agents search the web (with tools), then multiple writers generate parallel drafts from the research.

When it kicks in: user wants both real-time research AND multiple versions to compare.

Phase 1 (Orchestrator โ€” with tools, parallel):
  sessions_spawn(search topic A) โ”€โ”€โ”
  sessions_spawn(search topic B) โ”€โ”€โ”ค โ†’ all run simultaneously
  sessions_spawn(search topic C) โ”€โ”€โ”˜
  โ†“ research summaries collected

Phase 2 (Pipeline โ€” pure text, parallel):
  openclaw agent (writer style 1) โ”€โ”€โ”
  openclaw agent (writer style 2) โ”€โ”€โ”ค โ†’ all run simultaneously
  openclaw agent (writer style 3) โ”€โ”€โ”˜
  โ†“ 3 draft versions returned

Main agent: compare drafts โ†’ pick best or synthesize

CLI usage:

# Auto: router detects hybrid intent and runs both phases
python run.py --mode hybrid --task "่ฐƒ็ ”ไธปๆตAIๆก†ๆžถ๏ผŒ็ป™ๆˆ‘3ไธชไธๅŒ้ฃŽๆ ผ็š„ๅฏนๆฏ”ๆŠฅๅ‘Š" --num-drafts 3

# Auto-mode: let router decide the mode automatically
python run.py --auto-mode --task "ๆœ็ดข็ซžๅ“่ต„ๆ–™ๅŽๅ†™ๅ‡ ไธช็‰ˆๆœฌ็š„ๅˆ†ๆž"

In conversation (sessions_spawn approach):

# Phase 1: parallel research (spawn all at once)
sessions_spawn({"task": "[CONTEXT] ...\n\n[TASK] Search LangChain. 5 bullets.", "label": "๐Ÿ” research-langchain"})
sessions_spawn({"task": "[CONTEXT] ...\n\n[TASK] Search CrewAI. 5 bullets.", "label": "๐Ÿ” research-crewai"})
sessions_spawn({"task": "[CONTEXT] ...\n\n[TASK] Search AutoGen. 5 bullets.", "label": "๐Ÿ” research-autogen"})

# After all 3 return โ†’ Phase 2: main agent writes 3 draft versions itself
# (or spawn 3 pipeline agents with research as context)

Smart Router

Built-in task classifier. Auto-picks the right tier based on keywords:

python scripts/router.py classify "write a Python web scraper"
# โ†’ Tier: CODE  (routes to smart model)

python scripts/router.py classify "research the latest LLM papers"
# โ†’ Tier: RESEARCH  (routes to fast model)

python scripts/router.py spawn --json --multi "research X and write a report"
# โ†’ splits into 2 tasks: RESEARCH + CREATIVE
TierModelUsed for
FASTdefault (light)Simple queries, status, translation, search
CODEdefault (smart)Programming, debugging, implementation
RESEARCHdefault (light)Research, search, compare, survey
CREATIVEdefault (smart)Writing, articles, documentation
REASONINGdefault (best)Architecture, logic, complex analysis

contextSharing: Give sub-agents background

Sub-agents start as fresh sessions โ€” they don't know your goal. Add a [CONTEXT] block.

Pattern 1: recent (recommended โ€” works for 95% of cases)

[CONTEXT] User is comparing AI agent frameworks for a team report. Audience: engineers.

[YOUR TASK] Search LangChain pros and cons. Return 5 bullet points โ‰ค100 words each.

Pattern 2: summary (sequential tasks โ€” pass prior results forward)

[PRIOR FINDINGS]
- LangChain: richest ecosystem, steep curve
- CrewAI: clean role separation...

[YOUR TASK] Based on above, search AutoGen. Return 3 unique points not covered above.

Pattern 3: full (complex background โ€” let agent read a file)

[CONTEXT FILE] Read /workspace/research/context.md for full background.

[YOUR TASK] Search latest Test-Time Compute Scaling advances. Return 3 summaries.

Reuse context across parallel agents:

BG = "Researching RL post-training for ML engineers. Topics: GRPO/DAPO/PPO, veRL."

sessions_spawn({"task": f"[CONTEXT] {BG}\n\n[TASK] Search GRPO vs PPO benchmarks. 5 bullets โ‰ค100 words.", "label": "๐Ÿ” researcher-grpo [model: default]"})
sessions_spawn({"task": f"[CONTEXT] {BG}\n\n[TASK] Search DAPO design. 5 bullets โ‰ค100 words.", "label": "๐Ÿ” researcher-dapo [model: default]"})
sessions_spawn({"task": f"[CONTEXT] {BG}\n\n[TASK] Search veRL architecture. 5 bullets โ‰ค100 words.", "label": "๐Ÿ” researcher-verl [model: default]"})

Execution summary โ€” always output this

After every multi-agent run, print a standard card:

## ๐Ÿ“Š Execution Summary

Mode: ๐ŸŽฏ Orchestrator Mode (sessions_spawn, with tools)

| Agent | Role | Model | Time | Status |
|-------|------|-------|------|--------|
| ๐Ÿ” researcher-langchain | Researcher | default | 22s | โœ… |
| ๐Ÿ” researcher-crewai    | Researcher | default | 19s | โœ… |
| ๐Ÿ” researcher-autogen   | Researcher | default | 24s | โœ… |
| ๐Ÿ” researcher-langgraph | Researcher | default | 21s | โœ… |
| โœ๏ธ main (consolidate)   | Writer     | default | 38s | โœ… |

Agents spawned: 4  |  Parallel time: ~24s  |  Serial equivalent: ~86s  |  Saved: ~62s (72%)

Always include:

  • Mode (Orchestrator / Pipeline + Sequential/Parallel)
  • Each agent's role emoji + name + model used
  • Actual elapsed time per agent
  • Total parallel time vs serial equivalent

Preset roles

RoleEmojiBest for
researcher๐Ÿ”Web search, info gathering
writerโœ๏ธReports, documentation, articles
coder๐Ÿ’ปCode writing, debugging, implementation
analyst๐Ÿ“ŠData analysis, comparison, statistics
reviewer๐Ÿ”ŽCode / content review, QA
planner๐Ÿ“‹Task planning, decomposition
critic๐ŸงRisk analysis, devil's advocate

โš ๏ธ Gotchas

Gotcha 0: Reading files before announcing (most common mistake)

Investigating context before sending the activation announcement causes long silence and risks losing the announcement entirely due to context compression.

  • โŒ Receive task โ†’ read operators.py โ†’ read README โ†’ announce โ†’ spawn
  • โœ… Receive task โ†’ announce immediately (can say "analyzing task...") โ†’ read files โ†’ spawn

Gotcha 1: Sub-agent output token limit

Sub-agents have a ~4096 token output cap. Exceeded โ†’ tool args truncated โ†’ file writes silently fail.

  • โŒ "search AND write a 2000-word report"
  • โœ… Sub-agent returns summaries; main agent writes the report

Gotcha 2: Orchestrator Mode has no tools in Pipeline Mode

python run.py processes have no web_search, exec, etc.

  • โŒ Pipeline mode: "search the latest news on X"
  • โœ… Anything needing real web access โ†’ Orchestrator Mode

Gotcha 3: Parallel agents can't depend on each other

Agents spawned in the same round run simultaneously.

  • โŒ Agent-2: "based on Agent-1's results..."
  • โœ… Parallel = independent; sequential = chained

Gotcha 4: Don't hardcode agent count

Match agents to the task, not to a template.

  • โŒ Always spawn exactly 3 agents
  • โœ… Plan first, then decide: simple task โ†’ 2 agents, complex โ†’ 8+ agents

Pipeline mode quick reference

python run.py
  --mode parallel|sequential
  --agents "tier_or_model:๐ŸŽญrole:task description"   # repeatable, any number
  --aggregation synthesize|compare|concatenate|last
  --timeout 300
  --dry-run          # preview without executing
  --auto-route       # router picks tiers automatically
  --list-models      # show current model config
AggregationEffect
synthesizeMain agent summarizes all outputs (default)
compareSide-by-side of each agent's output
concatenateOutputs joined in order
lastFinal agent's output only (sequential)