Help us improve
Share bugs, ideas, or general feedback.
From ddd-workflow
Extracts lightweight milestones from spec.md into a separate tasks.md for complex dependency management, parallel work lines, and cross-agent tasking. Only activates after spec is confirmed and execution needs coordination beyond simple sprints.
npx claudepluginhub applepig/ddd-workflowHow this skill is triggered — by the user, by Claude, or both
Slash command
/ddd-workflow:ddd.tasksThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
任務拆解階段。只有當 spec.md 內的輕量 Milestones 不足以支撐執行協調時,才建立獨立 tasks.md。
Decomposes specs into ordered, verifiable tasks with acceptance criteria using vertical slicing and dependency graphs. Use for large tasks, scope estimation, or parallel agent work.
Breaks complex features into atomic JSON subtasks with dependencies, acceptance criteria, deliverables, and agent assignments. Use for multi-file changes or parallelizable work.
Convert technical designs into actionable, tracked task hierarchies with sizing, dependencies, and acceptance criteria. Invoke whenever task involves any interaction with work decomposition — breaking down features into subtasks, slicing work items, creating task lists, or writing decomposition documents.
Share bugs, ideas, or general feedback.
任務拆解階段。只有當 spec.md 內的輕量 Milestones 不足以支撐執行協調時,才建立獨立 tasks.md。
嚴禁在 spec.md 未獲使用者確認前拆任務。 嚴禁把 tasks.md 當成每個 sprint 的必備文件。簡單 sprint 應直接回到 spec.md Milestones。 嚴禁用巨大 tasks.md 硬接過大的 scope;太複雜時必須先拆 sprint。開始拆解前,先判斷是否真的需要獨立 tasks.md:
/ddd.work。/ddd.plan 或 /ddd.spec 拆成多個 sprint。tasks.md 是複雜執行協調工具,不是 traceability 補丁。若只是為了避免 spec/task detach 而加很多對照欄位,優先把 tasks 留在 spec.md。
若 Decision Gate 判定需要獨立 tasks.md,再檢查 spec 的範圍:
你必須為以下每個項目建立 task 並依序完成:
決定 milestone 的粒度時,考慮以下原則:
✅ 好的拆解——測試先行、平行標記清楚、每條工作線有完整上下文卡片:
# Tasks: 使用者登入功能
## Milestone 1: 資料層與介面契約(序列)
> 預期結果:User model 可建立與查詢、密碼可雜湊與驗證、session 可 CRUD
> 驗證方式:`vitest run server/models/ server/services/session/`
- [ ] Task 1.1: 定義 LoginRequest/LoginResponse 型別與 API 契約
- [ ] Task 1.2: 撰寫 User model 與 password hashing 測試 (Red)
- [ ] Task 1.3: 實作 User model 與 password hashing (Green)
- [ ] Task 1.4: 撰寫 session store 測試 (Red)
- [ ] Task 1.5: 實作 session store (Green)
## Milestone 2: API + 前端
> 預期結果:使用者可透過前端表單登入,取得有效 session token
> 介面契約已在 M1 確立,以下可平行派發。
### 🔀 可平行工作線
**[A] Backend API** — `isolation: worktree`
> 範圍:`server/routes/auth/`、`server/services/auth/`
> 依賴:Task 1.x 完成的 User model + session store
> 介面契約:POST /auth/login → LoginResponse { token, user }
> 驗證方式:`vitest run server/routes/auth/` 全過
- [ ] Task 2.1: 撰寫 POST /auth/login endpoint 測試 (Red)
- [ ] Task 2.2: 實作 login endpoint (Green)
**[B] Frontend Form** — `isolation: worktree`
> 範圍:`components/auth/`、`composables/useAuth.ts`
> 依賴:LoginRequest/LoginResponse type 定義
> 介面契約:LoginForm emit `submit` 帶 LoginRequest payload
> 驗證方式:`vitest run components/auth/` 全過
- [ ] Task 2.3: 撰寫登入表單元件測試 (Red)
- [ ] Task 2.4: 實作登入表單元件 (Green)
### 🔗 匯合點
> 驗證方式:`vitest run tests/integration/auth/` 全過
- [ ] Task 2.5: 合併 [A]、[B] 分支,解決衝突
- [ ] Task 2.6: 前後端整合測試 (Red → Green)
❌ 不好的拆解——測試與實作混在一起、粒度太大、沒標記平行機會:
## Milestone 1: 登入功能
- [ ] Task 1.1: 建立 User model 並寫測試
- [ ] Task 1.2: 實作完整的登入 API 和前端頁面
若功能只涉及 1–2 個檔案且 task 總數不超過 4 個,可直接標記為序列執行,跳過以下平行分析。
當功能涉及多個獨立模組(例如前端 + 後端、多個獨立 API),必須主動評估是否能平行開發。平行切分的關鍵是:兩條工作線不會互相修改同一個檔案。
判斷能否平行的標準:
平行工作線不只是「標記」——在 agentic 環境中,它代表可同時派發給多個 Agent 子行程執行的工作單元。規劃 tasks.md 時,應以「能否被獨立 agent 自主完成」為切分依據。
Agent 派發原則:
適合 Agent 平行的典型模式:
| 模式 | 範例 | 工作線數 |
|---|---|---|
| 前後端分離 | API + UI 各自開發 | 2 |
| 多獨立端點 | 3 個不相關的 REST endpoint | 2~3 |
| 多獨立模組 | auth module + notification module | 2 |
| 測試與 fixture | 測試資料準備 + 測試案例撰寫 | 2 |
不適合平行的情境:
用 🔀 可平行工作線 標記可同時派發的區塊,用 🔗 匯合點 標記合併後的驗證步驟。每條工作線用 [A]、[B] 等字母標識。格式範例見上方「好的拆解」。
每條工作線的 blockquote 是 worker 的上下文卡片——/ddd.work 的 coordinator 會直接從這裡擷取資訊組裝 worker prompt,所以必須包含 agent 獨立作業所需的一切:
| 欄位 | 說明 | 必要性 |
|---|---|---|
| 範圍 | 本工作線涉及的檔案/目錄路徑 | 必填 |
| 依賴 | 前置 task 或外部依賴 | 必填 |
| 介面契約 | 與其他工作線的銜接介面(types、API schema) | 有平行線時必填 |
| 驗證方式 | 完成後如何驗證——unit test 指令、E2E 步驟、或 curl 命令 | 必填 |
拆解 milestone 時,依序評估:
撰寫完 tasks.md 後,以新鮮眼光對照 spec 自我檢查。這是你自己跑的 checklist,不是派 subagent。
1. Spec 覆蓋度:逐條掃描 spec 的目標、非目標、驗收條件、邊界案例與 ADR,每個會影響實作的項目都能在 tasks.md 中被保留或反映嗎?列出遺漏。
2. Task 完整性掃描:檢查是否有以下問題:
3. 依賴一致性:平行工作線之間的介面契約是否在分線前的 task 中確立?Milestone 之間的依賴方向是否合理——後面的 milestone 是否真的依賴前面的產出?
發現問題直接修正,不需重新 review。若發現 tasks.md 只是把 spec 內容機械轉成更長的 checklist,刪除 tasks.md 草稿,回到 spec.md Milestones。
docs/<編號>-<名稱>/tasks.mddocs/<編號>-<名稱>/spec.md 的 Milestones,不建立 tasks.md使用者確認後,引導使用者執行 /ddd.work。若 Decision Gate 判定需要拆 sprint,停止在規劃階段並引導回 /ddd.plan 或 /ddd.spec。