Development
规划与任务拆解
将工作拆解为有序的任务。适用于你已有规范或明确需求,需要将工作拆解为可实现任务时。
将工作分解为带有明确验收标准的、小而可验证的任务。
在编写任何代码之前,以只读模式操作:
规划阶段不要编写代码。
梳理什么依赖于什么:
Database schema
│
├── API models/types
│ │
│ ├── API endpoints
│ │ │
│ │ └── Frontend API client
│ │ │
│ │ └── UI components
│ │
│ └── Validation logic
│
└── Seed data / migrations
一次构建一条完整的功能路径:
不好(水平切片):
Task 1: Build entire database schema
Task 2: Build all API endpoints
Task 3: Build all UI components
Task 4: Connect everything
好(垂直切片):
Task 1: User can create an account (schema + API + UI)
Task 2: User can log in (auth schema + API + UI)
Task 3: User can create a task (task schema + API + UI)
Task 4: User can view task list (query + API + UI)
每个任务遵循以下结构:
## Task [N]: [Short descriptive title]
**Description:** One paragraph explaining what this task accomplishes.
**Acceptance criteria:**
- [ ] [Specific, testable condition]
- [ ] [Specific, testable condition]
**Verification:**
- [ ] Tests pass: `npm test -- --grep "feature-name"`
- [ ] Build succeeds: `npm run build`
- [ ] Manual check: [description of what to verify]
**Dependencies:** [Task numbers this depends on, or "None"]
**Files likely touched:**
- `src/path/to/file.ts`
- `tests/path/to/test.ts`
**Estimated scope:** [Small: 1-2 files | Medium: 3-5 files | Large: 5+ files]
安排任务的顺序,使得:
| 规模 | 文件数 | 范围 | 示例 | |------|-------|-------|---------| | XS | 1 | 单个函数或配置变更 | 添加一条验证规则 | | S | 1-2 | 一个组件或端点 | 添加一个新的 API 端点 | | M | 3-5 | 一个功能切片 | 用户注册流程 | | L | 5-8 | 多组件功能 | 带筛选的搜索 | | XL | 8+ | 太大了——继续拆分 | — |
# Implementation Plan: [Feature/Project Name]
## Overview
[One paragraph summary of what we're building]
## Architecture Decisions
- [Key decision 1 and rationale]
- [Key decision 2 and rationale]
## Task List
### Phase 1: Foundation
- [ ] Task 1: ...
- [ ] Task 2: ...
### Checkpoint: Foundation
- [ ] Tests pass, builds clean
### Phase 2: Core Features
- [ ] Task 3: ...
- [ ] Task 4: ...
### Checkpoint: Core Features
- [ ] End-to-end flow works
## Risks and Mitigations
| Risk | Impact | Mitigation |
|------|--------|------------|
| [Risk] | [High/Med/Low] | [Strategy] |
在开始实现之前: