task-decomposition

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Task Decomposition

任务分解

Break down complex tasks into atomic, actionable goals with clear dependencies.
将复杂任务拆解为具有明确依赖关系的原子化、可执行目标。

When to Use

适用场景

  • Complex user requests with multiple components
  • Multi-phase projects requiring coordination
  • Tasks that could benefit from parallel execution
  • Planning agent coordination strategies
  • 包含多个组件的复杂用户需求
  • 需要协调的多阶段项目
  • 可从并行执行中获益的任务
  • 规划Agent协调策略

Decomposition Framework

分解框架

1. Requirements Analysis

1. 需求分析

  • Primary objective
  • Implicit requirements (quality, performance)
  • Constraints (time, resources)
  • Success criteria
  • 核心目标
  • 隐性需求(质量、性能)
  • 约束条件(时间、资源)
  • 成功标准

2. Goal Hierarchy

2. 目标层级

Main Goal
├─ Sub-goal 1
│  ├─ Task 1.1 (atomic)
│  └─ Task 1.2 (atomic)
├─ Sub-goal 2
└─ Sub-goal 3
Main Goal
├─ Sub-goal 1
│  ├─ Task 1.1 (atomic)
│  └─ Task 1.2 (atomic)
├─ Sub-goal 2
└─ Sub-goal 3

3. Dependency Types

3. 依赖类型

TypeSymbolExample
SequentialA → B → CB needs A's output
ParallelA─┐ B─┐ C─┘Independent, concurrent
ConvergingA─┐ B─┼─> DD needs A, B, C
ResourceA, BSequential or pooled
类型符号示例
顺序依赖A → B → CB需要A的输出
并行依赖A─┐ B─┐ C─┘相互独立,可并发执行
汇聚依赖A─┐ B─┼─> DD需要A、B、C的输出
资源依赖A, B顺序执行或资源共享

4. Success Criteria

4. 成功标准

For each task:
  • Input: What data/state is needed
  • Output: What artifacts will be produced
  • Quality: Performance, testing, docs requirements
针对每个任务:
  • 输入:需要哪些数据/状态
  • 输出:将生成哪些成果物
  • 质量:性能、测试、文档要求

Decomposition Patterns

分解模式

PatternUse Case
Layer-BasedArchitectural changes (data, logic, API, test, docs)
Feature-BasedNew features (MVP, error handling, optimization, integration)
Phase-BasedLarge projects (research, foundation, core, integration, polish)
Problem-SolutionDebugging (reproduce, diagnose, design, fix, verify, prevent)
模式适用场景
基于分层架构变更(数据层、逻辑层、API、测试、文档)
基于功能新功能开发(MVP、错误处理、优化、集成)
基于阶段大型项目(调研、基础搭建、核心开发、集成、优化)
问题-解决方案调试工作(复现问题、诊断原因、设计方案、修复问题、验证、预防)

Quality Checklist

质量检查清单

✓ Atomic and actionable ✓ Dependencies clearly identified ✓ Success criteria measurable ✓ No task too large (>4 hours) ✓ Parallelization opportunities identified
✗ Tasks too large or vague ✗ Missing dependencies ✗ Unclear success criteria ✗ Missing quality/testing tasks
✓ 原子化且可执行 ✓ 依赖关系明确 ✓ 成功标准可衡量 ✓ 任务规模适中(不超过4小时) ✓ 识别出并行执行的机会
✗ 任务过大或模糊 ✗ 遗漏依赖关系 ✗ 成功标准不明确 ✗ 遗漏质量/测试任务

Integration with GOAP

与GOAP的集成

Task decomposition is Phase 1 of GOAP:
  1. Receive request
  2. Apply decomposition
  3. Create execution plan
  4. Execute with monitoring
  5. Report results
任务分解是GOAP的第一阶段:
  1. 接收需求
  2. 应用分解方法
  3. 创建执行计划
  4. 执行并监控
  5. 汇报结果