plan
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlan Skill
Plan Skill
Quick Ref: Decompose goal into trackable issues with waves. Output:+ bd issues..agents/plans/*.md
YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.
CLI dependencies: bd (issue creation). If bd is unavailable, write the plan to as markdown with issue descriptions, and use TaskList for tracking instead. The plan document is always created regardless of bd availability.
.agents/plans/快速参考: 将目标分解为分阶段的可追踪Issue。输出:+ bd议题。.agents/plans/*.md
你必须执行此工作流,而非仅进行描述。
CLI依赖: bd(议题创建工具)。如果bd不可用,就将计划写入目录下的markdown文件,包含议题描述,并改用TaskList进行追踪。无论bd是否可用,都必须创建计划文档。
.agents/plans/Execution Steps
执行步骤
Given :
/plan <goal>当收到指令时:
/plan <目标>Step 1: Setup
步骤1:环境准备
bash
mkdir -p .agents/plansbash
mkdir -p .agents/plansStep 2: Check for Prior Research
步骤2:检查已有研究
Look for existing research on this topic:
bash
ls -la .agents/research/ 2>/dev/null | head -10Use Grep to search for related content. If research exists, read it with the Read tool to understand the context before planning.
.agents/查找与该主题相关的已有研究:
bash
ls -la .agents/research/ 2>/dev/null | head -10使用Grep搜索目录下的相关内容。如果存在研究资料,先使用Read工具读取以理解上下文,再进行规划。
.agents/Step 3: Explore the Codebase (if needed)
步骤3:探索代码库(如有需要)
USE THE TASK TOOL to dispatch an Explore agent:
Tool: Task
Parameters:
subagent_type: "Explore"
description: "Understand codebase for: <goal>"
prompt: |
Explore the codebase to understand what's needed for: <goal>
1. Find relevant files and modules
2. Understand current architecture
3. Identify what needs to change
Return: key files, current state, suggested approach使用Task工具调度Explore代理:
Tool: Task
Parameters:
subagent_type: "Explore"
description: "理解代码库以支持:<目标>"
prompt: |
探索代码库以了解实现<目标>所需的内容:
1. 找到相关文件和模块
2. 理解当前架构
3. 确定需要修改的部分
返回:关键文件、当前状态、建议方案Step 4: Decompose into Issues
步骤4:分解为Issue
Analyze the goal and break it into discrete, implementable issues. For each issue define:
- Title: Clear action verb (e.g., "Add authentication middleware")
- Description: What needs to be done
- Dependencies: Which issues must complete first (if any)
- Acceptance criteria: How to verify it's done
分析目标并将其拆分为独立的、可落地的Issue。每个Issue需定义:
- 标题:清晰的动作动词(例如:"添加认证中间件")
- 描述:需要完成的内容
- 依赖关系:哪些Issue必须先完成(如有)
- 验收标准:如何验证任务完成
Step 5: Compute Waves
步骤5:划分执行阶段(Waves)
Group issues by dependencies for parallel execution:
- Wave 1: Issues with no dependencies (can run in parallel)
- Wave 2: Issues depending only on Wave 1
- Wave 3: Issues depending on Wave 2
- Continue until all issues assigned
按依赖关系对Issue进行分组以支持并行执行:
- Wave 1:无依赖的Issue(可并行执行)
- Wave 2:仅依赖Wave 1的Issue
- Wave 3:依赖Wave 2的Issue
- 以此类推,直到所有Issue都被分配到对应阶段
Step 6: Write Plan Document
步骤6:编写计划文档
Write to:
.agents/plans/YYYY-MM-DD-<goal-slug>.mdmarkdown
undefined写入位置:
.agents/plans/YYYY-MM-DD-<目标缩写>.mdmarkdown
undefinedPlan: <Goal>
计划:<目标>
Date: YYYY-MM-DD
Source: <research doc if any>
日期: YYYY-MM-DD
参考来源: <研究文档(如有)>
Overview
概述
<1-2 sentence summary of what we're building>
<1-2句话总结要构建的内容>
Issues
议题列表
Issue 1: <Title>
Issue 1:<标题>
Dependencies: None
Acceptance: <how to verify>
Description: <what to do>
依赖关系: 无
验收标准: <验证方式>
描述: <需要完成的内容>
Issue 2: <Title>
Issue 2:<标题>
Dependencies: Issue 1
Acceptance: <how to verify>
Description: <what to do>
依赖关系: Issue 1
验收标准: <验证方式>
描述: <需要完成的内容>
Execution Order
执行顺序
Wave 1 (parallel): Issue 1, Issue 3
Wave 2 (after Wave 1): Issue 2, Issue 4
Wave 3 (after Wave 2): Issue 5
Wave 1(并行执行):Issue 1、Issue 3
Wave 2(Wave 1完成后):Issue 2、Issue 4
Wave 3(Wave 2完成后):Issue 5
Next Steps
后续步骤
- Run for autonomous execution
/crank - Or for single issue
/implement <issue>
undefined- 执行进行自动执行
/crank - 或执行处理单个议题
/implement <issue>
undefinedStep 7: Create Tasks for In-Session Tracking
步骤7:创建会话内追踪任务
Use TaskCreate tool for each issue:
Tool: TaskCreate
Parameters:
subject: "<issue title>"
description: |
<Full description including:>
- What to do
- Acceptance criteria
- Dependencies: [list task IDs that must complete first]
activeForm: "<-ing verb form of the task>"After creating all tasks, set up dependencies:
Tool: TaskUpdate
Parameters:
taskId: "<task-id>"
addBlockedBy: ["<dependency-task-id>"]IMPORTANT: Create persistent issues for ratchet tracking:
If bd CLI available, create beads issues to enable progress tracking across sessions:
bash
undefined使用TaskCreate工具为每个Issue创建任务:
Tool: TaskCreate
Parameters:
subject: "<issue标题>"
description: |
<完整描述包含:>
- 需要完成的内容
- 验收标准
- 依赖关系:[必须先完成的任务ID列表]
activeForm: "<任务的现在进行时动词形式>"创建所有任务后,设置依赖关系:
Tool: TaskUpdate
Parameters:
taskId: "<任务ID>"
addBlockedBy: ["<依赖任务ID>"]重要提示:创建持久化议题以支持进度追踪:
如果bd CLI可用,创建beads议题以支持跨会话的进度追踪:
bash
undefinedCreate epic first
先创建史诗级议题
bd create --title "<goal>" --type epic --label "planned"
bd create --title "<目标>" --type epic --label "planned"
Create child issues (note the IDs returned)
创建子议题(记录返回的ID)
bd create --title "<wave-1-task>" --body "<description>" --parent <epic-id> --label "planned"
bd create --title "<Wave 1任务>" --body "<描述>" --parent <史诗级议题ID> --label "planned"
Returns: na-0001
返回:na-0001
bd create --title "<wave-2-task-depends-on-wave-1>" --body "<description>" --parent <epic-id> --label "planned"
bd create --title "<依赖Wave 1的Wave 2任务>" --body "<描述>" --parent <史诗级议题ID> --label "planned"
Returns: na-0002
返回:na-0002
Add blocking dependencies to form waves
添加阻塞依赖以划分执行阶段
bd dep add na-0001 na-0002
bd dep add na-0001 na-0002
Now na-0002 is blocked by na-0001 → Wave 2
现在na-0002被na-0001阻塞 → 属于Wave 2
**Waves are formed by `blocks` dependencies:**
- Issues with NO blockers → Wave 1 (appear in `bd ready` immediately)
- Issues blocked by Wave 1 → Wave 2 (appear when Wave 1 closes)
- Issues blocked by Wave 2 → Wave 3 (appear when Wave 2 closes)
**`bd ready` returns the current wave** - all unblocked issues that can run in parallel.
Without bd issues, the ratchet validator cannot track gate progress. This is required for `/crank` autonomous execution and `/post-mortem` validation.
**通过`blocks`依赖关系划分执行阶段:**
- 无阻塞的Issue → Wave 1(会立即出现在`bd ready`结果中)
- 被Wave 1阻塞的Issue → Wave 2(Wave 1完成后出现)
- 被Wave 2阻塞的Issue → Wave 3(Wave 2完成后出现)
**`bd ready`返回当前可执行阶段** - 所有未被阻塞、可并行执行的议题。
如果没有bd议题,ratchet验证器无法追踪阶段进度,这是`/crank`自动执行和`/post-mortem`验证的必要条件。Step 8: Request Human Approval (Gate 2)
步骤8:请求人工审批(第二阶段闸门)
USE AskUserQuestion tool:
Tool: AskUserQuestion
Parameters:
questions:
- question: "Plan complete with N tasks in M waves. Approve to proceed?"
header: "Gate 2"
options:
- label: "Approve"
description: "Proceed to /pre-mortem or /crank"
- label: "Revise"
description: "Modify the plan before proceeding"
- label: "Back to Research"
description: "Need more research before planning"
multiSelect: falseWait for approval before reporting completion.
使用AskUserQuestion工具:
Tool: AskUserQuestion
Parameters:
questions:
- question: "计划已完成,包含M个阶段共N个任务。是否批准继续?"
header: "第二阶段闸门"
options:
- label: "批准"
description: "继续执行/pre-mortem或/crank"
- label: "修改"
description: "先修改计划再继续"
- label: "返回研究阶段"
description: "需要更多研究再进行规划"
multiSelect: false等待审批完成后再向用户报告完成状态。
Step 9: Report to User
步骤9:向用户报告
Tell the user:
- Plan document location
- Number of issues identified
- Wave structure for parallel execution
- Tasks created (in-session task IDs)
- Next step: for failure simulation, then
/pre-mortemfor execution/crank
告知用户:
- 计划文档的位置
- 识别出的Issue数量
- 用于并行执行的阶段结构
- 创建的会话内任务(任务ID)
- 下一步:执行进行故障模拟,然后执行
/pre-mortem开始执行/crank
Key Rules
核心规则
- Read research first if it exists
- Explore codebase to understand current state
- Identify dependencies between issues
- Compute waves for parallel execution
- Always write the plan to
.agents/plans/
- 优先读取研究资料(如果存在)
- 探索代码库以了解当前状态
- 识别Issue之间的依赖关系
- 划分执行阶段以支持并行执行
- 始终将计划写入目录
.agents/plans/