planning

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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

Task 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
  • 测试功能
  • 检查边缘情况
  • 评审代码质量
undefined

2. 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
undefined
markdown
undefined

Execution Strategy

执行策略

  1. Parallel Tasks: Independent tasks first
  2. Sequential Tasks: Follow dependency order
  3. Validation Points: Verify after each phase
  4. Rollback Plan: Know how to undo
undefined
  1. 并行任务:优先处理独立任务
  2. 串行任务:遵循依赖顺序执行
  3. 验证节点:每个阶段完成后进行验证
  4. 回滚方案:明确撤销操作的方法
undefined

4. Goal-Oriented Planning

4. 目标导向规划

markdown
undefined
markdown
undefined

SMART 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时效性:有明确的完成时间节点
undefined

5. Adaptive Re-Planning

5. 自适应重新规划

When plans fail, adapt:
markdown
undefined
当计划失败时,进行调整:
markdown
undefined

Re-Planning Protocol

重新规划流程

  1. Detect: Identify the blocker
  2. Analyze: Why did the plan fail?
  3. Adapt: Modify the approach
  4. Continue: Resume with new plan
  1. 检测:识别阻塞点
  2. 分析:计划失败的原因是什么?
  3. 调整:修改执行方法
  4. 继续:采用新计划恢复执行

Common Blockers

常见阻塞点

BlockerResponse
Missing dependencyInstall or find alternative
Type errorFix types first
API unavailableMock or wait
Unclear requirementAsk user
undefined
阻塞点应对措施
缺失依赖项安装或寻找替代方案
类型错误优先修复类型问题
API不可用模拟数据或等待恢复
需求不明确询问用户
undefined

6. Progress Tracking

6. 进度跟踪

markdown
undefined
markdown
undefined

Progress 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:评审
undefined

7. Risk Assessment

7. 风险评估

markdown
undefined
markdown
undefined

Risk Matrix

风险矩阵

RiskProbabilityImpactMitigation
Breaking changeMediumHighTest thoroughly
Performance issueLowMediumProfile if needed
Type mismatchHighLowUse strict mode
undefined
风险概率影响缓解措施
破坏性变更中等全面测试
性能问题中等必要时进行性能分析
类型不匹配使用严格模式
undefined

References

参考资料