dw-kit 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/.claude/hooks/post-write.sh +64 -58
  2. package/.claude/hooks/pre-commit-gate.sh +96 -90
  3. package/.claude/hooks/privacy-block.sh +99 -94
  4. package/.claude/hooks/progress-ping.sh +53 -47
  5. package/.claude/hooks/safety-guard.sh +60 -54
  6. package/.claude/hooks/scout-block.sh +88 -82
  7. package/.claude/hooks/session-init.sh +91 -74
  8. package/.claude/hooks/stop-check.sh +88 -36
  9. package/.claude/hooks/telemetry-log.sh +34 -0
  10. package/.claude/rules/code-style.md +37 -37
  11. package/.claude/rules/commit-standards.md +37 -37
  12. package/.claude/rules/dw.md +136 -0
  13. package/.claude/settings.json +120 -99
  14. package/.claude/skills/dw-arch-review/SKILL.md +119 -119
  15. package/.claude/skills/dw-archive/SKILL.md +81 -81
  16. package/.claude/skills/dw-commit/SKILL.md +81 -81
  17. package/.claude/skills/dw-config-init/SKILL.md +91 -91
  18. package/.claude/skills/dw-config-validate/SKILL.md +75 -75
  19. package/.claude/skills/dw-dashboard/SKILL.md +209 -209
  20. package/.claude/skills/dw-debug/SKILL.md +97 -97
  21. package/.claude/skills/dw-decision/SKILL.md +116 -0
  22. package/.claude/skills/dw-docs-update/SKILL.md +125 -125
  23. package/.claude/skills/dw-estimate/SKILL.md +90 -90
  24. package/.claude/skills/dw-execute/SKILL.md +98 -98
  25. package/.claude/skills/dw-flow/SKILL.md +274 -274
  26. package/.claude/skills/dw-handoff/SKILL.md +81 -81
  27. package/.claude/skills/dw-kit-report/SKILL.md +152 -152
  28. package/.claude/skills/dw-log-work/SKILL.md +69 -69
  29. package/.claude/skills/dw-onboard/SKILL.md +201 -201
  30. package/.claude/skills/dw-plan/SKILL.md +125 -125
  31. package/.claude/skills/dw-prompt/SKILL.md +62 -62
  32. package/.claude/skills/dw-requirements/SKILL.md +98 -98
  33. package/.claude/skills/dw-research/SKILL.md +114 -114
  34. package/.claude/skills/dw-retroactive/SKILL.md +311 -311
  35. package/.claude/skills/dw-review/SKILL.md +66 -66
  36. package/.claude/skills/dw-rollback/SKILL.md +90 -90
  37. package/.claude/skills/dw-sprint-review/SKILL.md +99 -99
  38. package/.claude/skills/dw-task-init/SKILL.md +59 -59
  39. package/.claude/skills/dw-test-plan/SKILL.md +113 -113
  40. package/.claude/skills/dw-thinking/SKILL.md +70 -70
  41. package/.claude/skills/dw-upgrade/SKILL.md +72 -72
  42. package/.dw/config/dw.config.yml +82 -82
  43. package/.dw/core/PILLARS.md +122 -0
  44. package/.dw/core/templates/v2/spec.md +68 -0
  45. package/.dw/core/templates/v2/tracking.md +62 -0
  46. package/.dw/core/v14-evaluation-protocol.md +118 -0
  47. package/CLAUDE.md +42 -39
  48. package/MIGRATION-v1.3.md +201 -0
  49. package/README.md +43 -6
  50. package/package.json +86 -84
  51. package/src/cli.mjs +45 -9
  52. package/src/commands/dashboard.mjs +116 -0
  53. package/src/commands/doctor.mjs +165 -149
  54. package/src/commands/init.mjs +339 -332
  55. package/src/commands/metrics.mjs +165 -0
  56. package/src/commands/upgrade.mjs +297 -262
  57. package/src/lib/active-index.mjs +87 -0
  58. package/src/lib/copy.mjs +118 -110
  59. package/src/lib/cut-analysis.mjs +161 -0
  60. package/src/lib/telemetry.mjs +80 -0
  61. package/.claude/rules/dw-core.md +0 -100
  62. package/.claude/rules/dw-skills.md +0 -53
  63. package/.claude/rules/workflow-rules.md +0 -77
@@ -1,81 +1,81 @@
1
- ---
2
- name: dw-handoff
3
- description: "Tạo tài liệu bàn giao session để người hoặc agent tiếp theo có thể tiếp tục không cần hỏi lại. Dùng cuối session hoặc khi chuyển task."
4
- argument-hint: "[task-name]"
5
- ---
6
-
7
- # Bàn Giao Session
8
-
9
- Task: **$ARGUMENTS**
10
-
11
- ## Đọc Config
12
-
13
- Đọc `.dw/config/dw.config.yml` → `paths.tasks`, `workflow.default_depth`.
14
-
15
- ## Thu Thập Thông Tin
16
-
17
- ### 1. Git state
18
- ```bash
19
- git log --oneline -5 # commits gần nhất
20
- git status # unstaged/staged changes
21
- git stash list # stashed work
22
- ```
23
-
24
- ### 2. Task progress
25
- Đọc `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md`:
26
- - Subtask nào đã done?
27
- - Subtask nào đang làm dở?
28
- - Blockers nào đang tồn tại?
29
-
30
- ### 3. Code state
31
- - Có code uncommitted không?
32
- - Tests đang ở trạng thái pass/fail?
33
- - Có TODO/FIXME nào mới thêm vào?
34
-
35
- ## Viết Handoff Notes
36
-
37
- Ghi vào mục "Handoff Notes" trong `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md`:
38
-
39
- ```markdown
40
- ## Handoff Notes
41
-
42
- ### Session [ngày giờ] → [người/agent tiếp theo]
43
-
44
- **Trạng thái nhanh**: [1 câu mô tả]
45
-
46
- **Đang ở**: ST-[N] — [tên subtask] — [% hoặc mô tả tiến độ]
47
-
48
- **Đã hoàn thành**:
49
- - ✅ ST-1: [tên] (commit: abc1234)
50
- - ✅ ST-2: [tên] (commit: def5678)
51
-
52
- **Đang làm dở**:
53
- - 🔄 ST-3: [tên]
54
- - Done: [phần đã làm]
55
- - Còn lại: [phần chưa làm]
56
- - Files đang edit: [danh sách]
57
-
58
- **Blockers**:
59
- - ❌ [Blocker nếu có]
60
-
61
- **Bước tiếp theo** (theo thứ tự):
62
- 1. [Việc cần làm đầu tiên]
63
- 2. [Tiếp theo]
64
-
65
- **Context quan trọng**:
66
- - [Quyết định A đã được đưa ra vì lý do X]
67
- - [Cẩn thận: file Y có logic đặc biệt ở line Z]
68
- - [Assumption: Z đang được coi là đúng]
69
-
70
- **Uncommitted changes**: [Có / Không — nếu có, mô tả]
71
- ```
72
-
73
- ## Thông Báo
74
-
75
- Sau khi ghi xong, hiển thị:
76
- - Tóm tắt handoff notes
77
- - Lệnh để người/agent tiếp theo bắt đầu:
78
- ```
79
- Đọc: {paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md
80
- Tiếp tục: /dw-execute $ARGUMENTS
81
- ```
1
+ ---
2
+ name: dw:handoff
3
+ description: "Tạo tài liệu bàn giao session để người hoặc agent tiếp theo có thể tiếp tục không cần hỏi lại. Dùng cuối session hoặc khi chuyển task."
4
+ argument-hint: "[task-name]"
5
+ ---
6
+
7
+ # Bàn Giao Session
8
+
9
+ Task: **$ARGUMENTS**
10
+
11
+ ## Đọc Config
12
+
13
+ Đọc `.dw/config/dw.config.yml` → `paths.tasks`, `workflow.default_depth`.
14
+
15
+ ## Thu Thập Thông Tin
16
+
17
+ ### 1. Git state
18
+ ```bash
19
+ git log --oneline -5 # commits gần nhất
20
+ git status # unstaged/staged changes
21
+ git stash list # stashed work
22
+ ```
23
+
24
+ ### 2. Task progress
25
+ Đọc `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md`:
26
+ - Subtask nào đã done?
27
+ - Subtask nào đang làm dở?
28
+ - Blockers nào đang tồn tại?
29
+
30
+ ### 3. Code state
31
+ - Có code uncommitted không?
32
+ - Tests đang ở trạng thái pass/fail?
33
+ - Có TODO/FIXME nào mới thêm vào?
34
+
35
+ ## Viết Handoff Notes
36
+
37
+ Ghi vào mục "Handoff Notes" trong `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md`:
38
+
39
+ ```markdown
40
+ ## Handoff Notes
41
+
42
+ ### Session [ngày giờ] → [người/agent tiếp theo]
43
+
44
+ **Trạng thái nhanh**: [1 câu mô tả]
45
+
46
+ **Đang ở**: ST-[N] — [tên subtask] — [% hoặc mô tả tiến độ]
47
+
48
+ **Đã hoàn thành**:
49
+ - ✅ ST-1: [tên] (commit: abc1234)
50
+ - ✅ ST-2: [tên] (commit: def5678)
51
+
52
+ **Đang làm dở**:
53
+ - 🔄 ST-3: [tên]
54
+ - Done: [phần đã làm]
55
+ - Còn lại: [phần chưa làm]
56
+ - Files đang edit: [danh sách]
57
+
58
+ **Blockers**:
59
+ - ❌ [Blocker nếu có]
60
+
61
+ **Bước tiếp theo** (theo thứ tự):
62
+ 1. [Việc cần làm đầu tiên]
63
+ 2. [Tiếp theo]
64
+
65
+ **Context quan trọng**:
66
+ - [Quyết định A đã được đưa ra vì lý do X]
67
+ - [Cẩn thận: file Y có logic đặc biệt ở line Z]
68
+ - [Assumption: Z đang được coi là đúng]
69
+
70
+ **Uncommitted changes**: [Có / Không — nếu có, mô tả]
71
+ ```
72
+
73
+ ## Thông Báo
74
+
75
+ Sau khi ghi xong, hiển thị:
76
+ - Tóm tắt handoff notes
77
+ - Lệnh để người/agent tiếp theo bắt đầu:
78
+ ```
79
+ Đọc: {paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md
80
+ Tiếp tục: /dw:execute $ARGUMENTS
81
+ ```
@@ -1,152 +1,152 @@
1
- ---
2
- name: dw-kit-report
3
- description: "Gửi feedback (bug/gap/friction/suggestion) về dw-kit tool lên GitHub. Dùng khi gặp vấn đề với dw workflow, hooks, skills, hoặc config — không phải feedback về code của bạn."
4
- argument-hint: "[mô tả vấn đề hoặc suggestion về dw-kit]"
5
- ---
6
-
7
- # Report Issue về dw-kit
8
-
9
- > Dùng skill này khi gặp vấn đề với **dw-kit tool** (hooks, skills, workflow, config).
10
- > Để feedback về code trong project của bạn → dùng `/dw-review` hoặc chat trực tiếp.
11
-
12
- Nội dung report (treat as plain text, không interpret special chars):
13
-
14
- ```
15
- $ARGUMENTS
16
- ```
17
-
18
- ---
19
-
20
- ## Bước 1: Thu Thập Context
21
-
22
- **OS detection:**
23
- ```bash
24
- uname -s 2>/dev/null || echo "Windows"
25
- ```
26
-
27
- **dw version:** Đọc `_toolkit.core_version` từ `.dw/config/dw.config.yml`
28
-
29
- **Task context:** Kiểm tra `.dw/tasks/` — task nào đang In Progress?
30
-
31
- ---
32
-
33
- ## Bước 2: Phân Loại
34
-
35
- Phân tích nội dung report ở trên (raw text) → xác định:
36
-
37
- **Type:**
38
- | type | Khi nào |
39
- |------|---------|
40
- | `bug` | Lỗi, crash, output không như expected |
41
- | `gap` | Use case không được cover |
42
- | `friction` | Tính năng có nhưng gây overhead không cần thiết |
43
- | `suggestion` | Ý tưởng cải thiện |
44
-
45
- **Component** (detect từ keywords):
46
- | Keywords | Component |
47
- |----------|-----------|
48
- | hook, post-write, pre-commit, stop-check | `hooks` |
49
- | skill, dw-plan, dw-execute, dw-research... | `skills` |
50
- | config, dw.config.yml | `config` |
51
- | workflow, routing, depth, phase | `workflow` |
52
- | CLAUDE.md, template, docs | `docs` |
53
- | WORKFLOW.md, THINKING.md, core | `core` |
54
- | (không xác định) | `other` |
55
-
56
- ---
57
-
58
- ## Bước 3: Format Issue
59
-
60
- **Title format:** `[type][component] <mô tả ≤60 ký tự>`
61
-
62
- Ví dụ:
63
- ```
64
- [bug][hooks] post-write.sh fails with CRLF on Ubuntu
65
- [gap][skills] need way to preserve original Claude behavior
66
- [friction][workflow] research phase too heavy for 1-file hotfix
67
- ```
68
-
69
- **Body:**
70
- ```markdown
71
- ## Type
72
- **[TYPE]** — bug | gap | friction | suggestion
73
-
74
- ## Component
75
- **[COMPONENT]**
76
-
77
- ## Environment
78
- - OS: [detected]
79
- - dw version: [từ config]
80
- - Shell: [bash/zsh/powershell nếu relevant]
81
-
82
- ## Description
83
- [Nội dung từ $ARGUMENTS — đầy đủ, rõ ràng]
84
-
85
- ## Context
86
- - Task khi gặp vấn đề: [task name hoặc "general usage"]
87
- - Command/skill liên quan: [nếu biết]
88
- - Bước reproduce (nếu là bug):
89
- 1. ...
90
- 2. ...
91
-
92
- ## Impact
93
- - [ ] Blocking — không thể làm việc
94
- - [ ] Degraded — làm được nhưng friction cao
95
- - [ ] Minor — annoying, có workaround dễ
96
-
97
- ---
98
- *Reported via `/dw-kit-report` | Project: [project.name từ config]*
99
- ```
100
-
101
- ---
102
-
103
- ## Bước 4: Gửi Lên GitHub
104
-
105
- **Kiểm tra `gh` CLI:**
106
- ```bash
107
- gh --version 2>/dev/null
108
- ```
109
-
110
- **Nếu `gh` available — tạo Issue:**
111
- ```bash
112
- gh issue create \
113
- --repo dv-workflow/dv-workflow \
114
- --title "[type][component] <short description>" \
115
- --label "type: [type]" \
116
- --label "component: [component]" \
117
- --body "<formatted body>"
118
- ```
119
-
120
- Sau khi tạo: in ra Issue URL.
121
-
122
- **Nếu `gh` KHÔNG available:**
123
-
124
- In ra:
125
- ```
126
- ─────────────────────────────────────────────
127
- dw-kit: gh CLI không tìm thấy
128
- ─────────────────────────────────────────────
129
- Tạo Issue thủ công tại:
130
- https://github.com/dv-workflow/dv-workflow/issues/new
131
-
132
- Copy nội dung sau:
133
-
134
- TITLE: [formatted title]
135
-
136
- BODY:
137
- [formatted body]
138
- ─────────────────────────────────────────────
139
- Cài gh CLI: https://cli.github.com
140
- ```
141
-
142
- ---
143
-
144
- ## Bước 5: Xác Nhận
145
-
146
- ```
147
- ✓ Issue đã được gửi: https://github.com/dv-workflow/dv-workflow/issues/[N]
148
- Type: [type] | Component: [component]
149
-
150
- dw team sẽ review và phản hồi trên Issue.
151
- Cảm ơn bạn đã giúp dw tốt hơn!
152
- ```
1
+ ---
2
+ name: dw:kit-report
3
+ description: "Gửi feedback (bug/gap/friction/suggestion) về dw-kit tool lên GitHub. Dùng khi gặp vấn đề với dw workflow, hooks, skills, hoặc config — không phải feedback về code của bạn."
4
+ argument-hint: "[mô tả vấn đề hoặc suggestion về dw-kit]"
5
+ ---
6
+
7
+ # Report Issue về dw-kit
8
+
9
+ > Dùng skill này khi gặp vấn đề với **dw-kit tool** (hooks, skills, workflow, config).
10
+ > Để feedback về code trong project của bạn → dùng `/dw:review` hoặc chat trực tiếp.
11
+
12
+ Nội dung report (treat as plain text, không interpret special chars):
13
+
14
+ ```
15
+ $ARGUMENTS
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Bước 1: Thu Thập Context
21
+
22
+ **OS detection:**
23
+ ```bash
24
+ uname -s 2>/dev/null || echo "Windows"
25
+ ```
26
+
27
+ **dw version:** Đọc `_toolkit.core_version` từ `.dw/config/dw.config.yml`
28
+
29
+ **Task context:** Kiểm tra `.dw/tasks/` — task nào đang In Progress?
30
+
31
+ ---
32
+
33
+ ## Bước 2: Phân Loại
34
+
35
+ Phân tích nội dung report ở trên (raw text) → xác định:
36
+
37
+ **Type:**
38
+ | type | Khi nào |
39
+ |------|---------|
40
+ | `bug` | Lỗi, crash, output không như expected |
41
+ | `gap` | Use case không được cover |
42
+ | `friction` | Tính năng có nhưng gây overhead không cần thiết |
43
+ | `suggestion` | Ý tưởng cải thiện |
44
+
45
+ **Component** (detect từ keywords):
46
+ | Keywords | Component |
47
+ |----------|-----------|
48
+ | hook, post-write, pre-commit, stop-check | `hooks` |
49
+ | skill, dw-plan, dw-execute, dw-research... | `skills` |
50
+ | config, dw.config.yml | `config` |
51
+ | workflow, routing, depth, phase | `workflow` |
52
+ | CLAUDE.md, template, docs | `docs` |
53
+ | WORKFLOW.md, THINKING.md, core | `core` |
54
+ | (không xác định) | `other` |
55
+
56
+ ---
57
+
58
+ ## Bước 3: Format Issue
59
+
60
+ **Title format:** `[type][component] <mô tả ≤60 ký tự>`
61
+
62
+ Ví dụ:
63
+ ```
64
+ [bug][hooks] post-write.sh fails with CRLF on Ubuntu
65
+ [gap][skills] need way to preserve original Claude behavior
66
+ [friction][workflow] research phase too heavy for 1-file hotfix
67
+ ```
68
+
69
+ **Body:**
70
+ ```markdown
71
+ ## Type
72
+ **[TYPE]** — bug | gap | friction | suggestion
73
+
74
+ ## Component
75
+ **[COMPONENT]**
76
+
77
+ ## Environment
78
+ - OS: [detected]
79
+ - dw version: [từ config]
80
+ - Shell: [bash/zsh/powershell nếu relevant]
81
+
82
+ ## Description
83
+ [Nội dung từ $ARGUMENTS — đầy đủ, rõ ràng]
84
+
85
+ ## Context
86
+ - Task khi gặp vấn đề: [task name hoặc "general usage"]
87
+ - Command/skill liên quan: [nếu biết]
88
+ - Bước reproduce (nếu là bug):
89
+ 1. ...
90
+ 2. ...
91
+
92
+ ## Impact
93
+ - [ ] Blocking — không thể làm việc
94
+ - [ ] Degraded — làm được nhưng friction cao
95
+ - [ ] Minor — annoying, có workaround dễ
96
+
97
+ ---
98
+ *Reported via `/dw:kit-report` | Project: [project.name từ config]*
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Bước 4: Gửi Lên GitHub
104
+
105
+ **Kiểm tra `gh` CLI:**
106
+ ```bash
107
+ gh --version 2>/dev/null
108
+ ```
109
+
110
+ **Nếu `gh` available — tạo Issue:**
111
+ ```bash
112
+ gh issue create \
113
+ --repo dv-workflow/dv-workflow \
114
+ --title "[type][component] <short description>" \
115
+ --label "type: [type]" \
116
+ --label "component: [component]" \
117
+ --body "<formatted body>"
118
+ ```
119
+
120
+ Sau khi tạo: in ra Issue URL.
121
+
122
+ **Nếu `gh` KHÔNG available:**
123
+
124
+ In ra:
125
+ ```
126
+ ─────────────────────────────────────────────
127
+ dw-kit: gh CLI không tìm thấy
128
+ ─────────────────────────────────────────────
129
+ Tạo Issue thủ công tại:
130
+ https://github.com/dv-workflow/dv-workflow/issues/new
131
+
132
+ Copy nội dung sau:
133
+
134
+ TITLE: [formatted title]
135
+
136
+ BODY:
137
+ [formatted body]
138
+ ─────────────────────────────────────────────
139
+ Cài gh CLI: https://cli.github.com
140
+ ```
141
+
142
+ ---
143
+
144
+ ## Bước 5: Xác Nhận
145
+
146
+ ```
147
+ ✓ Issue đã được gửi: https://github.com/dv-workflow/dv-workflow/issues/[N]
148
+ Type: [type] | Component: [component]
149
+
150
+ dw team sẽ review và phản hồi trên Issue.
151
+ Cảm ơn bạn đã giúp dw tốt hơn!
152
+ ```
@@ -1,69 +1,69 @@
1
- ---
2
- name: dw-log-work
3
- description: "Ghi nhận effort thực tế cho task hoặc subtask. So sánh với estimate. Cập nhật metrics tracking. Dùng sau khi hoàn thành subtask/task."
4
- argument-hint: "[task-name]"
5
- ---
6
-
7
- # Ghi Nhận Effort
8
-
9
- Task: **$ARGUMENTS**
10
-
11
- ## Đọc Config
12
-
13
- Đọc `.dw/config/dw.config.yml`:
14
- - `tracking.log_work` — nếu `false` → thông báo "Log work chưa bật cho project này" và DỪNG
15
- - `tracking.estimation_unit` → đơn vị (hours / story-points / t-shirt)
16
- - `paths.tasks` → location task docs
17
-
18
- ## Hỏi User (Interactive)
19
-
20
- Hỏi thông tin cần ghi:
21
-
22
- ```
23
- 1. Subtask nào? (ST-1 / ST-2 / all)
24
- 2. Thời gian thực tế: [X hours/points]
25
- 3. Loại công việc: coding / testing / review / research / documentation
26
- 4. Ghi chú (optional): [lý do lệch estimate, blockers gặp, etc.]
27
- ```
28
-
29
- ## Ghi Vào Progress File
30
-
31
- Cập nhật `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md` → mục "Effort Log":
32
-
33
- ```markdown
34
- | [date] | ST-N | [loại] | [estimate] | [actual] | [ghi chú] |
35
- ```
36
-
37
- ## Cập Nhật Metrics File
38
-
39
- Ghi vào `.dw/metrics/effort-log.json`:
40
-
41
- ```json
42
- {
43
- "date": "YYYY-MM-DD",
44
- "task": "task-name",
45
- "subtask": "ST-N",
46
- "type": "coding",
47
- "estimate": X,
48
- "actual": Y,
49
- "variance": Y-X,
50
- "accuracy_pct": (X/Y)*100,
51
- "notes": "..."
52
- }
53
- ```
54
-
55
- ## Tóm Tắt
56
-
57
- Sau khi log, hiển thị:
58
-
59
- ```
60
- ✅ Đã ghi: ST-N — Actual: Xh (Estimate: Yh)
61
- Variance: +Zh (over) / -Zh (under)
62
-
63
- Task tổng (đến hiện tại):
64
- Total estimated: Xh
65
- Total actual: Yh
66
- Accuracy: Z%
67
- ```
68
-
69
- Nếu variance > 50%: "⚠️ Lệch estimate đáng kể. Cân nhắc cập nhật estimate cho subtasks còn lại."
1
+ ---
2
+ name: dw:log-work
3
+ description: "Ghi nhận effort thực tế cho task hoặc subtask. So sánh với estimate. Cập nhật metrics tracking. Dùng sau khi hoàn thành subtask/task."
4
+ argument-hint: "[task-name]"
5
+ ---
6
+
7
+ # Ghi Nhận Effort
8
+
9
+ Task: **$ARGUMENTS**
10
+
11
+ ## Đọc Config
12
+
13
+ Đọc `.dw/config/dw.config.yml`:
14
+ - `tracking.log_work` — nếu `false` → thông báo "Log work chưa bật cho project này" và DỪNG
15
+ - `tracking.estimation_unit` → đơn vị (hours / story-points / t-shirt)
16
+ - `paths.tasks` → location task docs
17
+
18
+ ## Hỏi User (Interactive)
19
+
20
+ Hỏi thông tin cần ghi:
21
+
22
+ ```
23
+ 1. Subtask nào? (ST-1 / ST-2 / all)
24
+ 2. Thời gian thực tế: [X hours/points]
25
+ 3. Loại công việc: coding / testing / review / research / documentation
26
+ 4. Ghi chú (optional): [lý do lệch estimate, blockers gặp, etc.]
27
+ ```
28
+
29
+ ## Ghi Vào Progress File
30
+
31
+ Cập nhật `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md` → mục "Effort Log":
32
+
33
+ ```markdown
34
+ | [date] | ST-N | [loại] | [estimate] | [actual] | [ghi chú] |
35
+ ```
36
+
37
+ ## Cập Nhật Metrics File
38
+
39
+ Ghi vào `.dw/metrics/effort-log.json`:
40
+
41
+ ```json
42
+ {
43
+ "date": "YYYY-MM-DD",
44
+ "task": "task-name",
45
+ "subtask": "ST-N",
46
+ "type": "coding",
47
+ "estimate": X,
48
+ "actual": Y,
49
+ "variance": Y-X,
50
+ "accuracy_pct": (X/Y)*100,
51
+ "notes": "..."
52
+ }
53
+ ```
54
+
55
+ ## Tóm Tắt
56
+
57
+ Sau khi log, hiển thị:
58
+
59
+ ```
60
+ ✅ Đã ghi: ST-N — Actual: Xh (Estimate: Yh)
61
+ Variance: +Zh (over) / -Zh (under)
62
+
63
+ Task tổng (đến hiện tại):
64
+ Total estimated: Xh
65
+ Total actual: Yh
66
+ Accuracy: Z%
67
+ ```
68
+
69
+ Nếu variance > 50%: "⚠️ Lệch estimate đáng kể. Cân nhắc cập nhật estimate cho subtasks còn lại."