task-breakdown
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTask Breakdown
任务拆分
Transform designs into actionable implementation plans. This skill teaches how to create well-structured task lists that enable efficient, systematic development.
将设计转化为可执行的实现计划。本技能将教授如何创建结构清晰的任务列表,以实现高效、系统化的开发。
When to Use This Skill
何时使用本技能
Use task breakdown when:
- Design phase is complete and approved
- Ready to begin implementation
- Need to coordinate work across developers
- Want to track incremental progress
- Planning sprints or work assignments
在以下场景使用任务拆分:
- 设计阶段已完成并获得批准
- 准备开始实施工作
- 需要跨开发者协调工作
- 希望跟踪增量开发进度
- 规划迭代周期或工作分配
Task Structure
任务结构
Two-Level Hierarchy
两级层级结构
markdown
- [ ] 1. [Epic/Major Component]
- [ ] 1.1 [Specific implementation task]
- [Implementation details]
- [Files/components to create]
- _Requirements: [Requirement references]_
- [ ] 1.2 [Next specific task]
- [Details]
- _Requirements: [References]_
- [ ] 2. [Next Epic/Major Component]
- [ ] 2.1 [Specific task]markdown
- [ ] 1. [Epic/主要组件]
- [ ] 1.1 [具体实现任务]
- [实现细节]
- [需创建的文件/组件]
- _需求:[需求引用]_
- [ ] 1.2 [下一个具体任务]
- [细节]
- _需求:[引用]_
- [ ] 2. [下一个Epic/主要组件]
- [ ] 2.1 [具体任务]Task Specification Elements
任务规范要素
Each task should include:
- Clear Objective: What specific code to write/modify
- Implementation Details: Files, components, functions
- Requirements Reference: Which requirements this implements
- Completion Criteria: How to know the task is done
每个任务应包含:
- 明确目标:需要编写/修改的具体代码内容
- 实现细节:涉及的文件、组件、函数
- 需求引用:该任务对应实现的需求
- 完成标准:如何判断任务已完成
Step-by-Step Process
分步流程
Step 1: Analyze Design Components
步骤1:分析设计组件
Identify all implementation needs:
- Data models and validation
- Services and business logic
- API endpoints and handlers
- UI components
- Tests for each layer
- Integration points
识别所有实现需求:
- 数据模型与验证
- 服务与业务逻辑
- API端点与处理程序
- UI组件
- 各层级测试
- 集成点
Step 2: Identify Dependencies
步骤2:识别依赖关系
Map what needs to be built first:
- Technical: Code dependencies (models before services)
- Logical: Feature dependencies (login before profile)
- Data: What data must exist first
梳理需优先构建的内容:
- 技术依赖:代码依赖(如先构建模型再开发服务)
- 逻辑依赖:功能依赖(如先实现登录再开发个人资料)
- 数据依赖:需提前存在的数据
Step 3: Sequence Tasks
步骤3:排序任务
Order tasks to:
- Respect dependencies
- Enable early validation
- Allow incremental testing
- Minimize blocking between tasks
任务排序需遵循:
- 尊重依赖关系
- 支持早期验证
- 允许增量测试
- 最小化任务间的阻塞
Step 4: Write Task Descriptions
步骤4:编写任务描述
For each task, specify:
markdown
- [ ] X.Y [Task Title]
- [What to implement]
- [Files to create/modify]
- [Key functionality]
- [Tests to write]
- _Requirements: [Req-1, Req-2]_每个任务需按以下格式编写:
markdown
- [ ] X.Y [任务标题]
- [需实现的内容]
- [需创建/修改的文件]
- [核心功能]
- [需编写的测试]
- _需求:[Req-1, Req-2]_Sequencing Strategies
排序策略
Strategy 1: Foundation-First
策略1:基础优先
Build core infrastructure before features.
markdown
1. Project setup and core interfaces
2. Data models and validation
3. Data access layer
4. Business logic services
5. API endpoints
6. Integration and wiringBest for: New projects, complex systems
先构建核心基础设施再开发功能。
markdown
1. 项目搭建与核心接口
2. 数据模型与验证
3. 数据访问层
4. 业务逻辑服务
5. API端点
6. 集成与关联适用场景:新项目、复杂系统
Strategy 2: Feature-Slice (Vertical)
策略2:功能切片(垂直拆分)
Build complete features end-to-end.
markdown
1. User registration (complete flow)
2. User authentication (complete flow)
3. User profile management (complete flow)
4. Advanced featuresBest for: MVP development, early validation
端到端构建完整功能。
markdown
1. 用户注册(完整流程)
2. 用户认证(完整流程)
3. 用户资料管理(完整流程)
4. 高级功能适用场景:MVP开发、早期验证
Strategy 3: Risk-First
策略3:风险优先
Tackle uncertain areas early.
markdown
1. Most complex/uncertain components
2. External integrations
3. Core business logic
4. User interface
5. Polish and optimizationBest for: High uncertainty, proof-of-concepts
优先处理不确定的内容。
markdown
1. 最复杂/不确定的组件
2. 外部集成
3. 核心业务逻辑
4. 用户界面
5. 优化与完善适用场景:高不确定性项目、概念验证
Strategy 4: Hybrid (Recommended)
策略4:混合模式(推荐)
Combine approaches pragmatically.
markdown
1. Minimal foundation (core interfaces)
2. High-risk/high-value feature slice
3. Expand foundation as needed
4. Additional feature slices
5. Integration and polish务实结合多种方法。
markdown
1. 最小化基础架构(核心接口)
2. 高风险/高价值功能切片
3. 根据需要扩展基础架构
4. 新增功能切片
5. 集成与完善Task Categories
任务分类
Foundation Tasks
基础任务
markdown
- [ ] 1. Set up project foundation
- [ ] 1.1 Create project structure and interfaces
- Set up directory structure
- Define TypeScript interfaces for core types
- Configure testing framework
- _Requirements: 1.1_markdown
- [ ] 1. 搭建项目基础
- [ ] 1.1 创建项目结构与接口
- 搭建目录结构
- 为核心类型定义TypeScript接口
- 配置测试框架
- _需求:1.1_Data Layer Tasks
数据层任务
markdown
- [ ] 2. Implement data layer
- [ ] 2.1 Create core data models
- Implement User model with validation
- Add database migrations
- Write unit tests for validation
- _Requirements: 2.1, 2.2_markdown
- [ ] 2. 实现数据层
- [ ] 2.1 创建核心数据模型
- 实现带验证的User模型
- 添加数据库迁移
- 编写验证单元测试
- _需求:2.1, 2.2_Business Logic Tasks
业务逻辑任务
markdown
- [ ] 3. Implement business logic
- [ ] 3.1 Create authentication service
- Implement registration logic
- Add password hashing
- Create session management
- Write unit tests
- _Requirements: 1.2, 4.1_markdown
- [ ] 3. 实现业务逻辑
- [ ] 3.1 创建认证服务
- 实现注册逻辑
- 添加密码哈希
- 创建会话管理
- 编写单元测试
- _需求:1.2, 4.1_API Tasks
API任务
markdown
- [ ] 4. Implement API layer
- [ ] 4.1 Create user endpoints
- Implement POST /users endpoint
- Add request validation
- Write integration tests
- _Requirements: 1.2, 2.3_markdown
- [ ] 4. 实现API层
- [ ] 4.1 创建用户端点
- 实现POST /users端点
- 添加请求验证
- 编写集成测试
- _需求:1.2, 2.3_Integration Tasks
集成任务
markdown
- [ ] 5. Integration and testing
- [ ] 5.1 Wire up components
- Connect services to API layer
- Implement middleware
- Add end-to-end tests
- _Requirements: 5.1_markdown
- [ ] 5. 集成与测试
- [ ] 5.1 关联各组件
- 连接服务与API层
- 实现中间件
- 添加端到端测试
- _需求:5.1_Writing Effective Tasks
编写优质任务
Good Task Example
优秀任务示例
markdown
- [ ] 2.1 Create User model with validation
- Implement User class with email, password, name fields
- Add email validation (RFC 5322 format)
- Add password validation (8+ chars, mixed case, numbers)
- Write unit tests for valid/invalid scenarios
- _Requirements: 1.2, 2.1_markdown
- [ ] 2.1 创建带验证的User模型
- 实现包含邮箱、密码、名称字段的User类
- 添加邮箱验证(RFC 5322格式)
- 添加密码验证(8位以上、混合大小写、包含数字)
- 编写有效/无效场景的单元测试
- _需求:1.2, 2.1_Poor Task Example
不良任务示例
markdown
- [ ] 2.1 Build user stuff
- Make user things work
- _Requirements: 1.2_markdown
- [ ] 2.1 构建用户相关内容
- 让用户功能可用
- _需求:1.2_Task Scope Guidelines
任务范围指南
Appropriate: 2-4 hours of focused work
Too Large:
markdown
- [ ] 1.1 Implement complete user management systemToo Small:
markdown
- [ ] 1.1 Add semicolon to line 42Just Right:
markdown
- [ ] 1.1 Create User model with validation methods合适范围:2-4小时的专注工作
过大范围:
markdown
- [ ] 1.1 实现完整的用户管理系统过小范围:
markdown
- [ ] 1.1 为第42行添加分号恰到好处的范围:
markdown
- [ ] 1.1 创建带验证方法的User模型Dependency Management
依赖管理
Types of Dependencies
依赖类型
Technical Dependencies:
markdown
- [ ] 1.1 Create database connection ← Foundation
- [ ] 2.1 Create User model ← Depends on 1.1
- [ ] 3.1 Create UserService ← Depends on 2.1Logical Dependencies:
markdown
- [ ] 1.1 User registration ← Must exist first
- [ ] 2.1 User login ← Depends on 1.1
- [ ] 3.1 Password reset ← Depends on 2.1技术依赖:
markdown
- [ ] 1.1 创建数据库连接 ← 基础任务
- [ ] 2.1 创建User模型 ← 依赖1.1
- [ ] 3.1 创建UserService ← 依赖2.1逻辑依赖:
markdown
- [ ] 1.1 用户注册 ← 需优先完成
- [ ] 2.1 用户登录 ← 依赖1.1
- [ ] 3.1 密码重置 ← 依赖2.1Handling Circular Dependencies
处理循环依赖
Problem:
UserService needs AuthService
AuthService needs UserServiceSolution - Interface Extraction:
markdown
- [ ] 1.1 Create IUserService and IAuthService interfaces
- [ ] 1.2 Implement UserService using IAuthService
- [ ] 1.3 Implement AuthService using IUserService
- [ ] 1.4 Wire up dependency injection问题:
UserService需要AuthService
AuthService需要UserService解决方案 - 接口提取:
markdown
- [ ] 1.1 创建IUserService与IAuthService接口
- [ ] 1.2 基于IAuthService实现UserService
- [ ] 1.3 基于IUserService实现AuthService
- [ ] 1.4 配置依赖注入Complete Example
完整示例
markdown
undefinedmarkdown
undefinedImplementation Plan: User Authentication
实现计划:用户认证
-
1. Set up authentication foundation
-
1.1 Create project structure and interfaces
- Set up directory structure for auth, models, API
- Define TypeScript interfaces for User, Session, AuthRequest
- Configure Jest for testing
- Requirements: 1.1
-
1.2 Set up database and migrations
- Configure database connection
- Create user and session tables
- Set up test database
- Requirements: 1.1, 2.1
-
2. Implement core data models
-
2.1 Create User model with validation
- Implement User class with email, password, profile fields
- Add email format validation
- Add password strength validation (8+ chars)
- Write unit tests for all validation rules
- Requirements: 1.2, 2.1
-
2.2 Create Session model
- Implement Session class with token, expiration
- Add session validation logic
- Write unit tests for session management
- Requirements: 1.2, 4.1
-
3. Create authentication services
-
3.1 Implement registration service
- Create UserService with register method
- Add password hashing with bcrypt
- Implement duplicate email checking
- Write unit tests for registration
- Requirements: 1.2
-
3.2 Implement login service
- Add login method with password verification
- Implement JWT token generation
- Create refresh token rotation
- Write unit tests for login flow
- Requirements: 1.2, 4.1
-
4. Create API endpoints
-
4.1 Implement registration endpoint
- Create POST /auth/register endpoint
- Add request validation middleware
- Implement error responses
- Write integration tests
- Requirements: 1.2, 2.3
-
4.2 Implement login endpoint
- Create POST /auth/login endpoint
- Add authentication middleware
- Implement logout functionality
- Write integration tests
- Requirements: 1.2, 4.1
-
5. Integration and security
-
5.1 Add security middleware
- Implement rate limiting
- Add CORS configuration
- Create JWT validation middleware
- Write security tests
- Requirements: 4.1, 2.3
-
5.2 End-to-end testing
- Create complete auth flow tests
- Test error scenarios
- Validate security measures
- Requirements: 1.2, 4.1
undefined-
1. 搭建认证基础
-
1.1 创建项目结构与接口
- 为认证、模型、API搭建目录结构
- 为User、Session、AuthRequest定义TypeScript接口
- 配置Jest测试框架
- 需求:1.1
-
1.2 搭建数据库与迁移
- 配置数据库连接
- 创建用户与会话表
- 搭建测试数据库
- 需求:1.1, 2.1
-
2. 实现核心数据模型
-
2.1 创建带验证的User模型
- 实现包含邮箱、密码、资料字段的User类
- 添加邮箱格式验证
- 添加密码强度验证(8位以上)
- 编写所有验证规则的单元测试
- 需求:1.2, 2.1
-
2.2 创建Session模型
- 实现包含令牌、过期时间的Session类
- 添加会话验证逻辑
- 编写会话管理单元测试
- 需求:1.2, 4.1
-
3. 创建认证服务
-
3.1 实现注册服务
- 创建带register方法的UserService
- 使用bcrypt添加密码哈希
- 实现重复邮箱检测
- 编写注册单元测试
- 需求:1.2
-
3.2 实现登录服务
- 添加带密码验证的login方法
- 实现JWT令牌生成
- 创建刷新令牌轮换机制
- 编写登录流程单元测试
- 需求:1.2, 4.1
-
4. 创建API端点
-
4.1 实现注册端点
- 创建POST /auth/register端点
- 添加请求验证中间件
- 实现错误响应
- 编写集成测试
- 需求:1.2, 2.3
-
4.2 实现登录端点
- 创建POST /auth/login端点
- 添加认证中间件
- 实现登出功能
- 编写集成测试
- 需求:1.2, 4.1
-
5. 集成与安全
-
5.1 添加安全中间件
- 实现速率限制
- 添加CORS配置
- 创建JWT验证中间件
- 编写安全测试
- 需求:4.1, 2.3
-
5.2 端到端测试
- 创建完整认证流程测试
- 测试错误场景
- 验证安全措施
- 需求:1.2, 4.1
undefinedQuality Checklist
质量检查清单
Before finalizing tasks:
Completeness:
- All design components have tasks
- All requirements are addressed
- Testing tasks included throughout
- Integration tasks connect components
Clarity:
- Each task has specific objective
- Files/components specified
- Requirements referenced
- Completion criteria clear
Sequencing:
- Dependencies respected
- Foundation before features
- Core before optional
- Integration after components
Feasibility:
- Tasks are 2-4 hours each
- Can be completed independently
- No external blockers
- Complexity increases gradually
最终确定任务前需检查:
完整性:
- 所有设计组件均对应任务
- 所有需求均已覆盖
- 全程包含测试任务
- 集成任务关联各组件
清晰度:
- 每个任务有明确目标
- 指定了文件/组件
- 引用了对应需求
- 完成标准清晰
排序合理性:
- 尊重依赖关系
- 先基础后功能
- 先核心后可选
- 组件开发完成后再集成
可行性:
- 每个任务耗时2-4小时
- 可独立完成
- 无外部阻塞
- 复杂度逐步提升
Common Pitfalls
常见陷阱
- Tasks too abstract: "Implement user management" vs specific actions
- Missing dependencies: Tasks that can't be completed in sequence
- Non-coding tasks: Include only implementation activities
- Monolithic tasks: Break into 2-4 hour increments
- Missing tests: Include testing in each task
- 任务过于抽象:比如“实现用户管理”而非具体操作
- 遗漏依赖关系:任务无法按顺序完成
- 包含非编码任务:仅保留实现类活动
- 任务过于庞大:拆分为2-4小时的增量任务
- 遗漏测试:每个任务需包含测试内容
Task Execution Tips
任务执行技巧
Before starting a task:
- Read task details thoroughly
- Review referenced requirements
- Check dependencies are complete
- Plan implementation approach
During implementation:
- Mark task as in-progress
- Write tests alongside code
- Test continuously
- Document as you go
Before marking complete:
- All tests pass
- Requirements validated
- Code reviewed
- Documentation updated
开始任务前:
- 仔细阅读任务细节
- 查看引用的需求
- 确认依赖任务已完成
- 规划实现方案
执行任务中:
- 将任务标记为进行中
- 边写代码边写测试
- 持续测试
- 同步更新文档
标记任务完成前:
- 所有测试通过
- 需求已验证
- 代码已评审
- 文档已更新
Next Steps
后续步骤
After completing task breakdown:
- Review task list with team
- Assign tasks to developers
- Begin implementation in sequence
- Track progress by marking tasks complete
- Update tasks if implementation reveals gaps
完成任务拆分后:
- 与团队评审任务列表
- 将任务分配给开发者
- 按顺序开始实施
- 通过标记任务完成跟踪进度
- 若实施过程发现缺口,及时更新任务