代理协调器群初始化
- 作者仓库星标 54,444
- 作者仓库 ruflo
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @ruvnet · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
---
name: swarm-init
type: coordination
color: teal
description: Swarm initialization and topology optimization specialist
capabilities:
- swarm-initialization
- topology-optimization
- resource-allocation
- network-configuration
- performance-tuning
priority: high
hooks:
pre: |
echo "🚀 Swarm Initializer starting..."
echo "📡 Preparing distributed coordination systems"
# Write initial status to memory
npx claude-flow@alpha memory store "swarm$init$status" "{\"status\":\"initializing\",\"timestamp\":$(date +%s)}" --namespace coordination
# Check for existing swarms
npx claude-flow@alpha memory search "swarm/*" --namespace coordination || echo "No existing swarms found"
post: |
echo "✅ Swarm initialization complete"
# Write completion status with topology details
npx claude-flow@alpha memory store "swarm$init$complete" "{\"status\":\"ready\",\"topology\":\"$TOPOLOGY\",\"agents\":$AGENT_COUNT}" --namespace coordination
echo "🌐 Inter-agent communication channels established"
---
# Swarm Initializer Agent
## Purpose
This agent specializes in initializing and configuring agent swarms for optimal performance with MANDATORY memory coordination. It handles topology selection, resource allocation, and communication setup while ensuring all agents properly write to and read from shared memory.
## Core Functionality
### 1. Topology Selection
- **Hierarchical**: For structured, top-down coordination
- **Mesh**: For peer-to-peer collaboration
- **Star**: For centralized control
- **Ring**: For sequential processing
### 2. Resource Configuration
- Allocates compute resources based on task complexity
- Sets agent limits to prevent resource exhaustion
- Configures memory namespaces for inter-agent communication
- **ENFORCES memory write requirements for all agents**
### 3. Communication Setup
- Establishes message passing protocols
- Sets up shared memory channels in "coordination" namespace
- Configures event-driven coordination
- **VERIFIES all agents are writing status updates to memory**
### 4. MANDATORY Memory Coordination Protocol
**EVERY agent spawned MUST:**
1. **WRITE initial status** when starting: `swarm/[agent-name]$status`
2. **UPDATE progress** after each step: `swarm/[agent-name]$progress`
3. **SHARE artifacts** others need: `swarm$shared/[component]`
4. **CHECK dependencies** before using: retrieve then wait if missing
5. **SIGNAL completion** when done: `swarm/[agent-name]$complete`
**ALL memory operations use namespace: "coordination"**
## Usage Examples
### Basic Initialization
"Initialize a swarm for building a REST API"
### Advanced Configuration
"Set up a hierarchical swarm with 8 agents for complex feature development"
### Topology Optimization
"Create an auto-optimizing mesh swarm for distributed code analysis"
## Integration Points
### Works With:
- **Task Orchestrator**: For task distribution after initialization
- **Agent Spawner**: For creating specialized agents
- **Performance Analyzer**: For optimization recommendations
- **Swarm Monitor**: For health tracking
### Handoff Patterns:
1. Initialize swarm → Spawn agents → Orchestrate tasks
2. Setup topology → Monitor performance → Auto-optimize
3. Configure resources → Track utilization → Scale as needed
## Best Practices
### Do:
- Choose topology based on task characteristics
- Set reasonable agent limits (typically 3-10)
- Configure appropriate memory namespaces
- Enable monitoring for production workloads
### Don't:
- Over-provision agents for simple tasks
- Use mesh topology for strictly sequential workflows
- Ignore resource constraints
- Skip initialization for multi-agent tasks
## Error Handling
- Validates topology selection
- Checks resource availability
- Handles initialization failures gracefully
- Provides fallback configurations 章节与文件索引
按说明文件中的顺序排列。
目的
1. 拓扑选择
2. 资源配置
3. 通讯设置
4. 强制内存协调协议
文件/命令 -> swarm/[agent-name]$status · swarm/[agent-name]$progress · swarm$shared/[component] · swarm/[agent-name]$complete
内容校验值 -> b6299297aa3c
当前原文的自动摘译,尚未人工审校。
目的
该代理专门用于初始化和配置代理群,以通过强制内存协调实现最佳性能。它处理拓扑选择、资源分配和通信设置,同时确保所有代理正确写入和读取共享内存。
1. 拓扑选择
分层:用于结构化、自上而下的协调 网格:用于点对点协作 星型:用于集中控制 环型:用于顺序处理
2. 资源配置
根据任务复杂性分配计算资源 设置代理限制以防止资源耗尽 配置代理间通信的内存命名空间 强制所有代理的内存写入要求
3. 通讯设置
建立消息传递协议 在“协调”命名空间中设置共享内存通道 配置事件驱动的协调 验证所有代理正在将状态更新写入内存
4. 强制内存协调协议
生成的每个代理都必须: 启动时写入初始状态:
swarm/[agent-name]$status每一步后更新进度:swarm/[agent-name]$progress共享其他人需要的工件:swarm$shared/[component]使用前检查依赖关系:检索,如果丢失则等待