planning
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlanning Strategies
规划策略
Structured approach for complex task execution.
用于复杂任务执行的结构化方法。
Instructions
说明
1. Task Decomposition
1. 任务分解
Break large tasks into manageable subtasks:
mermaid
flowchart TD
A[Complex Task] --> B[Subtask 1]
A --> C[Subtask 2]
A --> D[Subtask 3]
B --> E[Sub-subtask 1.1]
B --> F[Sub-subtask 1.2]markdown
undefined将大型任务拆分为可管理的子任务:
mermaid
flowchart TD
A[Complex Task] --> B[Subtask 1]
A --> C[Subtask 2]
A --> D[Subtask 3]
B --> E[Sub-subtask 1.1]
B --> F[Sub-subtask 1.2]markdown
undefinedTask Breakdown Template
任务分解模板
Main Goal: [Description]
主要目标:[描述]
Phase 1: Research
阶段1:调研
- Understand requirements
- Explore existing code
- Identify dependencies
- 理解需求
- 研究现有代码
- 识别依赖项
Phase 2: Implementation
阶段2:实现
- Create types/interfaces
- Implement core logic
- Add error handling
- 创建类型/接口
- 实现核心逻辑
- 添加错误处理
Phase 3: Verification
阶段3:验证
- Test functionality
- Check edge cases
- Review code quality
undefined- 测试功能
- 检查边缘情况
- 评审代码质量
undefined2. Dependency Analysis
2. 依赖分析
Before execution, identify dependencies:
typescript
// Dependency Graph Example
const taskDependencies = {
'create-api': [], // Independent
'create-types': [], // Independent
'create-service': ['create-types'], // Depends on types
'create-controller': ['create-service'], // Depends on service
'write-tests': ['create-controller'], // Depends on controller
};执行前,先识别依赖项:
typescript
// Dependency Graph Example
const taskDependencies = {
'create-api': [], // Independent
'create-types': [], // Independent
'create-service': ['create-types'], // Depends on types
'create-controller': ['create-service'], // Depends on service
'write-tests': ['create-controller'], // Depends on controller
};3. Execution Order
3. 执行顺序
markdown
undefinedmarkdown
undefinedExecution Strategy
执行策略
- Parallel Tasks: Independent tasks first
- Sequential Tasks: Follow dependency order
- Validation Points: Verify after each phase
- Rollback Plan: Know how to undo
undefined- 并行任务:优先处理独立任务
- 串行任务:遵循依赖顺序执行
- 验证节点:每个阶段完成后进行验证
- 回滚方案:明确撤销操作的方法
undefined4. Goal-Oriented Planning
4. 目标导向规划
markdown
undefinedmarkdown
undefinedSMART Goals
SMART 目标
- Specific: Clear, unambiguous objective
- Measurable: Quantifiable success criteria
- Achievable: Realistic within constraints
- Relevant: Aligned with user needs
- Time-bound: Has clear completion point
undefined- S具体:清晰、明确的目标
- M可衡量:可量化的成功标准
- A可实现:在约束条件下具备现实可行性
- R相关性:与用户需求保持一致
- T时效性:有明确的完成时间节点
undefined5. Adaptive Re-Planning
5. 自适应重新规划
When plans fail, adapt:
markdown
undefined当计划失败时,进行调整:
markdown
undefinedRe-Planning Protocol
重新规划流程
- Detect: Identify the blocker
- Analyze: Why did the plan fail?
- Adapt: Modify the approach
- Continue: Resume with new plan
- 检测:识别阻塞点
- 分析:计划失败的原因是什么?
- 调整:修改执行方法
- 继续:采用新计划恢复执行
Common Blockers
常见阻塞点
| Blocker | Response |
|---|---|
| Missing dependency | Install or find alternative |
| Type error | Fix types first |
| API unavailable | Mock or wait |
| Unclear requirement | Ask user |
undefined| 阻塞点 | 应对措施 |
|---|---|
| 缺失依赖项 | 安装或寻找替代方案 |
| 类型错误 | 优先修复类型问题 |
| API不可用 | 模拟数据或等待恢复 |
| 需求不明确 | 询问用户 |
undefined6. Progress Tracking
6. 进度跟踪
markdown
undefinedmarkdown
undefinedProgress Template
进度模板
Task: [Name]
任务:[名称]
- Status: 🟡 In Progress
- Progress: 3/7 steps complete
- Blockers: None
- ETA: 2 more tool calls
- 状态:🟡 进行中
- 进度:完成7步中的3步
- 阻塞点:无
- 预计完成时间:还需2次工具调用
Completed
已完成
- Step 1: Research
- Step 2: Types
- Step 3: Core logic
- 步骤1:调研
- 步骤2:类型定义
- 步骤3:核心逻辑
Remaining
待完成
- Step 4: Error handling
- Step 5: Tests
- Step 6: Documentation
- Step 7: Review
undefined- 步骤4:错误处理
- 步骤5:测试
- 步骤6:文档
- 步骤7:评审
undefined7. Risk Assessment
7. 风险评估
markdown
undefinedmarkdown
undefinedRisk Matrix
风险矩阵
| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| Breaking change | Medium | High | Test thoroughly |
| Performance issue | Low | Medium | Profile if needed |
| Type mismatch | High | Low | Use strict mode |
undefined| 风险 | 概率 | 影响 | 缓解措施 |
|---|---|---|---|
| 破坏性变更 | 中等 | 高 | 全面测试 |
| 性能问题 | 低 | 中等 | 必要时进行性能分析 |
| 类型不匹配 | 高 | 低 | 使用严格模式 |
undefined