multi-agent
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese多代理并行协作
Multi-Agent Parallel Collaboration
安装与初始化
Installation and Initialization
-
安装技能:bash
npx skills add ayflying/ai-skills --skill multi-agent -
初始化 IDE 代理(首次或更新时执行):bash
python .agents/skills/multi-agent/scripts/setup.py
-
Install Skill:bash
npx skills add ayflying/ai-skills --skill multi-agent -
Initialize IDE Agent (Execute for the first time or when updating):bash
python .agents/skills/multi-agent/scripts/setup.py
自定义代理名称
Customize Agent Names
安装后会在项目根目录生成 文件。编辑 变量自定义名称,重新运行 setup.py 使配置生效。
.env_NAMEAfter installation, a file will be generated in the project root directory. Edit the variables to customize names, and re-run setup.py for the configuration to take effect.
.env_NAME核心原则
Core Principles
任务分配权唯一:只有 ${MASTER_NAME} 能分配任务,其他代理不能私自接受或分配任务。
Unique Task Assignment Right: Only ${MASTER_NAME} can assign tasks; other agents cannot accept or assign tasks without permission.
职责分层
Responsibility Hierarchy
| 角色 | 职责 | 任务来源 |
|---|---|---|
| ${MASTER_NAME} | 唯一任务分配者 | 用户指令 |
| ${PLANNER_NAME} | 功能设计 + 功能验收 | 接收 ${MASTER_NAME} 分配 |
| ${LEAD_PROGRAMMER_NAME} | 架构设计 + 程序分配(唯一) | 只能接收 ${MASTER_NAME} 分配 |
| ${ARTIST_NAME} | UI/UX设计 | 接收 ${MASTER_NAME} 分配 |
| @build | 代码实现(可多个并发) | 只能接收 ${LEAD_PROGRAMMER_NAME} 分配 |
| @test-writer | 功能测试 | 接收 ${MASTER_NAME} 分配 |
| Role | Responsibility | Task Source |
|---|---|---|
| ${MASTER_NAME} | The only task assigner | User instructions |
| ${PLANNER_NAME} | Function design + Function acceptance | Assigned by ${MASTER_NAME} |
| ${LEAD_PROGRAMMER_NAME} | Architecture design + Program assignment (exclusive) | Can only receive assignments from ${MASTER_NAME} |
| ${ARTIST_NAME} | UI/UX Design | Assigned by ${MASTER_NAME} |
| @build | Code implementation (multiple concurrent allowed) | Can only receive assignments from ${LEAD_PROGRAMMER_NAME} |
| @test-writer | Functional testing | Assigned by ${MASTER_NAME} |
标准工作流程
Standard Workflow
用户需求
↓
[MASTER] 判断需求是否明确
↓
┌─ 需求不明确 → [PLANNER] 功能设计 → 交回 [MASTER] 分配
│
└─ 需求明确 → [MASTER] 任务分配
↓
┌─────────────┼─────────────┐
↓ ↓ ↓
[LEAD-PROGRAMMER] [ARTIST] ...
↓
分配给多个@build并发开发
↓
汇总完成结果
↓
[MASTER] → [PLANNER] 功能验收
↓ 不满意
交回 [MASTER] 重新分配
↓ 通过
[MASTER] → [TEST-WRITER] 功能测试
↓
汇总向用户反馈User Requirements
↓
[MASTER] Judge whether requirements are clear
↓
┌─ Requirements unclear → [PLANNER] Function design → Return to [MASTER] for assignment
│
└─ Requirements clear → [MASTER] Task assignment
↓
┌─────────────┼─────────────┐
↓ ↓ ↓
[LEAD-PROGRAMMER] [ARTIST] ...
↓
Assign to multiple @build for concurrent development
↓
Summarize completed results
↓
[MASTER] → [PLANNER] Function acceptance
↓ Not satisfied
Return to [MASTER] for re-assignment
↓ Passed
[MASTER] → [TEST-WRITER] Functional testing
↓
Summarize and feedback to userBug处理流程
Bug Handling Process
发现Bug → [MASTER]判断问题根源
↓
┌─ 设计问题 → [PLANNER] 重新设计
│
└─ 程序问题 → [LEAD-PROGRAMMER] 修复Bug Found → [MASTER] Judge root cause of the problem
↓
┌─ Design issue → [PLANNER] Redesign
│
└─ Program issue → [LEAD-PROGRAMMER] Fix禁止行为
Prohibited Behaviors
- 任何代理不能私自接受或分配任务
- 程序任务禁止跳过 [LEAD-PROGRAMMER] 直接分配给 @build
- 禁止跳过 [PLANNER] 验收直接测试
- [LEAD-PROGRAMMER] 只能有一个
- No agent can accept or assign tasks without permission
- Program tasks are prohibited from being directly assigned to @build by skipping [LEAD-PROGRAMMER]
- Prohibit skipping [PLANNER] acceptance and directly proceeding to testing
- [LEAD-PROGRAMMER] can only have one
代理列表
Agent List
| 代理 | 默认名称 | 职责 |
|---|---|---|
| master | 总调度 | 唯一任务分配者,不执行具体工作 |
| lead-programmer | 主程 | 程序任务唯一入口,可分配给多个@build并发 |
| planner | 策划 | 功能设计+验收,不能分配任务 |
| artist | 美术 | UI/UX设计 |
| build | 构建 | 代码实现(可多个并发) |
| test-writer | 测试 | 功能测试 |
| code-reviewer | 审查 | 代码审查 |
| security-auditor | 安全 | 安全审计 |
| docs-writer | 文档 | 编写技术文档 |
| performance-optimizer | 性能 | 性能优化 |
| Agent | Default Name | Responsibility |
|---|---|---|
| master | Master Scheduler | The only task assigner, does not perform specific work |
| lead-programmer | Lead Programmer | The exclusive entry for program tasks, can assign to multiple @build concurrently |
| planner | Planner | Function design + acceptance, cannot assign tasks |
| artist | Artist | UI/UX Design |
| build | Builder | Code implementation (multiple concurrent allowed) |
| test-writer | Tester | Functional testing |
| code-reviewer | Code Reviewer | Code review |
| security-auditor | Security Auditor | Security audit |
| docs-writer | Document Writer | Write technical documents |
| performance-optimizer | Performance Optimizer | Performance optimization |