plan

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Plan Skill

Plan Skill

Quick Ref: Decompose goal into trackable issues with waves. Output:
.agents/plans/*.md
+ bd issues.
YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.
CLI dependencies: bd (issue creation). If bd is unavailable, write the plan to
.agents/plans/
as markdown with issue descriptions, and use TaskList for tracking instead. The plan document is always created regardless of bd availability.
快速参考: 将目标分解为分阶段的可追踪Issue。输出:
.agents/plans/*.md
+ bd议题。
你必须执行此工作流,而非仅进行描述。
CLI依赖: bd(议题创建工具)。如果bd不可用,就将计划写入
.agents/plans/
目录下的markdown文件,包含议题描述,并改用TaskList进行追踪。无论bd是否可用,都必须创建计划文档。

Execution Steps

执行步骤

Given
/plan <goal>
:
当收到指令
/plan <目标>
时:

Step 1: Setup

步骤1:环境准备

bash
mkdir -p .agents/plans
bash
mkdir -p .agents/plans

Step 2: Check for Prior Research

步骤2:检查已有研究

Look for existing research on this topic:
bash
ls -la .agents/research/ 2>/dev/null | head -10
Use Grep to search
.agents/
for related content. If research exists, read it with the Read tool to understand the context before planning.
查找与该主题相关的已有研究:
bash
ls -la .agents/research/ 2>/dev/null | head -10
使用Grep搜索
.agents/
目录下的相关内容。如果存在研究资料,先使用Read工具读取以理解上下文,再进行规划。

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>.md
markdown
undefined
写入位置:
.agents/plans/YYYY-MM-DD-<目标缩写>.md
markdown
undefined

Plan: <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
    /crank
    for autonomous execution
  • Or
    /implement <issue>
    for single issue
undefined
  • 执行
    /crank
    进行自动执行
  • 或执行
    /implement <issue>
    处理单个议题
undefined

Step 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
undefined

Create 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: false
Wait 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:
  1. Plan document location
  2. Number of issues identified
  3. Wave structure for parallel execution
  4. Tasks created (in-session task IDs)
  5. Next step:
    /pre-mortem
    for failure simulation, then
    /crank
    for execution
告知用户:
  1. 计划文档的位置
  2. 识别出的Issue数量
  3. 用于并行执行的阶段结构
  4. 创建的会话内任务(任务ID)
  5. 下一步:执行
    /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/
    目录