Multi-Agent Coordinator
v0.1.0Production-ready multi-agent orchestration system for OpenClaw. Implements Coordinator Mode with real parallel worker spawning via sessions_spawn, XML task n...
MIT-0
Security Scan
OpenClaw
Suspicious
medium confidencePurpose & Capability
Name/description match the code: the package implements a Coordinator and workers and uses a four‑phase workflow. However the code calls an external 'openclaw' CLI (and SKILL.md shows a 'sessions_spawn' command), yet the registry metadata declares no required binaries. The coordinator also creates prompts that instruct spawned workers to use powerful tools (read/edit/bash/web_search), which is coherent with orchestration but should have been declared as a runtime dependency/requirement.
Instruction Scope
SKILL.md and scripts instruct the agent to prepare prompts, spawn real workers, and process XML notifications; the worker prompts explicitly tell workers to use file operations, bash, web_fetch, etc., and to include exact file paths and code snippets in results. That means spawned workers can read and modify repository files and potentially any files accessible to the agent. The instructions also expect collecting and parsing arbitrary XML outputs from workers. The scope is broad and includes actions (file read/write, shell/subprocess invocation, network fetch) that go beyond simple orchestration; this is intended for the feature but increases risk and should be verified.
Install Mechanism
There is no install spec (instruction-only), so nothing is downloaded automatically. That is lower risk. But the code invokes subprocesses calling an 'openclaw' CLI (and SKILL.md suggests a 'sessions_spawn' tool) which is not declared as a required binary — an undeclared external dependency. No remote archives or installers are present in the package.
Credentials
The skill declares no required environment variables or credentials, which superficially looks minimal. In practice it spawns workers that are instructed to use powerful tools (file I/O, bash, web_fetch, web_search) and persist state under .openclaw/scratchpad. That means sensitive local data (secrets, config files) may be exposed to spawned workers. Also the 'openclaw' CLI the scripts call may require credentials or an environment the package doesn't declare. The lack of declared credentials is not malicious, but the combination of undeclared CLI dependency and broad worker tool access is disproportionate if you expected a lightweight coordinator.
Persistence & Privilege
The skill persists state to .openclaw/scratchpad and coordinator_state.json (expected for an orchestrator) and does not set always:true. It does not appear to modify other skills or global agent settings. Still, persistence of worker prompts/results to the filesystem means sensitive outputs will remain on disk and should be monitored/cleared as needed.
What to consider before installing
This skill is functionally coherent with a multi-agent orchestrator, but take precautions before running it:
- Expect to need the OpenClaw CLI (or equivalent) in PATH: the scripts call subprocess commands like 'openclaw sessions spawn' though the registry metadata claims no required binaries; install and verify the OpenClaw CLI you plan to use first.
- The SKILL.md and code are inconsistent about spawn commands (SKILL.md shows 'sessions_spawn' while code uses 'openclaw sessions spawn'); verify the correct invocation for your environment.
- Spawned workers are explicitly allowed to run file operations, shell commands, and web fetches and are instructed to include concrete file paths and code snippets in outputs — run this skill only in an isolated/sandbox workspace without secrets or sensitive files.
- Review the worker prompt templates and scripts (coordinator_v2.py, coordinator_phase2.py, worker.py) to confirm they do not exfiltrate data to external endpoints you don’t control. The package itself does not contain external network endpoints, but worker prompts could instruct sub-agents to perform web requests.
- Test in a disposable environment first (empty repo, no credentials), and inspect .openclaw/scratchpad after runs. If you need to use in production, consider adding explicit restrictions/sandboxing on spawned workers and ensure the OpenClaw CLI you trust is used.
If you want, I can list the exact lines where subprocess calls are made and point out the files/sections that should be reviewed or edited before use.Like a lobster shell, security has layers — review code before you run it.
latest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
Multi-Agent Skill (Phase 2.5 - Production Ready)
生产级多智能体协调系统,支持真实的并行 Worker 执行和完整的四阶段工作流。
Quick Start
1. 准备 Worker
cd skills/multi-agent
python3 scripts/coordinator_v2.py prepare "Your task description" --role researcher
这会生成:
- Worker 规格文件
.openclaw/scratchpad/workers/{id}.json - Worker 提示词
.openclaw/scratchpad/prompts/prompt-{id}.txt
2. 派生 Worker(真实执行)
# 读取生成的 prompt 并派生
prompt=$(cat .openclaw/scratchpad/prompts/prompt-{worker-id}.txt)
sessions_spawn --label "multi-agent-worker-{worker-id}" \
--task "$prompt" \
--timeout 300 \
--cleanup keep
3. 处理完成通知
当 Worker 完成时,它会输出 XML 格式的通知。收集并处理:
python3 scripts/coordinator_v2.py notify {worker-id} --file notification.xml
4. 生成规格文档
# 从已完成的 Research Workers 生成规格
python3 scripts/coordinator_v2.py spec {worker-id-1} {worker-id-2} {worker-id-3}
5. 运行演示
# 四阶段工作流演示(模拟执行)
python3 scripts/demo_workflow.py "Your task here"
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ COORDINATOR │
│ - spawn_worker() : Prepare worker spec and prompt │
│ - process_notification() : Handle worker completion │
│ - generate_spec() : Synthesize findings from workers │
└────────────────────┬────────────────────────────────────────────┘
│
┌────────────┼────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Worker 1│ │ Worker 2│ │ Worker 3│ ... (parallel)
│(Research│ │(Research│ │(Research│
│ 1) │ │ 2) │ │ 3) │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
└────────────┼────────────┘
▼
┌─────────────────┐
│ SYNTHESIS │ Coordinator generates spec
│ (generate_spec)│
└────────┬────────┘
▼
┌───────────┴───────────┐
▼ ▼
┌─────────┐ ┌─────────┐
│Worker 4 │ │Worker 5 │
│(Impl 1) │ │(Impl 2) │
└────┬────┘ └────┬────┘
│ │
└──────────┬───────────┘
▼
┌─────────────────┐
│ VERIFICATION │
│ (Worker 6, 7...)│
└─────────────────┘
File Structure
skills/multi-agent/
├── SKILL.md # 本文件
├── test-report-phase2.5.md # 测试报告
├── scripts/
│ ├── coordinator_v2.py # ⭐ 主协调器(生产级)
│ ├── demo_workflow.py # 四阶段工作流演示
│ ├── coordinator.py # Phase 1: 模拟版
│ ├── coordinator_phase2.py # Phase 2: 过渡版
│ ├── worker.py # Worker 参考实现
│ └── protocol.py # XML 协议
└── references/
└── ARCHITECTURE.md # 架构设计文档
.openclaw/scratchpad/ # 运行时生成的共享知识
├── workers/ # Worker 状态
├── results/ # Worker 结果
├── specs/ # 规格文档
├── prompts/ # Worker 提示词
└── coordinator_state.json # 协调器状态
XML Protocol
Worker 必须按以下格式返回结果:
<task-notification>
<task-id>{worker-id}</task-id>
<status>completed|failed</status>
<summary>One-line summary</summary>
<result>
Detailed findings, changes made, or test results...
Include specific file paths and code snippets.
</result>
</task-notification>
Four-Phase Workflow
Phase 1: Research (并行探索)
- 派生 2-4 个 Researcher Worker
- 每个从不同角度探索问题
- 并行执行,收集发现
Phase 2: Synthesis (综合)
- Coordinator 读取所有 Researcher 的发现
- 生成 Implementation Specification
- 定义具体的实现步骤
Phase 3: Implementation (实现)
- 派生 1-2 个 Implementer Worker
- 基于规格执行代码修改
- 可以并行处理不同模块
Phase 4: Verification (验证)
- 派生 1-2 个 Verifier Worker
- 运行测试,检查回归
- 验证实现正确性
Commands
coordinator_v2.py
# 准备 Worker(创建规格和提示词)
python3 coordinator_v2.py prepare "Task description" --role researcher
# 处理 Worker 完成通知
python3 coordinator_v2.py notify {worker-id} --file notification.xml
# 列出 Workers
python3 coordinator_v2.py list
python3 coordinator_v2.py list --status completed
# 从 Workers 生成规格
python3 coordinator_v2.py spec {id1} {id2} {id3}
demo_workflow.py
# 运行完整演示(模拟执行)
python3 demo_workflow.py "Your task"
# 查看真实使用示例
python3 demo_workflow.py --real
Integration with OpenClaw
This skill leverages OpenClaw's native capabilities:
| OpenClaw Feature | Multi-Agent Usage |
|---|---|
sessions_spawn | Spawn real worker agents |
sessions_send | Send messages to workers |
sessions_list | List active workers |
sessions_history | Collect worker results |
State Persistence
- Worker 状态自动保存到
.openclaw/scratchpad/workers/ - Coordinator 状态保存到
.openclaw/scratchpad/coordinator_state.json - 支持断点续传:重启后可以恢复之前的 Workers
Testing
# 运行演示
python3 scripts/demo_workflow.py
# 检查生成的文件
ls -la .openclaw/scratchpad/
cat .openclaw/scratchpad/specs/spec-*.md
Next Steps
- Use it: 用真实任务测试四阶段工作流
- Improve prompts: 优化 Worker 提示词模板
- Add features: 实现 Agent Teams(Phase 3)
- Monitor: 添加 Token 消耗和耗时统计
References
Files
10 totalSelect a file
Select a file to preview.
Comments
Loading comments…
