task-decomposition
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTask 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 3Main Goal
├─ Sub-goal 1
│ ├─ Task 1.1 (atomic)
│ └─ Task 1.2 (atomic)
├─ Sub-goal 2
└─ Sub-goal 33. Dependency Types
3. 依赖类型
| Type | Symbol | Example |
|---|---|---|
| Sequential | A → B → C | B needs A's output |
| Parallel | A─┐ B─┐ C─┘ | Independent, concurrent |
| Converging | A─┐ B─┼─> D | D needs A, B, C |
| Resource | A, B | Sequential or pooled |
| 类型 | 符号 | 示例 |
|---|---|---|
| 顺序依赖 | A → B → C | B需要A的输出 |
| 并行依赖 | A─┐ B─┐ C─┘ | 相互独立,可并发执行 |
| 汇聚依赖 | A─┐ B─┼─> D | D需要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
分解模式
| Pattern | Use Case |
|---|---|
| Layer-Based | Architectural changes (data, logic, API, test, docs) |
| Feature-Based | New features (MVP, error handling, optimization, integration) |
| Phase-Based | Large projects (research, foundation, core, integration, polish) |
| Problem-Solution | Debugging (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:
- Receive request
- Apply decomposition
- Create execution plan
- Execute with monitoring
- Report results
任务分解是GOAP的第一阶段:
- 接收需求
- 应用分解方法
- 创建执行计划
- 执行并监控
- 汇报结果