swarm-orchestration

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Swarm Orchestration Skill

Swarm 集群编排 Skill

Purpose

用途

Multi-agent swarm coordination for complex tasks. Uses hierarchical topology with specialized agents to break down and execute complex work across multiple files and modules.
面向复杂任务的多Agent集群协调。采用带有专用Agent的分层拓扑结构,可跨多个文件和模块分解并执行复杂工作。

When to Trigger

触发场景

  • 3+ files need changes
  • new feature implementation
  • cross-module refactoring
  • API changes with tests
  • security-related changes
  • performance optimization across codebase
  • database schema changes
  • 需要修改3个及以上文件
  • 新功能实现
  • 跨模块重构
  • 带测试的API变更
  • 安全相关变更
  • 全代码库性能优化
  • 数据库 schema 变更

When to Skip

不适用场景

  • single file edits
  • simple bug fixes (1-2 lines)
  • documentation updates
  • configuration changes
  • quick exploration
  • 单文件编辑
  • 简单bug修复(1-2行代码)
  • 文档更新
  • 配置变更
  • 快速探索

Commands

命令

Initialize Swarm

初始化集群

Start a new swarm with hierarchical topology (anti-drift)
bash
npx @claude-flow/cli swarm init --topology hierarchical --max-agents 8 --strategy specialized
Example:
bash
npx @claude-flow/cli swarm init --topology hierarchical --max-agents 6 --strategy specialized
启动采用分层拓扑结构的新集群(防止偏离目标)
bash
npx @claude-flow/cli swarm init --topology hierarchical --max-agents 8 --strategy specialized
示例:
bash
npx @claude-flow/cli swarm init --topology hierarchical --max-agents 6 --strategy specialized

Route Task

任务路由

Route a task to the appropriate agents based on task type
bash
npx @claude-flow/cli hooks route --task "[task description]"
Example:
bash
npx @claude-flow/cli hooks route --task "implement OAuth2 authentication flow"
根据任务类型将任务分配给对应的Agent
bash
npx @claude-flow/cli hooks route --task "[任务描述]"
示例:
bash
npx @claude-flow/cli hooks route --task "implement OAuth2 authentication flow"

Spawn Agent

生成Agent

Spawn a specific agent type
bash
npx @claude-flow/cli agent spawn --type [type] --name [name]
Example:
bash
npx @claude-flow/cli agent spawn --type coder --name impl-auth
生成特定类型的Agent
bash
npx @claude-flow/cli agent spawn --type [type] --name [name]
示例:
bash
npx @claude-flow/cli agent spawn --type coder --name impl-auth

Monitor Status

监控状态

Check the current swarm status
bash
npx @claude-flow/cli swarm status --verbose
查看当前集群状态
bash
npx @claude-flow/cli swarm status --verbose

Orchestrate Task

任务编排

Orchestrate a task across multiple agents
bash
npx @claude-flow/cli task orchestrate --task "[task]" --strategy adaptive
Example:
bash
npx @claude-flow/cli task orchestrate --task "refactor auth module" --strategy parallel --max-agents 4
跨多个Agent编排任务
bash
npx @claude-flow/cli task orchestrate --task "[任务]" --strategy adaptive
示例:
bash
npx @claude-flow/cli task orchestrate --task "refactor auth module" --strategy parallel --max-agents 4

List Agents

列出Agent

List all active agents
bash
npx @claude-flow/cli agent list --filter active
列出所有活跃的Agent
bash
npx @claude-flow/cli agent list --filter active

Scripts

脚本

ScriptPathDescription
swarm-start
.agents/scripts/swarm-start.sh
Initialize swarm with default settings
swarm-monitor
.agents/scripts/swarm-monitor.sh
Real-time swarm monitoring dashboard
脚本路径描述
swarm-start
.agents/scripts/swarm-start.sh
使用默认设置初始化集群
swarm-monitor
.agents/scripts/swarm-monitor.sh
实时集群监控仪表盘

References

参考文档

DocumentPathDescription
Agent Types
docs/agents.md
Complete list of agent types and capabilities
Topology Guide
docs/topology.md
Swarm topology configuration guide
文档路径描述
Agent Types
docs/agents.md
Agent类型及能力的完整列表
Topology Guide
docs/topology.md
集群拓扑结构配置指南

Best Practices

最佳实践

  1. Check memory for existing patterns before starting
  2. Use hierarchical topology for coordination
  3. Store successful patterns after completion
  4. Document any new learnings
  1. 启动前检查现有模式的记忆
  2. 使用分层拓扑结构进行协调
  3. 完成后保存成功的模式
  4. 记录所有新的经验总结