Prerequisite Protocol
Mandatory Trigger Rules
Trigger Timing: After prompt-enhancer completes requirement refinement (mandatory)
Trigger Conditions:
- ✅ Clear requirements and solution already exist
- ✅ Implementation planning and step breakdown are needed
- ✅ Complex task (requires multiple steps to complete)
Exceptions:
- Simple task (can be completed in a single step)
- User explicitly states "start directly"
Dependency Check
Prerequisite Dependencies:prompt-enhancer
Check Content:
- Check artifact file:
memory/artifacts/prompt-enhancer/ - Confirm that clear requirements and a selected solution already exist
- If there is no prerequisite artifact, prompt-enhancer must be executed first
Collaboration with goal-oriented
Trigger Source: Mandatory invocation by goal-oriented skill
Trigger Flow:
goal-oriented 创建目标
↓
调用 prompt-enhancer(需求细化)
↓
生成需求方案工件
↓
调用 planning(实施规划)
↓
读取需求方案工件 → 生成实施计划 → plan-review
↓
生成实施计划工件
↓
传递给 execution 阶段
↓
任务完成后 → experience-manager 经验沉淀
Artifact Reception:
- goal-oriented will write the artifact to
memory/artifacts/prompt-enhancer/ - planning automatically detects and reads the latest artifact
Artifact Transfer Mechanism
Input Artifact (from prompt-enhancer)
Artifact Path: memory/artifacts/prompt-enhancer/result-{timestamp}.json
Artifact Format:
{
"skill": "prompt-enhancer",
"version": "2.0.0",
"requirement": {
"original": "用户原始需求",
"refined": {
"type": "功能开发|重构|优化",
"core_features": ["功能1", "功能2"],
"target_users": "目标用户",
"platform": "平台",
"tech_stack": ["技术1", "技术2"],
"success_criteria": ["标准1", "标准2"],
"timeline": "时间线"
}
},
"solution": {
"selected": "选定方案",
"reasons": ["理由1", "理由2"],
"alternatives": [
{
"name": "备选方案1",
"pros": ["优势"],
"cons": ["劣势"]
}
]
}
}
Read Method:
# 自动检测最新的 prompt-enhancer 工件
PROMPT_ENHANCER_ARTIFACT=$(ls -t memory/artifacts/prompt-enhancer/*.json | grep -v latest.json | head -1)
if [ -n "$PROMPT_ENHANCER_ARTIFACT" ]; then
echo "✅ Found prompt-enhancer artifact: $PROMPT_ENHANCER_ARTIFACT"
# Read artifact content using Read tool
else
echo "❌ No prompt-enhancer artifact found"
echo "⚠️ Must execute prompt-enhancer before planning"
fi
Output Artifact (passed to subsequent skills)
Artifact Path: memory/artifacts/planning/result-{timestamp}.json
Artifact Format: See "Step 8: Generate Artifact"
Transfer Mechanism:
- Create artifact file
- Create latest.json symbolic link
- Subsequent skills can automatically detect latest.json
Overview
planning is a mandatory prerequisite skill, responsible forimplementation planningandstep breakdown. It transforms clear requirements and solutions into executable implementation plans, ensures plan feasibility through plan-review, and reduces execution risk.
Core Capabilities:
- Step Breakdown: Break down requirements into executable steps
- Dependency Identification: Identify dependencies between steps
- Resource Planning: Clarify required resources and time
- Risk Assessment: Identify potential risks and countermeasures
- plan-review: User confirms the implementation plan
Core Principle: Plan before acting; planning comes first. A good plan is half the success.
Key Value:
- Clarify the execution path and avoid blind action
- Identify dependencies and arrange the order reasonably
- Assess risks in advance and prepare countermeasures
- User confirms the plan to ensure consistent understanding
When to Use
Mandatory Usage Scenarios:
- After prompt-enhancer is completed
- Requirements are clear and the solution has been selected
- The task requires multiple steps to complete
Non-Usage Scenarios:
- Simple task (can be completed in a single step)
- User explicitly states "start directly"
- A detailed implementation plan already exists
The Process
digraph planning_process {
rankdir=TB;
"接收需求方案工件" [shape=box, style=filled, fillcolor="#c8e6c9"];
"步骤分解" [shape=box, style=filled, fillcolor="#bbdefb"];
"依赖识别" [shape=box, style=filled, fillcolor="#fff9c4"];
"资源规划" [shape=box, style=filled, fillcolor="#ff9800"];
"风险评估" [shape=box, style=filled, fillcolor="#ff9800"];
"生成实施计划" [shape=box, style=filled, fillcolor="#f8bbd0"];
"plan-review" [shape=diamond, style=filled, fillcolor="#e1bee7"];
"用户确认" [shape=diamond, style=filled, fillcolor="#e1bee7"];
"调整计划" [shape=box, style=filled, fillcolor="#f8bbd0"];
"生成工件" [shape=box, style=filled, fillcolor="#81c784"];
"传递给执行技能" [shape=doublecircle, style=filled, fillcolor="#81c784"];
"接收需求方案工件" -> "步骤分解";
"步骤分解" -> "依赖识别";
"依赖识别" -> "资源规划";
"资源规划" -> "风险评估";
"风险评估" -> "生成实施计划";
"生成实施计划" -> "plan-review";
"plan-review" -> "用户确认";
"用户确认" -> "调整计划" [label="需调整"];
"用户确认" -> "生成工件" [label="确认"];
"调整计划" -> "生成实施计划";
"生成工件" -> "传递给执行技能";
}
Step 1: Receive Requirement Solution Artifact
Read the artifact from the prerequisite skill prompt-enhancer:
// memory/artifacts/prompt-enhancer/result-{timestamp}.json
{
"requirement": {
"original": "做一个用户认证功能",
"refined": { ... }
},
"solution": {
"selected": "方案2:微信云开发",
"reasons": [ ... ]
}
}
Step 2: Step Breakdown
Break down requirements into executable implementation steps
Breakdown Principles
MECE Principle: Mutually exclusive, collectively exhaustive
- Each step is independent and non-overlapping
- All steps together cover the complete requirements
Granularity control:
- Each step can be completed in 0.5-2 days
- Steps are not too fine-grained (avoid over-planning)
- Steps are not too coarse (avoid ambiguity)
Decomposition methods
Method 1: Decompose by functional module
用户认证功能
├─ 注册模块
│ ├─ 步骤1:实现手机验证码发送
│ └─ 步骤2:实现注册流程
├─ 登录模块
│ ├─ 步骤3:实现手机验证码登录
│ └─ 步骤4:实现微信OAuth
└─ 找回密码模块
└─ 步骤5:实现找回密码流程
Method 2: Decompose by chronological order
Week 1: 基础功能
├─ Day 1-2:环境配置 + 验证码发送
├─ Day 3-4:注册登录流程
└─ Day 5:找回密码
Week 2: 优化测试
├─ Day 1-2:测试与Bug修复
├─ Day 3-4:性能优化
└─ Day 5:上线准备
Method 3: Decompose by technical layer
前端
├─ 步骤1:登录UI组件
├─ 步骤2:表单验证
└─ 步骤3:API对接
后端
├─ 步骤4:云函数开发
├─ 步骤5:数据库设计
└─ 步骤6:第三方集成
Step 3: Dependency identification
Identify dependencies between steps
Dependency types
| Dependency type | Description | Example |
|---|---|---|
| Strong dependency | The prerequisite step must be completed first | Registration → Login |
| Weak dependency | Best to complete first, but can be done in parallel | UI design ↔ API design |
| No dependency | Can be executed independently | Documentation writing |
Dependency graph example
步骤1:环境配置
↓
步骤2:验证码发送
↓
┌─────────┴─────────┐
↓ ↓
步骤3:注册流程 步骤4:登录流程
↓ ↓
└─────────┬─────────┘
↓
步骤5:找回密码
↓
步骤6:测试上线
Step 4: Resource planning
Clarify the resources required for each step
Resource dimensions
Human resources:
- Who will execute it? (Frontend, backend, testing)
- How many people are needed?
- Is collaboration needed?
Time resources:
- How long is each step expected to take?
- Overall timeline?
- Key time milestones?
Technical resources:
- What tech stack is needed?
- Are third-party services needed?
- Are new tools needed?
Financial resources:
- Are there costs? (Cloud services, SMS services)
- Budget constraints?
Resource planning table
| Step | Personnel | Time | Technology | Cost |
|---|---|---|---|---|
| Environment setup | 1 person | 0.5 days | WeChat Developer Tools | None |
| Verification code sending | 1 person | 1 day | Alibaba Cloud SMS Service | ~¥0.05/message |
| Registration flow | 1 person | 2 days | Cloud development, cloud functions | None |
| Login flow | 1 person | 2 days | OAuth、JWT | None |
| Password recovery | 1 person | 1 day | - | None |
| Testing and launch | 1 person | 1.5 days | - | None |
Step 5: Risk assessment
Identify potential risks and countermeasures
Risk types
| Risk type | Risk description | Probability | Impact | Countermeasures |
|---|---|---|---|---|
| Technical risk | Complexity of WeChat OAuth integration | Medium | High | Study the documentation in advance, reserve buffer |
| Time Risk | SMS service review time | High | Medium | Apply in advance and prepare a backup plan |
| Cost Risk | SMS costs exceed budget | Low | Low | Set sending frequency limits |
| Integration Risk | Difficulty integrating with existing systems | Medium | High | Prioritize researching existing system interfaces |
Risk Matrix
影响 ↑
高 │ [OAuth集成] [系统对接]
│ 中风险 高风险
中 │ [审核时间] [成本超支]
│ 中风险 低风险
低 │
└──────────────────────→ 概率
低 中 高
Step 6: Generate Implementation Plan
Integrate all content to generate a complete implementation plan
Implementation Plan Template
# 实施计划
## 基本信息
- **项目名称**: 用户认证系统
- **目标**: 实现注册、登录、找回密码功能
- **时间线**: 2周(10个工作日)
- **团队**: 1人(全栈)
---
## 实施步骤
### Phase 1: 环境准备(Day 1)
#### 步骤1:环境配置
**目标**: 搭建开发环境
**任务**:
- [ ] 创建微信小程序项目
- [ ] 配置云开发环境
- [ ] 初始化云数据库
- [ ] 配置项目目录结构
**产出**:
- 可运行的云开发项目框架
- 数据库表结构
**依赖**: 无
**风险**: 无
---
### Phase 2: 核心功能(Day 2-6)
#### 步骤2:验证码发送(Day 2)
**目标**: 实现手机验证码发送功能
**任务**:
- [ ] 申请阿里云短信服务
- [ ] 开发云函数:send-code
- [ ] 前端调用接口
- [ ] 测试验证码发送
**产出**:
- send-code 云函数
- 前端调用封装
**依赖**: 步骤1
**风险**: 短信服务审核(应对:提前申请)
---
#### 步骤3:注册流程(Day 3-4)
**目标**: 实现用户注册功能
**任务**:
- [ ] 设计注册UI(手机号、验证码、密码)
- [ ] 开发云函数:register
- [ ] 表单验证逻辑
- [ ] 数据存储
- [ ] 测试注册流程
**产出**:
- 注册页面
- register 云函数
- 用户数据表
**依赖**: 步骤2
**风险**: 无
---
#### 步骤4:登录流程(Day 5-6)
**目标**: 实现手机验证码和微信OAuth登录
**任务**:
- [ ] 设计登录UI
- [ ] 开发云函数:login(验证码登录)
- [ ] 开发云函数:wechat-login(OAuth)
- [ ] Token生成与存储
- [ ] 测试登录流程
**产出**:
- 登录页面
- login 和 wechat-login 云函数
- Token管理
**依赖**: 步骤3
**风险**: 微信OAuth集成复杂度(应对:预留buffer)
---
### Phase 3: 补充功能(Day 7-8)
#### 步骤5:找回密码(Day 7-8)
**目标**: 实现找回密码功能
**任务**:
- [ ] 设计找回密码UI
- [ ] 开发云函数:reset-password
- [ ] 验证码验证
- [ ] 密码重置逻辑
- [ ] 测试找回密码流程
**产出**:
- 找回密码页面
- reset-password 云函数
**依赖**: 步骤2
**风险**: 无
---
### Phase 4: 测试上线(Day 9-10)
#### 步骤6:测试与优化(Day 9)
**目标**: 全面测试,修复Bug
**任务**:
- [ ] 功能测试(注册、登录、找回密码)
- [ ] 边界测试(验证码过期、错误处理)
- [ ] 性能测试(响应时间、并发)
- [ ] Bug修复
**产出**:
- 测试报告
- Bug修复清单
**依赖**: 步骤5
**风险**: 发现重大Bug(应对:预留1天buffer)
---
#### 步骤7:上线准备(Day 10)
**目标**: 准备上线,文档完善
**任务**:
- [ ] 代码审查
- [ ] 性能优化
- [ ] 文档编写
- [ ] 提交审核
**产出**:
- 完整代码
- 技术文档
- 用户手册
**依赖**: 步骤6
**风险**: 审核不通过(应对:提前了解审核规范)
---
## 依赖关系图
Step 1: Environment Configuration ↓ Step 2: Verification Code Sending ↓ ┌─────────┴─────────┐ ↓ ↓ Step 3: Registration Flow Step 4: Login Flow ↓ ↓ └─────────┬─────────┘ ↓ Step 5: Password Recovery ↓ Step 6: Testing ↓ Step 7: Launch
---
## 资源规划
| 步骤 | 人员 | 时间 | 关键技术 |
|------|------|------|---------|
| 环境配置 | 1人 | 0.5天 | 微信开发者工具 |
| 验证码发送 | 1人 | 1天 | 阿里云短信 |
| 注册流程 | 1人 | 2天 | 云开发 |
| 登录流程 | 1人 | 2天 | OAuth、JWT |
| 找回密码 | 1人 | 1天 | - |
| 测试 | 1人 | 1天 | - |
| 上线 | 1人 | 0.5天 | - |
**总计**: 1人 × 10天
---
## 风险与应对
| 风险 | 概率 | 影响 | 应对措施 |
|------|------|------|---------|
| 短信服务审核 | 高 | 中 | 提前申请,准备备选方案 |
| OAuth集成复杂 | 中 | 高 | 提前研究文档,预留buffer |
| 系统对接困难 | 中 | 高 | 优先调研现有系统 |
| 发现重大Bug | 低 | 高 | 预留1天buffer |
---
## 关键里程碑
- **Day 1**: 环境准备完成
- **Day 4**: 注册功能完成
- **Day 6**: 登录功能完成
- **Day 8**: 所有功能开发完成
- **Day 10**: 测试通过,提交审核
---
## 成功标准
- ✅ 注册、登录、找回密码功能完整
- ✅ 登录响应时间 < 2秒
- ✅ 无P0/P1级Bug
- ✅ 通过微信审核
Step 7: plan-review (mandatory)
plan-review It is a mandatory step to ensure the implementation plan is confirmed by the user
plan-review process
Present the plan:
## 📋 实施计划已完成
### 核心内容
- **总时长**: 10个工作日
- **步骤数**: 7个步骤
- **关键里程碑**: 4个
- **风险点**: 4个
### 关键步骤
1. 环境配置(Day 1)
2. 验证码发送(Day 2)
3. 注册流程(Day 3-4)
4. 登录流程(Day 5-6)
5. 找回密码(Day 7-8)
6. 测试(Day 9)
7. 上线(Day 10)
### 潜在风险
⚠️ 短信服务审核时间
⚠️ 微信OAuth集成复杂度
---
**请确认实施计划:**
- A) ✅ 确认,开始执行
- B) 需要调整(请说明具体问题)
- C) 需要重新规划
After user confirmation:
- ✅ User confirms → generate artifact, pass to subsequent skills
- ❌ User requests adjustments → adjust the plan based on feedback
- ❌ User requests replanning → re-execute planning
plan-review tool call (AskUserQuestion)
Use the AskUserQuestion tool to present the plan and obtain user confirmation:
AskUserQuestion(
questions=[
{
"question": "实施计划已完成,请确认是否开始执行?",
"header": "计划确认",
"options": [
{
"label": "✅ 确认,开始执行",
"description": "同意实施计划,生成工件并传递给后续技能"
},
{
"label": "需要调整",
"description": "对部分步骤有疑问,需要修改计划(请说明具体问题)"
},
{
"label": "重新规划",
"description": "对整体方案不满意,需要重新分解步骤"
}
],
"multiSelect": false
}
]
)
User response handling:
- User selects "✅ Confirm" → generate artifact, pass to subsequent skills
- User selects "Needs adjustment" → modify the plan based on user feedback
- User selects "Replan" → re-execute the planning process
Step 8: Generate Artifact
Create the artifact file and pass it to subsequent skills:
{
"skill": "planning",
"version": "1.0.0",
"timestamp": "2026-03-25T10:30:00Z",
"project": {
"name": "用户认证系统",
"goal": "实现注册、登录、找回密码功能",
"timeline": "2周(10个工作日)",
"team": "1人(全栈)"
},
"implementation_plan": {
"phases": [
{
"name": "Phase 1: 环境准备",
"steps": [
{
"id": 1,
"name": "环境配置",
"duration": "0.5天",
"tasks": ["创建小程序项目", "配置云开发", "初始化数据库"],
"dependencies": [],
"risks": []
}
]
},
{
"name": "Phase 2: 核心功能",
"steps": [
{
"id": 2,
"name": "验证码发送",
"duration": "1天",
"tasks": ["申请短信服务", "开发send-code云函数", "前端调用"],
"dependencies": [1],
"risks": ["短信服务审核"]
},
{
"id": 3,
"name": "注册流程",
"duration": "2天",
"tasks": ["设计UI", "开发register云函数", "表单验证"],
"dependencies": [2],
"risks": []
}
]
}
],
"dependencies_graph": {
"1": [],
"2": [1],
"3": [2],
"4": [2, 3],
"5": [2],
"6": [5],
"7": [6]
},
"total_steps": 7,
"total_duration": "10天"
},
"resource_plan": {
"human": {
"team_size": 1,
"roles": ["全栈开发"]
},
"time": {
"total_days": 10,
"start_date": "2026-03-25",
"end_date": "2026-04-07"
},
"technology": [
"微信小程序",
"云开发",
"阿里云短信",
"OAuth",
"JWT"
],
"cost": {
"短信服务": "~¥0.05/条",
"云开发": "免费额度"
}
},
"risk_assessment": [
{
"risk": "短信服务审核时间",
"probability": "high",
"impact": "medium",
"mitigation": "提前申请,准备备选方案"
},
{
"risk": "微信OAuth集成复杂度",
"probability": "medium",
"impact": "high",
"mitigation": "提前研究文档,预留buffer"
}
],
"milestones": [
{"day": 1, "name": "环境准备完成"},
{"day": 4, "name": "注册功能完成"},
{"day": 6, "name": "登录功能完成"},
{"day": 8, "name": "所有功能开发完成"},
{"day": 10, "name": "测试通过,提交审核"}
],
"review_status": "confirmed",
"next_skills": ["experience-manager"]
}
Planning Methodology
WBS Work Breakdown Structure
Work Breakdown Structure:
项目
├─ 阶段1
│ ├─ 任务1.1
│ ├─ 任务1.2
│ └─ 任务1.3
├─ 阶段2
│ ├─ 任务2.1
│ └─ 任务2.2
└─ 阶段3
├─ 任务3.1
└─ 任务3.2
Critical Path Method (CPM)
Identify the critical path that affects the total duration:
环境配置(0.5天) → 验证码(1天) → 注册(2天) → 登录(2天) → 测试(1天) → 上线(0.5天)
↓
找回密码(1天)
Critical Path: Environment → Verification Code → Registration → Login → Testing → Launch = 7 days
Risk Management Framework
Identify → Assess → Respond → Monitor
- Identify: List all potential risks
- Assess: Probability × Impact
- Respond: Avoid, transfer, mitigate, accept
- Monitor: Regularly check risk status
Examples
Case 1: Feature Development Planning (Complete Tool Call Process)
User requirement: Implement search functionality
Complete Execution Process:
Step 1: Read prompt-enhancer artifact
# 使用 Bash 检测最新工件
ls -t memory/artifacts/prompt-enhancer/*.json | grep -v latest.json | head -1
# 输出:memory/artifacts/prompt-enhancer/result-20260325-103000.json
# 使用 Read 工具读取工件
Read(
file_path="memory/artifacts/prompt-enhancer/result-20260325-103000.json"
)
# 提取需求信息
{
"skill": "prompt-enhancer",
"version": "2.0.0",
"requirement": {
"original": "实现搜索功能",
"refined": {
"type": "功能开发",
"core_features": ["关键词搜索", "结果排序", "搜索历史"],
"target_users": "普通用户",
"platform": "小程序",
"tech_stack": ["云开发", "云函数"],
"success_criteria": ["搜索响应<2秒", "结果准确率>90%"],
"timeline": "1周"
}
},
"solution": {
"selected": "方案2:云开发数据库搜索",
"reasons": ["成本低", "维护简单", "数据量适中"],
"alternatives": [
{
"name": "方案1:数据库LIKE查询",
"pros": ["实现简单"],
"cons": ["性能差,适合<1万条"]
},
{
"name": "方案3:Algolia托管服务",
"pros": ["功能强大", "响应快"],
"cons": ["成本高", "需要集成"]
}
]
}
}
Step 2: Step decomposition (MECE principle)
Decompose into executable implementation steps:
# 实施计划
## 基本信息
- **项目名称**: 搜索功能
- **目标**: 实现关键词搜索、结果排序、搜索历史
- **时间线**: 1周(5个工作日)
- **团队**: 1人(全栈)
---
## 实施步骤
### Phase 1: 需求确认(Day 1)
#### 步骤1: 需求确认与技术选型
**目标**: 确认搜索范围和技术方案
**任务**:
- [ ] 确认搜索范围(标题、内容、标签)
- [ ] 确认搜索方式(模糊、精确)
- [ ] 确认数据量(预计多少条记录)
- [ ] 最终确认技术方案(云开发数据库搜索)
**产出**:
- 需求确认文档
- 技术选型确认
**依赖**: 无
**风险**: 数据量未知(应对:先调研现有数据量)
---
### Phase 2: 后端开发(Day 2-3)
#### 步骤2: 后端API开发
**目标**: 实现搜索API
**任务**:
- [ ] 开发云函数:search
- [ ] 实现搜索逻辑(模糊匹配、排序)
- [ ] 实现搜索历史记录
- [ ] 测试搜索API
**产出**:
- search 云函数
- API文档
**依赖**: 步骤1
**风险**: 搜索性能不达标(应对:提前测试性能)
---
### Phase 3: 前端开发(Day 3-4)
#### 步骤3: 前端UI开发
**目标**: 实现搜索界面
**任务**:
- [ ] 设计搜索框UI
- [ ] 实现搜索结果列表
- [ ] 实现加载状态和空状态
- [ ] 实现搜索历史展示
- [ ] API对接
**产出**:
- 搜索页面
- 搜索历史组件
**依赖**: 步骤2
**风险**: 无
---
### Phase 4: 测试上线(Day 5)
#### 步骤4: 测试与优化
**目标**: 全面测试,修复Bug
**任务**:
- [ ] 功能测试(搜索、排序、历史)
- [ ] 性能测试(响应时间)
- [ ] 边界测试(空搜索、特殊字符)
- [ ] Bug修复
- [ ] 上线准备
**产出**:
- 测试报告
- 上线代码
**依赖**: 步骤3
**风险**: 发现重大Bug(应对:预留buffer)
---
## 依赖关系图
Step 1: Requirement Confirmation ↓ Step 2: Backend Development ↓ Step 3: Frontend Development ↓ Step 4: Testing and Launch
---
## 资源规划
| 步骤 | 人员 | 时间 | 关键技术 |
|------|------|------|---------|
| 需求确认 | 1人 | 1天 | - |
| 后端开发 | 1人 | 2天 | 云开发、云函数 |
| 前端开发 | 1人 | 2天 | 小程序UI |
| 测试上线 | 1人 | 1天 | - |
**总计**: 1人 × 5天
---
## 风险与应对
| 风险 | 概率 | 影响 | 应对措施 |
|------|------|------|---------|
| 数据量未知 | 高 | 中 | 先调研现有数据量 |
| 搜索性能不达标 | 中 | 高 | 提前测试性能 |
| 发现重大Bug | 低 | 高 | 预留buffer |
---
## 关键里程碑
- **Day 1**: 需求确认完成
- **Day 3**: 后端API完成
- **Day 4**: 前端UI完成
- **Day 5**: 测试通过,准备上线
---
## 成功标准
- ✅ 搜索响应时间 < 2秒
- ✅ 搜索结果准确率 > 90%
- ✅ 搜索历史功能正常
- ✅ 无P0/P1级Bug
Step 3: plan-review (using AskUserQuestion)
AskUserQuestion(
questions=[
{
"question": "实施计划已完成,请确认是否开始执行?",
"header": "计划确认",
"options": [
{
"label": "✅ 确认,开始执行",
"description": "同意实施计划,生成工件并传递给后续技能"
},
{
"label": "需要调整",
"description": "对部分步骤有疑问,需要修改计划"
},
{
"label": "重新规划",
"description": "对整体方案不满意,需要重新分解"
}
],
"multiSelect": false
}
]
)
# 用户选择:✅ 确认,开始执行
Step 4: Generate artifact (using Write)
Write(
file_path="memory/artifacts/planning/result-20260325-104500.json",
content={
"skill": "planning",
"version": "2.0.0",
"timestamp": "2026-03-25T10:45:00Z",
"project": {
"name": "搜索功能",
"goal": "实现关键词搜索、结果排序、搜索历史",
"timeline": "1周(5个工作日)",
"team": "1人(全栈)"
},
"implementation_plan": {
"phases": [
{
"name": "Phase 1: 需求确认",
"steps": [
{
"id": 1,
"name": "需求确认与技术选型",
"duration": "1天",
"tasks": ["确认搜索范围", "确认搜索方式", "确认数据量", "确认技术方案"],
"dependencies": [],
"risks": ["数据量未知"]
}
]
},
{
"name": "Phase 2: 后端开发",
"steps": [
{
"id": 2,
"name": "后端API开发",
"duration": "2天",
"tasks": ["开发search云函数", "实现搜索逻辑", "实现搜索历史", "测试API"],
"dependencies": [1],
"risks": ["搜索性能不达标"]
}
]
},
{
"name": "Phase 3: 前端开发",
"steps": [
{
"id": 3,
"name": "前端UI开发",
"duration": "2天",
"tasks": ["设计搜索框UI", "实现搜索结果列表", "实现搜索历史展示", "API对接"],
"dependencies": [2],
"risks": []
}
]
},
{
"name": "Phase 4: 测试上线",
"steps": [
{
"id": 4,
"name": "测试与优化",
"duration": "1天",
"tasks": ["功能测试", "性能测试", "边界测试", "Bug修复", "上线准备"],
"dependencies": [3],
"risks": ["发现重大Bug"]
}
]
}
],
"dependencies_graph": {
"1": [],
"2": [1],
"3": [2],
"4": [3]
},
"total_steps": 4,
"total_duration": "5天"
},
"resource_plan": {
"human": {
"team_size": 1,
"roles": ["全栈开发"]
},
"time": {
"total_days": 5,
"start_date": "2026-03-25",
"end_date": "2026-03-29"
},
"technology": ["小程序", "云开发", "云函数"],
"cost": {
"云开发": "免费额度"
}
},
"risk_assessment": [
{
"risk": "数据量未知",
"probability": "high",
"impact": "medium",
"mitigation": "先调研现有数据量"
},
{
"risk": "搜索性能不达标",
"probability": "medium",
"impact": "high",
"mitigation": "提前测试性能"
},
{
"risk": "发现重大Bug",
"probability": "low",
"impact": "high",
"mitigation": "预留buffer"
}
],
"milestones": [
{"day": 1, "name": "需求确认完成"},
{"day": 3, "name": "后端API完成"},
{"day": 4, "name": "前端UI完成"},
{"day": 5, "name": "测试通过,准备上线"}
],
"success_criteria": [
"搜索响应时间 < 2秒",
"搜索结果准确率 > 90%",
"搜索历史功能正常",
"无P0/P1级Bug"
],
"review_status": "confirmed",
"next_skills": ["experience-manager"]
}
)
# 创建 latest.json 符号链接
ln -sf memory/artifacts/planning/result-20260325-104500.json memory/artifacts/planning/latest.json
Result: The complete tool invocation process, from reading artifacts to generating artifacts, demonstrating the actual execution process of the planning skill.
Case 2: Architecture Refactoring Planning
Requirement: Implement search functionality
Planning Result:
## 实施计划
### 步骤分解
1. 需求确认(0.5天)
- 确认搜索范围(标题、内容、标签?)
- 确认搜索方式(模糊、精确?)
2. 技术选型(0.5天)
- 方案1:数据库LIKE查询(适合<1万条)
- 方案2:Elasticsearch(适合>10万条)
- 方案3:Algolia(托管服务,快速集成)
3. 后端开发(2天)
- 搭建搜索API
- 实现搜索逻辑
- 性能优化
4. 前端开发(2天)
- 搜索框UI
- 结果展示
- 交互优化
5. 测试上线(1天)
- 功能测试
- 性能测试
- Bug修复
**总时长**: 6天
**风险**: 数据量未知(应对:先调研数据量)
Case 2: Architecture Refactoring Planning
Requirement: Microservice decomposition
Planning Result:
## 实施计划
### Phase 1: 调研设计(Week 1)
- 服务边界划分
- API设计
- 数据库拆分方案
### Phase 2: 基础设施(Week 2)
- 容器化
- 服务注册发现
- 配置中心
### Phase 3: 核心服务拆分(Week 3-4)
- 用户服务
- 订单服务
- 商品服务
### Phase 4: 测试迁移(Week 5)
- 集成测试
- 性能测试
- 灰度迁移
**总时长**: 5周
**风险**: 数据迁移(应对:制定详细迁移方案)
Common Pitfalls
Pitfall 1: Skipping planning and executing directly
Manifestation: Starting to write code directly once the requirements are clear Correct Approach: Enforce planning and generate an implementation plan
Pitfall 2: The plan is too coarse
Manifestation: The plan has only two steps, "development" and "testing" Correct Approach: Break it down to a granularity of 0.5-2 days
Pitfall 3: Ignoring dependencies
Manifestation: Executing dependent tasks in parallel, causing rework Correct Approach: Clarify dependencies and arrange the order reasonably
Pitfall 4: Not identifying risks
Manifestation: There is no risk assessment in the plan Correct Approach: Identify potential risks for every step
Pitfall 5: Skipping plan-review
Manifestation: Executing directly after generating the plan without confirming with the user Correct Approach: Enforce plan-review and execute only after user confirmation
References
- A Guide to the Project Management Body of Knowledge (PMBOK)
- The Mythical Man-Month - Frederick Brooks
- WBS Work Breakdown Structure
- Critical Path Method (CPM)
- Risk Management Framework