multi-agent-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMulti-Agent Workflow Guide
多Agent工作流指南
When to use
适用场景
- Complex feature spanning multiple domains (full-stack, mobile)
- Coordination needed between frontend, backend, mobile, and QA
- User wants step-by-step guidance for multi-agent coordination
- 跨多个领域的复杂功能(全栈、移动端)
- 需要协调前端、后端、移动端和QA Agent的场景
- 用户需要多Agent协调的分步指导
When NOT to use
不适用场景
- Simple single-domain task -> use the specific agent directly
- User wants automated execution -> use orchestrator
- Quick bug fixes or minor changes
- 简单的单领域任务 -> 直接使用对应Agent即可
- 用户需要自动执行 -> 使用orchestrator
- 快速bug修复或小改动
Core Rules
核心规则
- Always start with PM Agent for task decomposition
- Spawn independent tasks in parallel (same priority tier)
- Define API contracts before frontend/mobile tasks
- QA review is always the final step
- Assign separate workspaces to avoid file conflicts
- Always use Serena MCP tools as the primary method for code exploration and modification
- Never skip steps in the workflow — follow each step sequentially without omission
- 始终从PM Agent开始进行任务分解
- 并行生成独立任务(同一优先级层级)
- 在前端/移动端任务前定义API契约
- QA审核始终是最后一步
- 分配独立工作区以避免文件冲突
- 始终使用Serena MCP工具作为代码探索和修改的主要方式
- 绝不跳过工作流中的步骤——按顺序执行每一步,不得遗漏
Workflow
工作流
Step 1: Plan with PM Agent
步骤1:与PM Agent规划
PM Agent analyzes requirements, selects tech stack, creates task breakdown with priorities.
PM Agent分析需求、选择技术栈、创建带优先级的任务分解。
Step 2: Spawn Agents by Priority
步骤2:按优先级生成Agent
Spawn agents via CLI:
- Use spawn-agent.sh for each task
- CLI selection follows agent_cli_mapping in user-preferences.yaml
- Spawn all same-priority tasks in parallel using background processes
bash
undefined通过CLI生成Agent:
- 为每个任务使用spawn-agent.sh
- CLI选择遵循user-preferences.yaml中的agent_cli_mapping
- 使用后台进程并行生成所有同优先级任务
bash
undefinedExample: spawn backend and frontend in parallel
Example: spawn backend and frontend in parallel
oh-my-ag agent:spawn backend "task description" session-id -w ./backend &
oh-my-ag agent:spawn frontend "task description" session-id -w ./frontend &
wait
undefinedoh-my-ag agent:spawn backend "task description" session-id -w ./backend &
oh-my-ag agent:spawn frontend "task description" session-id -w ./frontend &
wait
undefinedStep 3: Monitor & Coordinate
步骤3:监控与协调
- Use memory read tool to poll files
progress-{agent}.md - Verify API contracts align between agents
- Ensure shared data models are consistent
- 使用内存读取工具轮询文件
progress-{agent}.md - 验证Agent之间的API契约是否一致
- 确保共享数据模型保持统一
Step 4: QA Review
步骤4:QA审核
Spawn QA Agent last to review all deliverables. Address CRITICAL issues by re-spawning agents.
最后生成QA Agent以审核所有交付成果。通过重新生成Agent来解决关键问题。
Automated Alternative
自动化替代方案
For fully automated execution without manual spawning, use the orchestrator skill instead.
如果无需手动生成Agent,想要完全自动执行,请使用orchestrator技能。
References
参考资料
- Workflow examples:
resources/examples.md
- 工作流示例:
resources/examples.md