关于 swarm-init
swarm-init 用于初始化分层 Agent 群组,以协同开展多 Agent 工作。它介绍通过 MCP 或命令行进行设置,并说明如何并行启动和协调具名 Agent。
主要功能
- 01初始化分层 Agent 群组
- 02配置 Agent 数量上限和策略
- 03并行启动具名 Agent
- 04使用 SendMessage 协调 Agent
- 05通过 worktree 隔离并行 Git 工作
适用场景
- 01为项目设置协同多 Agent 工作
- 02将团队扩展到 10 个以上 Agent
- 03在 Git 隔离环境中并行执行 Agent 任务
MCP 相关
该技能提供用于创建分层群组的 MCP swarm_init 调用,也提供命令行替代方式。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ ruvnet/ ruflo --skill swarm-init安装后在 Claude Code 中输入/swarm-init确认已加载。
详细介绍
初始化分层蜂群,以协调多 Agent 工作。
通过 MCP:mcp__plugin_ruflo-core_ruflo__swarm_init({ topology: "hierarchical", maxAgents: 8, strategy: "specialized" })
或通过 CLI:
npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized
然后,在一条消息中通过 Claude Code 的 Task 工具生成具名 Agent,并设置 name:(以便通过 SendMessage 寻址)和 run_in_background: true(以便并行执行)。为每个 Agent 使用 EnterWorktree,确保并行工作安全地使用 Git,并使用 SendMessage 协调 Agent 间的工作。
对于更大的团队(10+),请使用 hierarchical-mesh 拓扑:
npx @claude-flow/cli@latest swarm init --topology hierarchical-mesh --max-agents 15 --strategy specialized
评论
支持 Markdown