@edupia-tutor/spec-driven-docs 0.14.0 → 0.14.2

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 (162) hide show
  1. package/bin/index.js +12 -1
  2. package/commands/debug.md +436 -436
  3. package/commands/debug.tmpl +111 -111
  4. package/commands/define-product.md +350 -345
  5. package/commands/define-product.tmpl +69 -64
  6. package/commands/dev-gen-test.md +365 -365
  7. package/commands/dev-gen-test.tmpl +63 -63
  8. package/commands/dev-run-test.md +376 -376
  9. package/commands/dev-run-test.tmpl +74 -74
  10. package/commands/dev-smoke-test.md +341 -341
  11. package/commands/dev-smoke-test.tmpl +60 -60
  12. package/commands/fix-bug.md +403 -403
  13. package/commands/fix-bug.tmpl +78 -78
  14. package/commands/generate-bdd.md +513 -513
  15. package/commands/generate-bdd.tmpl +211 -211
  16. package/commands/generate-code.md +481 -483
  17. package/commands/generate-code.tmpl +179 -181
  18. package/commands/generate-design-spec.md +497 -497
  19. package/commands/generate-design-spec.tmpl +220 -220
  20. package/commands/generate-prd.md +452 -400
  21. package/commands/generate-prd.tmpl +50 -200
  22. package/commands/generate-spec-manifest.md +340 -340
  23. package/commands/generate-spec-manifest.tmpl +59 -59
  24. package/commands/generate-tech-docs.md +365 -365
  25. package/commands/generate-tech-docs.tmpl +84 -84
  26. package/commands/learn.md +347 -347
  27. package/commands/learn.tmpl +22 -22
  28. package/commands/map-testids.md +322 -322
  29. package/commands/map-testids.tmpl +41 -41
  30. package/commands/propose-scenario.md +335 -335
  31. package/commands/propose-scenario.tmpl +54 -54
  32. package/commands/qc-analyze.md +323 -324
  33. package/commands/qc-analyze.tmpl +42 -43
  34. package/commands/qc-design-test.md +304 -304
  35. package/commands/qc-design-test.tmpl +23 -23
  36. package/commands/qc-plan.md +297 -297
  37. package/commands/qc-plan.tmpl +16 -16
  38. package/commands/qc-report.md +302 -302
  39. package/commands/qc-report.tmpl +21 -21
  40. package/commands/qc-review.md +298 -298
  41. package/commands/qc-review.tmpl +17 -17
  42. package/commands/qc-run-test.md +337 -337
  43. package/commands/qc-run-test.tmpl +35 -35
  44. package/commands/refine-prd.md +428 -430
  45. package/commands/refine-prd.tmpl +62 -62
  46. package/commands/report-bug.md +351 -351
  47. package/commands/report-bug.tmpl +70 -70
  48. package/commands/review-code.md +364 -364
  49. package/commands/review-code.tmpl +39 -39
  50. package/commands/review-context.md +578 -580
  51. package/commands/review-context.tmpl +212 -212
  52. package/commands/review-tech-docs.md +427 -427
  53. package/commands/review-tech-docs.tmpl +146 -146
  54. package/commands/setup-ai-first.md +239 -239
  55. package/commands/setup-ai-first.tmpl +133 -133
  56. package/commands/sync.md +145 -145
  57. package/commands/sync.tmpl +93 -93
  58. package/commands/update-framework.md +88 -88
  59. package/commands/update-framework.tmpl +36 -36
  60. package/commands/validate-traces.md +381 -381
  61. package/commands/validate-traces.tmpl +100 -100
  62. package/core/FRAMEWORK_VERSION +1 -1
  63. package/core/commands/debug.md +436 -436
  64. package/core/commands/define-product.md +350 -345
  65. package/core/commands/dev-gen-test.md +365 -365
  66. package/core/commands/dev-run-test.md +376 -376
  67. package/core/commands/dev-smoke-test.md +341 -341
  68. package/core/commands/fix-bug.md +403 -403
  69. package/core/commands/generate-bdd.md +513 -513
  70. package/core/commands/generate-code.md +481 -483
  71. package/core/commands/generate-design-spec.md +497 -497
  72. package/core/commands/generate-prd.md +452 -400
  73. package/core/commands/generate-spec-manifest.md +340 -340
  74. package/core/commands/generate-tech-docs.md +365 -365
  75. package/core/commands/learn.md +347 -347
  76. package/core/commands/map-testids.md +322 -322
  77. package/core/commands/propose-scenario.md +335 -335
  78. package/core/commands/qc-analyze.md +323 -324
  79. package/core/commands/qc-design-test.md +304 -304
  80. package/core/commands/qc-plan.md +297 -297
  81. package/core/commands/qc-report.md +302 -302
  82. package/core/commands/qc-review.md +298 -298
  83. package/core/commands/qc-run-test.md +337 -337
  84. package/core/commands/refine-prd.md +428 -430
  85. package/core/commands/report-bug.md +351 -351
  86. package/core/commands/review-code.md +364 -364
  87. package/core/commands/review-context.md +578 -580
  88. package/core/commands/review-tech-docs.md +427 -427
  89. package/core/commands/setup-ai-first.md +239 -239
  90. package/core/commands/sync.md +145 -145
  91. package/core/commands/update-framework.md +88 -88
  92. package/core/commands/validate-traces.md +381 -381
  93. package/core/skills/code/SKILL.md +389 -389
  94. package/core/skills/debug/SKILL.md +391 -391
  95. package/core/skills/design-spec/SKILL.md +318 -318
  96. package/core/skills/discovery/SKILL.md +7 -547
  97. package/core/skills/prd/SKILL.md +298 -394
  98. package/core/skills/setup-ai-first/SKILL.md +80 -80
  99. package/core/skills/spec/SKILL.md +178 -178
  100. package/core/skills/test/SKILL.md +604 -604
  101. package/core/steps/capture-lesson.md +44 -44
  102. package/core/steps/context-loader.md +175 -175
  103. package/core/steps/gate.md +54 -54
  104. package/core/steps/report-footer.md +52 -52
  105. package/core/steps/review-fanout.md +85 -87
  106. package/core/steps/spawn-agent.md +45 -45
  107. package/core/steps/trace-mirror.md +21 -21
  108. package/core/templates/architecture.template.md +37 -37
  109. package/core/templates/design-spec.template.md +77 -77
  110. package/core/templates/platform-guide.template.md +47 -47
  111. package/core/templates/prd.template.md +107 -232
  112. package/core/templates/product-definition.template.md +101 -88
  113. package/core/templates/project-context.yaml +2 -2
  114. package/docs/01-getting-started/core-concepts.md +1 -1
  115. package/docs/01-getting-started/quickstart.md +7 -7
  116. package/docs/02-guides/developer/bdd-and-trace.md +1 -1
  117. package/docs/02-guides/developer/scenarios.md +5 -5
  118. package/docs/02-guides/product-owner/handoff-checklist.md +1 -1
  119. package/docs/02-guides/product-owner/scenarios.md +23 -23
  120. package/docs/02-guides/tester/bug-reporting.md +2 -2
  121. package/docs/02-guides/tester/reading-specs.md +2 -2
  122. package/docs/02-guides/tester/scenarios.md +1 -1
  123. package/docs/02-guides/tester/spec-manifest.md +3 -3
  124. package/docs/02-guides/tester/workflow.md +1 -1
  125. package/docs/03-concepts/architecture.md +3 -3
  126. package/docs/03-concepts/pipeline.md +3 -3
  127. package/docs/04-operations/publishing.md +20 -3
  128. package/docs/04-operations/sync-and-update.md +5 -5
  129. package/docs/05-reference/command-cheatsheet.md +2 -2
  130. package/docs/05-reference/commands.md +8 -8
  131. package/package.json +1 -1
  132. package/scripts/migrate-specs.js +5 -3
  133. package/scripts/rename-prd-files.js +174 -0
  134. package/skills/code/SKILL.md +389 -389
  135. package/skills/code/SKILL.tmpl +56 -56
  136. package/skills/debug/SKILL.md +391 -391
  137. package/skills/debug/SKILL.tmpl +60 -60
  138. package/skills/design-spec/SKILL.md +318 -318
  139. package/skills/design-spec/SKILL.tmpl +37 -37
  140. package/skills/discovery/SKILL.md +7 -547
  141. package/skills/discovery/SKILL.tmpl +7 -140
  142. package/skills/prd/SKILL.md +298 -394
  143. package/skills/prd/SKILL.tmpl +40 -151
  144. package/skills/setup-ai-first/SKILL.md +80 -80
  145. package/skills/setup-ai-first/SKILL.tmpl +28 -28
  146. package/skills/spec/SKILL.md +178 -178
  147. package/skills/spec/SKILL.tmpl +20 -20
  148. package/skills/test/SKILL.md +604 -604
  149. package/skills/test/SKILL.tmpl +44 -44
  150. package/steps/capture-lesson.md +44 -44
  151. package/steps/context-loader.md +175 -175
  152. package/steps/gate.md +54 -54
  153. package/steps/report-footer.md +52 -52
  154. package/steps/review-fanout.md +85 -87
  155. package/steps/spawn-agent.md +45 -45
  156. package/steps/trace-mirror.md +21 -21
  157. package/templates/architecture.template.md +37 -37
  158. package/templates/design-spec.template.md +77 -77
  159. package/templates/platform-guide.template.md +47 -47
  160. package/templates/prd.template.md +107 -232
  161. package/templates/product-definition.template.md +101 -88
  162. package/templates/project-context.yaml +2 -2
@@ -1,158 +1,163 @@
1
- # /define-product — Feature Discovery (8-Phase Q&A)
1
+ # /define-product — Khám phá tính năng (Q&A 8 Phase)
2
2
 
3
3
  ## Gate
4
4
  {{include:steps/gate.md}}
5
5
 
6
- *Note: For this command, there is no input file to resolve in Step 1. Skip to Step 2 (context load) and then ask: **"Ticket ID and feature name? (e.g., LOYAL-29 Loyalty Points)"***
6
+ *Lưu ý: Với lệnh này, không file input cần phân giải Bước 1. Bỏ qua sang Bước 2 (nạp context) rồi hỏi: **"Ticket ID tên feature? (vd: LOYAL-29 Loyalty Points)"***
7
7
 
8
8
  ## Context
9
9
  {{include:steps/context-loader.md}}
10
10
 
11
11
  ---
12
12
 
13
- ## Phase 0 — Knowledge Sync *(AI fills automatically, no PO input needed)*
13
+ ## Phase 0 — Knowledge Sync *(AI tự điền — bối cảnh hệ thống, KHÔNG phải yêu cầu nghiệp vụ; không cần input PO)*
14
14
 
15
- AI scans the project and writes:
15
+ AI quét dự án ghi:
16
16
 
17
- - **Related Entities** — list entities from existing PRDs/domain-knowledge that relate to this feature.
18
- - **Related Modules** — list affected modules/services.
19
- - **Existing Rules / Logic** — rules from existing PRDs that this feature must respect.
20
- - **Terminology Normalization** — map any terms found in PO input to canonical terms from business-dictionary.md.
17
+ - **Khái niệm / dữ liệu nghiệp vụ liên quan** — liệt khái niệm từ các PRD/domain-knowledge sẵn liên quan tới feature này.
18
+ - **Phần hệ thống / feature liên quan** — liệt phần hệ thống/feature bị ảnh hưởng.
19
+ - **Rule / Logic có sẵn** — các rule từ PRD sẵn feature này phải tôn trọng.
20
+ - **Chuẩn hoá thuật ngữ** — map mọi thuật ngữ trong input PO về thuật ngữ chuẩn từ business-dictionary.md.
21
21
 
22
22
  ```
23
- | Term in PO input | Canonical term (business-dictionary) |
24
- |------------------|--------------------------------------|
25
- | {original} | {canonical} |
23
+ | Thuật ngữ trong input PO | Thuật ngữ chuẩn (business-dictionary) |
24
+ |--------------------------|---------------------------------------|
25
+ | {thuật ngữ gốc} | {thuật ngữ chuẩn} |
26
26
  ```
27
27
 
28
- Store this terminology map in the output product-definition file under a `## Terminology Map` section — `/generate-prd` will reference it during its Terminology Rules step to ensure consistency.
28
+ Lưu bản đồ thuật ngữ này vào file product-definition output dưới section `### Chuẩn hoá thuật ngữ` (trong Phase 0) — `/generate-prd` sẽ tham chiếu trong bước **Quy tắc thuật ngữ** để đảm bảo nhất quán.
29
29
 
30
30
  ---
31
31
 
32
32
  ## Phase 1 — Feature Definition *(CHECKPOINT 1)*
33
33
 
34
- Ask in order, one at a time:
34
+ Hỏi **lần lượt từng câu một**, đợi PO trả lời rồi mới hỏi câu kế. Giữ giọng nghiệp vụ, thân thiện; nếu PO lúng túng, đưa một dụ ngắn để gợi ý. Tránh hỏi về giải pháp kỹ thuật ở phase này.
35
35
 
36
- 1. **Context**: Background / reason why this feature is needed?
37
- 2. **Problem**: Specific problem to solve?
38
- 3. **Goal**: What objective does this feature achieve?
39
- 4. **Actors**: Who are the users? (list roles, mark Primary/Secondary)
40
- 5. **Scope**: What does this feature do? (one function per lineonly what is in this ticket)
41
- 6. **User Story**: Confirm in format:
42
- ```
43
- As a {User role}
44
- I want to {User goal}
45
- So that {Business value}
46
- ```
36
+ 1. **Context**: Bối cảnh / do sao cần feature này?
37
+ 2. **Problem**: Vấn đề cụ thể cần giải quyết?
38
+ 3. **Goal**: Khi feature chạy ổn, kết quả nghiệp vụ bạn muốn thấy là gì? Mô tả *thành quả*, chưa cần cách làm.
39
+ 4. **Actors**: Những ai sẽ dùng feature này? Liệt kê từng vai trò, và đánh dấu ai là người dùng chính (Primary), ai phụ (Secondary).
40
+ 5. **In Scope**: Feature này làm gì? (mỗi dòng một chức năng chỉ những thuộc ticket này)
41
+ 6. **Out of Scope**: Cái KHÔNG làm trong ticket này? Ghi rõ kèm lý do hoặc để dành pha/ticket sau — để tránh phình phạm vi.
42
+ 7. **User Story**: Xác nhận theo format (mỗi ý một bullet):
43
+ - **Là một (As a)** {vai trò}
44
+ - **Tôi muốn (I want to)** {mục tiêu}
45
+ - **Để (So that)** {giá trị nghiệp vụ}
46
+ 8. **Phụ thuộc liên service**: Để chạy được, feature có cần **dữ liệu hay năng lực** gì từ feature/team khác không? Mô tả ở mức nghiệp vụ (cần gì, từ ai, vì sao) — chưa cần nói API hay kỹ thuật. Nếu không có → trả lời "Không có".
47
47
 
48
- Summarizeconfirmwrite `✅ PO Confirmed: Yes`proceed.
48
+ Sau câu 8 **tóm tắt lại toàn bộ** cho PO chờ xác nhận → ghi `✅ PO xác nhận: Có`sang Phase 2.
49
49
 
50
50
  ---
51
51
 
52
52
  ## Phase 2 — User Flow Definition *(CHECKPOINT 2)*
53
53
 
54
- Ask:
55
- 1. **Entry Point**: Where does the user start interacting with this feature?
56
- 2. **Flow Steps**: Describe each step (use table):
54
+ Hỏi:
55
+ 1. **Entry Point**: Người dùng bắt đầu tương tác với feature này ở đâu?
56
+ 2. **Flow Steps**: tả từng bước (dùng bảng):
57
57
  ```
58
- | Step | Action (user) | Screen / State | Notes |
58
+ | Bước | Hành động | Trạng thái/Kết quả nghiệp vụ | Ghi chú |
59
59
  ```
60
- 3. **Exit Point**: What is the final result when the flow completes?
60
+ 3. **Exit Point**: Kết quả cuối khi flow hoàn thành gì?
61
+ 4. **Edge Cases**: Các kịch bản thất bại nghiệp vụ ngoài happy path? (input thiếu, điều kiện không thoả, thao tác đồng thời, phụ thuộc không sẵn sàng → kết quả nghiệp vụ kỳ vọng)
61
62
 
62
- Confirmwrite `✅ PO Confirmed: Yes`proceed.
63
+ Xác nhận ghi `✅ PO xác nhận: Có`tiếp tục.
63
64
 
64
65
  ---
65
66
 
66
67
  ## Phase 3 — Clarification Log *(CHECKPOINT 3)*
67
68
 
68
- Based on Phases 1-2, AI identifies gaps and asks follow-up questions. Continue rounds until no Unresolved Items remain.
69
+ Dựa trên Phase 1-2, AI xác định gap hỏi các câu follow-up. Tiếp tục các vòng cho tới khi không còn Mục chưa giải quyết.
69
70
 
70
71
  ```
71
- ### Round {N}
72
- | # | Category | Question | PO Answer |
72
+ ### Vòng {N}
73
+ | # | Nhóm | Câu hỏi | PO trả lời |
73
74
  |---|----------------|------------|------------|
74
- | 1 | Context/Flow/Logic | {question} | {answer} |
75
+ | 1 | Context/Flow/Logic | {câu hỏi} | {trả lời} |
75
76
  ```
76
77
 
77
- **BLOCK**: If Unresolved Items remainMUST NOT proceed to Phase 4.
78
+ **BLOCK**: Nếu còn Mục chưa giải quyết KHÔNG được sang Phase 4.
78
79
 
79
- ### Unresolved Items
80
- - {itemor "None"}
80
+ ### Mục chưa giải quyết
81
+ - {mụchoặc "None"}
81
82
 
82
- When all Unresolved Items are resolvedwrite `✅ CHECKPOINT 3: No Unresolved Items` → proceed to Phase 4.
83
+ Khi mọi Mục chưa giải quyết đã xử lý ghi `✅ CHECKPOINT 3: Không còn mục tồn đọng` → sang Phase 4.
83
84
 
84
85
  ---
85
86
 
86
87
  ## Phase 4 — Business Rules *(CHECKPOINT 4)*
87
88
 
88
- Derive from Phases 1-3. Each BR = one rule (WHAT the system must/must not do):
89
+ Suy ra từ Phase 1-3. Mỗi BR = một quy tắc (hệ thống PHẢI / KHÔNG được làm gì — WHAT):
89
90
 
90
91
  ```
91
- | Rule ID | Action / Trigger | Rule | Condition |
92
+ | Rule ID | Hành động/Trigger | Quy tắc | Điều kiện |
92
93
  |---------|---------------------|-------------------------------|---------------------|
93
- | BR-1 | {action from flow} | System MUST/MUST NOT... | {applicable condition} |
94
+ | BR-1 | {hành động từ flow} | System MUST/MUST NOT... | {điều kiện áp dụng} |
94
95
  ```
95
96
 
96
- Confirmwrite `✅ PO Confirmed: Yes`proceed.
97
+ Xác nhận ghi `✅ PO xác nhận: Có`tiếp tục.
97
98
 
98
99
  ---
99
100
 
100
101
  ## Phase 5 — Business Logic *(CHECKPOINT 5)*
101
102
 
102
- Map each BR to HOW the system executes it:
103
+ Map mỗi BR sang **logic nghiệp vụ** thực thi nó (rẽ nhánh / công thức / điều kiện — KHÔNG mô tả thay đổi dữ liệu hay hành vi UI; đó là kỹ thuật/design):
103
104
 
104
105
  ```
105
- | Rule ID | System Behavior | Data State Change | UI Behavior | Error Handling |
106
- |---------|---------------------------------------|---------------------|-------------------------|------------------------|
107
- | BR-1 | {how system processes when triggers} | {what data changes} | {enable/disable/show...}| {error message/action} |
106
+ | Rule ID | Logic nghiệp vụ (rẽ nhánh / công thức / điều kiện) | Thông báo/kết quả nghiệp vụ khi lỗi |
107
+ |---------|---------------------------------------------------|-------------------------------------|
108
+ | BR-1 | {logic nghiệp vụ khi rule kích hoạt} | {vd: báo "Số không đủ"} |
108
109
  ```
109
110
 
110
- Confirmwrite `✅ PO Confirmed: Yes`proceed.
111
+ Xác nhận ghi `✅ PO xác nhận: Có`tiếp tục.
111
112
 
112
113
  ---
113
114
 
114
115
  ## Phase 6 — Acceptance Criteria *(CHECKPOINT 6)*
115
116
 
116
- Derive from BRs + User Story. Each AC must be testable (clear pass/fail):
117
+ Suy ra từ BR + User Story. Mỗi AC phải testable (pass/fail rõ ràng):
117
118
 
118
119
  ```
119
- | AC ID | Description | Expected Behavior | Derived from |
120
- |-------|-------------------------|---------------------------|--------------|
121
- | AC-1 | {criterion description} | {what system should do} | BR-{N} |
120
+ | AC ID | Mô tả | Hành vi kỳ vọng | Bắt nguồn từ |
121
+ |-------|-------------------------|----------------------------|--------------|
122
+ | AC-1 | { tả tiêu chí} | {hành vi hệ thống cần làm} | BR-{N} |
122
123
  ```
123
124
 
124
- Confirmwrite `✅ PO Confirmed: Yes`proceed.
125
+ Xác nhận ghi `✅ PO xác nhận: Có`tiếp tục.
125
126
 
126
127
  ---
127
128
 
128
129
  ## Phase 7 — Validation Report
129
130
 
130
- Generate coverage matrix automatically:
131
+ Tự sinh ma trận độ phủ:
131
132
 
132
133
  ```
133
- | Flow Action | Has Rule? | Has Logic? | Has AC? | Status |
134
- |-------------|-----------|------------|---------|---------|
135
- | {Action 1} | ✅/❌ | ✅/❌ | ✅/❌ | OK/GAP |
134
+ | Hành động Flow | Rule? | Logic? | AC? | Status |
135
+ |----------------|----------|-----------|--------|--------|
136
+ | {Hành động 1} | ✅/❌ | ✅/❌ | ✅/❌ | OK/GAP |
136
137
  ```
137
138
 
138
- - **Conflicts Detected**: list any conflicting rules, or "None".
139
- - **Missing Items**: list gaps, or "None".
139
+ - **Xung đột phát hiện**: liệt các rule xung đột, hoặc "None".
140
+ - **Mục còn thiếu**: liệt kê gap, hoặc "None".
140
141
 
141
- If any GAP found alert PO and resolve before marking completed.
142
+ Nếu phát hiện GAP → cảnh báo PO giải quyết trước khi đánh dấu completed.
142
143
 
143
144
  ---
144
145
 
145
146
  ## Output
146
147
 
147
- Write `{paths.product_definitions_dir}/{TICKET-ID}-{slug}.md` following `templates/product-definition.template.md`.
148
+ Ghi `{paths.product_definitions_dir}/{TICKET-ID}-{slug}.md` theo `templates/product-definition.template.md`.
149
+
150
+ Điền tất cả section bằng dữ liệu thu thập qua các phase.
148
151
 
149
- Fill all sections with data gathered across phases.
150
- Set `Status: completed` when Phase 7 passes with no GAPs.
152
+ **Cập nhật Metadata theo tiến độ (cho phép resume):**
153
+ - Sau mỗi CHECKPOINT phase được chốt (`✅ PO xác nhận: Có`, hoặc với Phase 3 là `✅ CHECKPOINT 3: Không còn mục tồn đọng`) cập nhật `Completed Phase` = số phase vừa xong và giữ `Status: in-progress`.
154
+ - Khi Phase 7 pass mà không còn GAP → đặt `Completed Phase: 7` và `Status: completed`.
155
+ - Nếu discovery bị ngắt giữa chừng, file vẫn được ghi với `Completed Phase` phản ánh phase cao nhất đã xác nhận — buổi sau resume tiếp từ phase kế tiếp.
151
156
 
152
157
  {{include:steps/report-footer.md}}
153
158
 
154
159
  ```
155
- /define-product Complete
160
+ /define-product Hoàn tất
156
161
  File: {paths.product_definitions_dir}/{TICKET-ID}-{slug}.md
157
162
  Next: /generate-prd {paths.product_definitions_dir}/{TICKET-ID}-{slug}.md
158
163
  ```