swarm-planner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSwarm-Ready Planner
Swarm-Ready Planner
Create implementation plans with explicit task dependencies optimized for parallel agent execution. This skill can be ran inside or outside of Plan Mode.
创建具备明确任务依赖关系的实现计划,针对Agent并行执行进行优化。该技能可在计划模式内或模式外运行。
Core Principles
核心原则
- Explore Codebase: Investigate architecture, patterns, existing implementations, dependencies, and frameworks in use.
- Fresh Documentation First: Use Context7 for ANY external library, framework, or API before planning tasks
- Ask Questions: Clarify ambiguities and seek clarification on scope, constraints, or priorities throughout the planning process. At any time.
- Explicit Dependencies: Every task declares what it depends on, enabling maximum parallelization
- Atomic Tasks: Each task is independently executable by a single agent
- Review Before Yield: A subagent reviews the plan for gaps before finalizing
- 探索代码库:调研当前使用的架构、模式、已有实现、依赖项及框架。
- 优先获取最新文档:在规划任务前,针对任何外部库、框架或API,使用Context7工具获取相关信息。
- 主动提问:在整个规划过程中,随时澄清模糊点,寻求关于范围、约束或优先级的说明。
- 明确依赖关系:每个任务都需声明其依赖项,以实现最大化并行执行。
- 原子化任务:每个任务可由单个Agent独立执行。
- 产出前审核:在最终确定计划前,由子Agent审核计划是否存在遗漏。
Process
流程
1. Research
1. 调研
Codebase investigation:
- Architecture, patterns, existing implementations
- Dependencies and frameworks in use
代码库调研:
- 架构、模式、已有实现
- 当前使用的依赖项及框架
1a. Optional: Stop to Clarification Questions
1a. 可选:暂停并请求澄清
- If the architecture is unclear or missing STOP AND YIELD to the user, and request user input (AskUserQuestions) before moving on. Always offer recommendations for clarification questions.
- If architecture is present, skip 1a and move onto next step.
- 如果架构不清晰或缺失,立即暂停并向用户反馈,请求用户输入(使用AskUserQuestions工具)后再继续。始终提供建议性的澄清问题。
- 如果架构信息完整,跳过步骤1a,进入下一步。
2. Documentation
2. 文档获取
Documentation retrieval (REQUIRED for external dependencies):
Use Context7 skill or MCP to fetch current docs for any libraries/frameworks or APIs that are or will be used in project. If Context7 is not available, use web search.
This ensures version-accurate APIs, correct parameters, and current best practices.
文档检索(外部依赖项必填):
使用Context7技能或MCP获取项目中已用或将要使用的任何库/框架或API的最新文档。如果Context7不可用,使用网页搜索。
这确保使用的API是版本兼容的、参数正确的,并遵循当前最佳实践。
3. STOP and Request User Input
3. 暂停并请求用户输入
When anything is unclear or could reasonably be done multiple ways:
- Stop and ask clarifying questions immediately
- Do not make assumptions about scope, constraints, or priorities
- Questions should reduce risk and eliminate ambiguity
- Always offer recommendations for clarification questions.
- Use request_user_input or AskUserQuestion tool if available.
当任何内容不清晰或存在多种合理实现方式时:
- 立即暂停并提出澄清问题
- 不要对范围、约束或优先级做出假设
- 问题应能降低风险、消除模糊性
- 始终提供建议性的澄清问题
- 如果可用,使用request_user_input或AskUserQuestion工具。
4. Create Dependency-Aware Plan
4. 创建支持依赖关系感知的计划
Structure the plan with explicit task dependencies using this format:
使用以下格式构建具备明确任务依赖关系的计划:
Task Dependency Format
任务依赖格式
Each task MUST include:
- id: Unique identifier (e.g., ,
T1)T2.1 - depends_on: Array of task IDs that must complete first (empty for root tasks)
[] - description: What the task accomplishes
- location: File paths involved
- validation: How to verify completion
Example:
T1: [depends_on: []] Create database schema migration
T2: [depends_on: []] Install required packages
T3: [depends_on: [T1]] Create repository layer
T4: [depends_on: [T1]] Create service interfaces
T5: [depends_on: [T3, T4]] Implement business logic
T6: [depends_on: [T2, T5]] Add API endpoints
T7: [depends_on: [T6]] Write integration testsTasks with empty/satisfied dependencies can run in parallel (T1, T2 above).
每个任务必须包含:
- id:唯一标识符(例如:,
T1)T2.1 - depends_on:必须先完成的任务ID数组(根任务为空数组)
[] - description:任务要完成的内容
- location:涉及的文件路径
- validation:验证任务完成的方式
示例:
T1: [depends_on: []] Create database schema migration
T2: [depends_on: []] Install required packages
T3: [depends_on: [T1]] Create repository layer
T4: [depends_on: [T1]] Create service interfaces
T5: [depends_on: [T3, T4]] Implement business logic
T6: [depends_on: [T2, T5]] Add API endpoints
T7: [depends_on: [T6]] Write integration tests无依赖或依赖已满足的任务可并行执行(如上例中的T1、T2)。
4. Save Plan
4. 保存计划
Save to in the CWD.
<topic>-plan.md保存到当前工作目录下的文件中。
<topic>-plan.md5. Subagent Review
5. 子Agent审核
After saving, spawn a subagent to review the plan:
Review this implementation plan for:
1. Missing dependencies between tasks
2. Ordering issues that would cause failures
3. Missing error handling or edge cases
4. Gaps, holes, gotchas.
Provide specific, actionable feedback. Do not ask questions.
Plan location: [file path]
Context: [brief context about the task]If the subagent provides actionable feedback, revise the plan before yielding.
保存后,启动一个子Agent来审核计划:
Review this implementation plan for:
1. Missing dependencies between tasks
2. Ordering issues that would cause failures
3. Missing error handling or edge cases
4. Gaps, holes, gotchas.
Provide specific, actionable feedback. Do not ask questions.
Plan location: [file path]
Context: [brief context about the task]如果子Agent提供了可执行的反馈,在提交前修订计划。
Plan Template
计划模板
markdown
undefinedmarkdown
undefinedPlan: [Task Name]
Plan: [Task Name]
Generated: [Date]
Generated: [Date]
Overview
Overview
[Summary of task and approach]
[Summary of task and approach]
Prerequisites
Prerequisites
- [Tools, libraries, access needed]
- [Tools, libraries, access needed]
Dependency Graph
Dependency Graph
[Visual representation of task dependencies]
T1 ──┬── T3 ──┐
│ ├── T5 ── T6 ── T7
T2 ──┴── T4 ──┘[Visual representation of task dependencies]
T1 ──┬── T3 ──┐
│ ├── T5 ── T6 ── T7
T2 ──┴── T4 ──┘Tasks
Tasks
T1: [Name]
T1: [Name]
- depends_on: []
- location: [file paths]
- description: [what to do]
- validation: [how to verify]
- status: Not Completed
- log: [leave empty, to be filled out later]
- files edited/created: [leave empty, to be filled out later]
- depends_on: []
- location: [file paths]
- description: [what to do]
- validation: [how to verify]
- status: Not Completed
- log: [leave empty, to be filled out later]
- files edited/created: [leave empty, to be filled out later]
T2: [Name]
T2: [Name]
- depends_on: []
- location: [file paths]
- description: [what to do]
- validation: [how to verify]
- status: Not Completed
- log: [leave empty, to be filled out later]
- files edited/created: [leave empty, to be filled out later]
- depends_on: []
- location: [file paths]
- description: [what to do]
- validation: [how to verify]
- status: Not Completed
- log: [leave empty, to be filled out later]
- files edited/created: [leave empty, to be filled out later]
T3: [Name]
T3: [Name]
- depends_on: [T1]
- location: [file paths]
- description: [what to do]
- validation: [how to verify]
- status: Not Completed
- log: [leave empty, to be filled out later]
- files edited/created: [leave empty, to be filled out later]
[... continue for all tasks ...]
- depends_on: [T1]
- location: [file paths]
- description: [what to do]
- validation: [how to verify]
- status: Not Completed
- log: [leave empty, to be filled out later]
- files edited/created: [leave empty, to be filled out later]
[... continue for all tasks ...]
Parallel Execution Groups
Parallel Execution Groups
| Wave | Tasks | Can Start When |
|---|---|---|
| 1 | T1, T2 | Immediately |
| 2 | T3, T4 | Wave 1 complete |
| 3 | T5 | T3, T4 complete |
| ... | ... | ... |
| Wave | Tasks | Can Start When |
|---|---|---|
| 1 | T1, T2 | Immediately |
| 2 | T3, T4 | Wave 1 complete |
| 3 | T5 | T3, T4 complete |
| ... | ... | ... |
Testing Strategy
Testing Strategy
- [How to test]
- [What to verify]
- [How to test]
- [What to verify]
Risks & Mitigations
Risks & Mitigations
- [What could go wrong + how to handle]
undefined- [What could go wrong + how to handle]
undefinedImportant
重要提示
- Every task must have explicit field
depends_on - Root tasks (no dependencies) can be executed in parallel immediately
- Do NOT implement - only create the plan
- Always use Context7 for external dependencies before finalizing tasks
- Always ask questions where ambiguity exists
- 每个任务必须包含明确的字段
depends_on - 无依赖的根任务可立即并行执行
- 请勿执行实现操作 - 仅创建计划
- 在最终确定任务前,始终使用Context7获取外部依赖项的相关信息
- 当存在模糊点时,务必提问