@educa-corp/sdd-framework 0.6.0 → 0.7.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 (205) hide show
  1. package/bin/gate-trace.js +25 -2
  2. package/bin/index.js +32 -5
  3. package/bin/lint-trace.js +41 -0
  4. package/bin/self-check.js +430 -3
  5. package/bin/trace-schema.json +391 -30
  6. package/core/FRAMEWORK_VERSION +1 -1
  7. package/{commands/extend-prd.md → core/commands/amend-prd.md} +205 -173
  8. package/core/commands/dev-run-test.md +47 -9
  9. package/core/commands/extend-prd.md +39 -12
  10. package/core/commands/generate-bdd.md +43 -4
  11. package/core/commands/generate-code.md +33 -0
  12. package/core/commands/generate-tech-docs.md +34 -2
  13. package/core/commands/qc-run-test.md +29 -3
  14. package/core/commands/refine-prd.md +13 -2
  15. package/core/commands/review-context.md +43 -8
  16. package/core/commands/sync.md +105 -1
  17. package/core/commands/validate-traces.md +284 -11
  18. package/core/rules/workflow.md +34 -0
  19. package/core/steps/context-loader.md +26 -5
  20. package/core/templates/feature.template +1 -1
  21. package/docs/02-concepts/architecture.md +36 -0
  22. package/docs/04-reference/commands.md +148 -134
  23. package/docs/04-reference/trace-schema.md +39 -0
  24. package/docs/explain/02b-extend-prd.md +1 -1
  25. package/docs/explain/02c-amend-prd.md +152 -0
  26. package/docs/explain/28-sync.md +25 -0
  27. package/docs/explain/README.md +136 -135
  28. package/package.json +1 -8
  29. package/commands/debug.md +0 -529
  30. package/commands/debug.tmpl +0 -260
  31. package/commands/define-product.md +0 -438
  32. package/commands/define-product.tmpl +0 -225
  33. package/commands/dev-gen-test.md +0 -700
  34. package/commands/dev-gen-test.tmpl +0 -490
  35. package/commands/dev-run-test.md +0 -435
  36. package/commands/dev-run-test.tmpl +0 -225
  37. package/commands/dev-smoke-test.md +0 -374
  38. package/commands/dev-smoke-test.tmpl +0 -217
  39. package/commands/extend-prd.tmpl +0 -273
  40. package/commands/fix-bug.md +0 -519
  41. package/commands/fix-bug.tmpl +0 -197
  42. package/commands/generate-architecture.md +0 -354
  43. package/commands/generate-architecture.tmpl +0 -197
  44. package/commands/generate-bdd.md +0 -923
  45. package/commands/generate-bdd.tmpl +0 -590
  46. package/commands/generate-code.md +0 -859
  47. package/commands/generate-code.tmpl +0 -649
  48. package/commands/generate-design-spec.md +0 -737
  49. package/commands/generate-design-spec.tmpl +0 -524
  50. package/commands/generate-prd.md +0 -722
  51. package/commands/generate-prd.tmpl +0 -226
  52. package/commands/generate-spec-manifest.md +0 -321
  53. package/commands/generate-spec-manifest.tmpl +0 -164
  54. package/commands/generate-tech-docs.md +0 -920
  55. package/commands/generate-tech-docs.tmpl +0 -273
  56. package/commands/learn.md +0 -399
  57. package/commands/learn.tmpl +0 -130
  58. package/commands/map-testids.md +0 -238
  59. package/commands/map-testids.tmpl +0 -81
  60. package/commands/propose-scenario.md +0 -359
  61. package/commands/propose-scenario.tmpl +0 -202
  62. package/commands/qc-analyze.md +0 -269
  63. package/commands/qc-analyze.tmpl +0 -112
  64. package/commands/qc-design-test.md +0 -226
  65. package/commands/qc-design-test.tmpl +0 -69
  66. package/commands/qc-plan.md +0 -206
  67. package/commands/qc-plan.tmpl +0 -49
  68. package/commands/qc-report.md +0 -217
  69. package/commands/qc-report.tmpl +0 -60
  70. package/commands/qc-review.md +0 -210
  71. package/commands/qc-review.tmpl +0 -53
  72. package/commands/qc-run-test.md +0 -326
  73. package/commands/qc-run-test.tmpl +0 -116
  74. package/commands/refine-prd.md +0 -653
  75. package/commands/refine-prd.tmpl +0 -281
  76. package/commands/report-bug.md +0 -305
  77. package/commands/report-bug.tmpl +0 -148
  78. package/commands/review-code.md +0 -415
  79. package/commands/review-code.tmpl +0 -146
  80. package/commands/review-context.md +0 -902
  81. package/commands/review-context.tmpl +0 -530
  82. package/commands/review-tech-docs.md +0 -561
  83. package/commands/review-tech-docs.tmpl +0 -404
  84. package/commands/setup-ai-first.md +0 -602
  85. package/commands/setup-ai-first.tmpl +0 -450
  86. package/commands/sync.md +0 -430
  87. package/commands/sync.tmpl +0 -429
  88. package/commands/update-framework.md +0 -203
  89. package/commands/update-framework.tmpl +0 -202
  90. package/commands/validate-traces.md +0 -1077
  91. package/commands/validate-traces.tmpl +0 -920
  92. package/hooks/data-guard.js +0 -232
  93. package/hooks/settings.json +0 -19
  94. package/modules/android-compose/module.yaml +0 -13
  95. package/modules/android-compose/stack-profile.yaml +0 -57
  96. package/modules/angular/architecture-snippets/component-patterns.md +0 -187
  97. package/modules/angular/module.yaml +0 -6
  98. package/modules/angular/stack-profile.yaml +0 -38
  99. package/modules/context-engineering/architecture-snippets/context-design.md +0 -119
  100. package/modules/context-engineering/module.yaml +0 -9
  101. package/modules/context-engineering/stack-profile.yaml +0 -61
  102. package/modules/dotnet/architecture-snippets/clean-arch.md +0 -160
  103. package/modules/dotnet/module.yaml +0 -6
  104. package/modules/dotnet/stack-profile.yaml +0 -50
  105. package/modules/flutter/module.yaml +0 -14
  106. package/modules/flutter/stack-profile.yaml +0 -59
  107. package/modules/golang/architecture-snippets/domain-layout.md +0 -283
  108. package/modules/golang/module.yaml +0 -6
  109. package/modules/golang/stack-profile.yaml +0 -40
  110. package/modules/ios-swiftui/module.yaml +0 -13
  111. package/modules/ios-swiftui/stack-profile.yaml +0 -55
  112. package/modules/java-spring/architecture-snippets/layered-arch.md +0 -201
  113. package/modules/java-spring/module.yaml +0 -15
  114. package/modules/java-spring/stack-profile.yaml +0 -28
  115. package/modules/nextjs/architecture-snippets/app-router-patterns.md +0 -269
  116. package/modules/nextjs/module.yaml +0 -14
  117. package/modules/nextjs/stack-profile.yaml +0 -74
  118. package/modules/nuxt/module.yaml +0 -14
  119. package/modules/nuxt/stack-profile.yaml +0 -58
  120. package/modules/phaser-game/architecture-snippets/phaser-scene-patterns.md +0 -646
  121. package/modules/phaser-game/module.yaml +0 -15
  122. package/modules/phaser-game/stack-profile.yaml +0 -90
  123. package/modules/php-laravel/architecture-snippets/service-repository.md +0 -302
  124. package/modules/php-laravel/module.yaml +0 -15
  125. package/modules/php-laravel/stack-profile.yaml +0 -56
  126. package/modules/qc-playwright/stack-profile.yaml +0 -66
  127. package/modules/react/architecture-snippets/hooks-query-patterns.md +0 -254
  128. package/modules/react/module.yaml +0 -14
  129. package/modules/react/stack-profile.yaml +0 -63
  130. package/modules/react-native/module.yaml +0 -14
  131. package/modules/react-native/stack-profile.yaml +0 -56
  132. package/modules/vue/module.yaml +0 -14
  133. package/modules/vue/stack-profile.yaml +0 -65
  134. package/rules/data-protection.md +0 -80
  135. package/rules/workflow.md +0 -99
  136. package/skills/code/SKILL.md +0 -19
  137. package/skills/code/SKILL.tmpl +0 -19
  138. package/skills/debug/SKILL.md +0 -19
  139. package/skills/debug/SKILL.tmpl +0 -19
  140. package/skills/design-spec/SKILL.md +0 -11
  141. package/skills/design-spec/SKILL.tmpl +0 -11
  142. package/skills/discovery/SKILL.md +0 -14
  143. package/skills/discovery/SKILL.tmpl +0 -14
  144. package/skills/prd/SKILL.md +0 -19
  145. package/skills/prd/SKILL.tmpl +0 -19
  146. package/skills/qc/qa-analyst/DOC_GAPS.template.md +0 -63
  147. package/skills/qc/qa-analyst/acceptance-criteria.md +0 -60
  148. package/skills/qc/qa-analyst/business-rules.md +0 -59
  149. package/skills/qc/qa-analyst/data-flow.md +0 -64
  150. package/skills/qc/qa-analyst/spec-breakdown.md +0 -61
  151. package/skills/qc/qa-designer/e2e/journey.md +0 -41
  152. package/skills/qc/qa-designer/exploratory/charter.md +0 -68
  153. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +0 -43
  154. package/skills/qc/qa-designer/functional/api.md +0 -45
  155. package/skills/qc/qa-designer/functional/gui-feature.md +0 -46
  156. package/skills/qc/qa-designer/functional/gui-screen.md +0 -52
  157. package/skills/qc/qa-designer/integration/api.md +0 -42
  158. package/skills/qc/qa-designer/integration/db.md +0 -39
  159. package/skills/qc/qa-designer/integration/gui.md +0 -40
  160. package/skills/qc/qa-designer/integration/kafka.md +0 -40
  161. package/skills/qc/qa-designer/non-functional.md +0 -40
  162. package/skills/qc/qa-planner/test-plan.md +0 -120
  163. package/skills/qc/qa-reviewer/script/e2e.md +0 -87
  164. package/skills/qc/qa-reviewer/script/exploratory.md +0 -45
  165. package/skills/qc/qa-reviewer/script/functional.md +0 -101
  166. package/skills/qc/qa-reviewer/script/integration.md +0 -91
  167. package/skills/qc/qa-reviewer/script/non-functional.md +0 -126
  168. package/skills/qc/qa-reviewer/test-case/e2e.md +0 -73
  169. package/skills/qc/qa-reviewer/test-case/exploratory.md +0 -43
  170. package/skills/qc/qa-reviewer/test-case/functional.md +0 -76
  171. package/skills/qc/qa-reviewer/test-case/integration.md +0 -69
  172. package/skills/qc/qa-reviewer/test-case/non-functional.md +0 -73
  173. package/skills/qc/qa-runner/e2e.md +0 -49
  174. package/skills/qc/qa-runner/exploratory/session.md +0 -36
  175. package/skills/qc/qa-runner/functional/api.md +0 -35
  176. package/skills/qc/qa-runner/functional/gui-feature.md +0 -51
  177. package/skills/qc/qa-runner/functional/gui-screen.md +0 -55
  178. package/skills/qc/qa-runner/integration.md +0 -47
  179. package/skills/qc/qa-runner/non-functional.md +0 -49
  180. package/skills/qc/qa-runner/report/report.md +0 -37
  181. package/skills/setup-ai-first/SKILL.md +0 -19
  182. package/skills/setup-ai-first/SKILL.tmpl +0 -19
  183. package/skills/spec/SKILL.md +0 -19
  184. package/skills/spec/SKILL.tmpl +0 -19
  185. package/skills/test/SKILL.md +0 -18
  186. package/skills/test/SKILL.tmpl +0 -18
  187. package/steps/business-language.md +0 -56
  188. package/steps/capture-lesson.md +0 -112
  189. package/steps/context-loader.md +0 -406
  190. package/steps/gate.md +0 -151
  191. package/steps/report-footer.md +0 -125
  192. package/steps/review-fanout.md +0 -159
  193. package/steps/spawn-agent.md +0 -129
  194. package/steps/trace-mirror.md +0 -53
  195. package/templates/README.md +0 -70
  196. package/templates/architecture.template.md +0 -394
  197. package/templates/ci/trace-gate.yml +0 -146
  198. package/templates/design-spec.template.md +0 -217
  199. package/templates/feature.template +0 -123
  200. package/templates/hooks/pre-push +0 -61
  201. package/templates/platform-guide.template.md +0 -145
  202. package/templates/prd.template.md +0 -283
  203. package/templates/product-definition.template.md +0 -188
  204. package/templates/project-context.yaml +0 -212
  205. package/templates/tech-design.template.md +0 -490
@@ -1,135 +1,136 @@
1
- # 🔬 Explain — Giải phẫu từng command (Command Deep-Dive)
2
-
3
- > Tài liệu **đi sâu vào bên trong** từng command của pipeline, theo đúng thứ tự thực thi. Mục tiêu: làm **cơ sở review, phân tích và tối ưu** các bước trong pipeline.
4
- >
5
- > Khác với [Pipeline Steps](../02-concepts/pipeline-steps/) (tầng khái niệm, gom theo phase), thư mục này bám **logic thực tế trong command file** (`commands/*.md`) — từng bước command làm gì, giải quyết vấn đề gì, và **điểm nào đáng cân nhắc tối ưu**.
6
-
7
- ---
8
-
9
- ## Cách đọc (How to read)
10
-
11
- Mỗi trang command theo cùng một khuôn:
12
-
13
- | Mục | Nội dung |
14
- |-----|----------|
15
- | **Một câu** | Command làm gì |
16
- | **Vấn đề giải quyết** | Tại sao command này tồn tại |
17
- | **Vị trí & tiền đề** | Chạy sau gì, cần gì mở khoá |
18
- | **Input / Output** | Đầu vào & sản phẩm cụ thể |
19
- | **Các bước xử lý** | ⭐ Đi từng bước bên trong, dễ hiểu |
20
- | **Checkpoint & Gate** | Điểm dừng con người |
21
- | **Cơ chế đặc biệt** | Phần logic riêng đáng chú ý |
22
- | **👓 Góc nhìn tối ưu** | Điểm review/optimize: chi phí, rủi ro, phụ thuộc |
23
- | **Kết nối** | Bước trước ← → bước sau |
24
-
25
- ---
26
-
27
- ## ⭐ Bộ khung chung mọi command (Shared Skeleton)
28
-
29
- **Đọc phần này trước.** Mọi command file được build từ `.tmpl` + `{{include:steps/*.md}}`, nên đều có **cùng một bộ khung** bao quanh logic riêng. Hiểu bộ khung một lần → các trang command chỉ cần nói phần **riêng**.
30
-
31
- Cấu trúc một command file:
32
-
33
- ```
34
- ┌─ Gate (steps/gate) ──────────── chung, giống hệt mọi lệnh
35
- ├─ Context Loader (steps/context-loader) ── chung, 7 bước
36
- ├─ Business Language Guard (steps/business-language) ── chung, chỉ lệnh viết doc nghiệp vụ
37
- ├─ ★ LOGIC RIÊNG CỦA LỆNH ★ ──── phần mỗi trang explain tập trung
38
- └─ Report Footer (steps/report-footer) ── chung
39
- ```
40
-
41
- ### 1 · Gate — Cổng vào chuẩn (5 bước con)
42
-
43
- Chạy **trước** mọi logic riêng:
44
-
45
- | Bước | Tên | Việc | Ý nghĩa tối ưu |
46
- |------|-----|------|----------------|
47
- | 0 | **Sub-agent mode** | Nếu `$ARGUMENTS` là JSON có `_agent_mode` → bỏ Gate 1/2/3, chạy đúng phạm vi orchestrator giao (target_file, uc_id, uc_section, dimension) | Cơ chế fan-out per-UC dùng chính lệnh này làm "worker" |
48
- | 0-B | **Model check** | Khuyến nghị Opus. `Y`=tiếp · `S`=bỏ qua (⚠️ report) · khác=DỪNG | Checkpoint mềm; sub-agent bỏ qua (orchestrator đã check) |
49
- | 1 | **Target file** | Phân giải file mục tiêu từ path / UC-ID / ticket bằng glob theo bố cục feature-package; nhiều kết quả → hỏi | Điểm hay tốn 1 vòng hỏi khi `$ARGUMENTS` rỗng |
50
- | 2 | **Context loader** | Chạy 7 bước nạp context (mục 2 dưới) | Nơi quyết định "đúng-đủ-gọn" — trọng tâm tối ưu |
51
- | 3 | **CHECKPOINT** | Trình target + scope → chờ `Y` | Read-only command bỏ qua |
52
-
53
- ### 2 · Context Loader — "Thủ thư" (7 bước)
54
-
55
- Nạp context theo thứ tự chống Lost-in-the-Middle (đầu = "build gì", giữa = ràng buộc, cuối = "follow style này"):
56
-
57
- | Bước | Nạp gì | Ghi chú |
58
- |------|--------|---------|
59
- | 1 | **project-context.yaml** | tech_stack, conventions, domains, paths; trích `domain`/`prd_slug` từ path target |
60
- | 1.5 | **Service routing** (umbrella) | Khớp domain → service; dạng phẳng (2a) hay map-theo-platform (2b); override paths sang `spec_source` |
61
- | 1.6 | **Service conventions** (umbrella) | Nạp `build_command`/`test_command` riêng của service; set `service_root` |
62
- | 2 | **Module stack-profile** | `.agent/modules/{module}/stack-profile.yaml` — layer/test pattern |
63
- | 3 | **CLAUDE.md phân tầng** | root (BASE) + service overlay (stack) — **overlay thắng**; §2 layer/package, §3 naming, §5 error |
64
- | 4 | **data-protection** | Pattern file nhạy cảm — cấm truy cập cả phiên |
65
- | 5 | **Business dictionary** | Canonical + **banned terms** (thực thi chủ động) + enum registry |
66
- | 6 | **Core entities** | Entity catalog + field registry + relationship map |
67
- | 6.5 | **platform_type** | Suy `backend`/`web-frontend`/`mobile` từ module |
68
- | 6.7 | **Project lessons** | Guardrail từ `/learn` — ràng buộc cứng ngang coding standards |
69
- | 7 | **Recap** | In khối `[CTX LOADED]` — đẩy sự thật quan trọng lên cuối bộ nhớ |
70
-
71
- > 👓 **Đây là component quyết định 80% chất lượng.** Khi review tối ưu: chú ý `required` vs `optional`, filter theo domain, và budget context (~50% window).
72
-
73
- ### 3 · Business Language Guard (chỉ lệnh viết doc nghiệp vụ)
74
-
75
- Chặn thuật ngữ kỹ thuật rò vào PRD/BDD/product-definition. 4 nhóm xử lý: (1) tương tác/UI → diễn đạt lại nghiệp vụ · (2) visual thuần → chuyển Design Spec · (3) backend/contract → bỏ về Tech Docs · (4) ẩn dụ dữ liệu → xét ngữ cảnh (không thay máy móc). Áp cho `/define-product`, `/generate-prd`, `/refine-prd`, `/review-context`, `/generate-bdd`.
76
-
77
- ### 4 · Report Footer (mọi lệnh)
78
-
79
- Kết thúc bằng: **Status badge** (✅/❌/⚠️) · **Output Artifacts** (file tạo/sửa) · **Pipeline Position** (`◀ bạn ở đây`) · **Next command** (gợi ý lệnh kế + tham số).
80
-
81
- ---
82
-
83
- ## Danh sách command theo thứ tự pipeline (Pipeline Order)
84
-
85
- ### Phase Setup & Discovery
86
- - [00 · `/setup-ai-first`](00-setup-ai-first.md)
87
- - [00b · `/generate-architecture`](00b-generate-architecture.md)
88
- - [01 · `/define-product`](01-define-product.md)
89
-
90
- ### Phase Specification (PRD)
91
- - [02 · `/generate-prd`](02-generate-prd.md)
92
- - [02b · `/extend-prd`](02b-extend-prd.md) — thêm yêu cầu vào PRD **đã duyệt**
93
- - [03 · `/refine-prd`](03-refine-prd.md)
94
- - [04 · `/review-context`](04-review-context.md) *(dùng cho cả PRD & BDD)*
95
-
96
- ### Phase Design
97
- - [05 · `/generate-design-spec`](05-generate-design-spec.md)
98
- - [06 · `/generate-bdd`](06-generate-bdd.md)
99
- - [07 · `/generate-tech-docs`](07-generate-tech-docs.md)
100
- - [08 · `/review-tech-docs`](08-review-tech-docs.md)
101
-
102
- ### Phase Implementation
103
- - [09 · `/generate-code`](09-generate-code.md)
104
- - [10 · `/review-code`](10-review-code.md)
105
- - [11 · `/map-testids`](11-map-testids.md)
106
-
107
- ### Phase Dev Self-Test
108
- - [12 · `/dev-gen-test`](12-dev-gen-test.md)
109
- - [13 · `/dev-run-test`](13-dev-run-test.md)
110
- - [14 · `/dev-smoke-test`](14-dev-smoke-test.md)
111
-
112
- ### Phase QC Automation
113
- - [15 · `/qc-analyze`](15-qc-analyze.md)
114
- - [16 · `/qc-plan`](16-qc-plan.md)
115
- - [17 · `/qc-design-test`](17-qc-design-test.md)
116
- - [18 · `/qc-review`](18-qc-review.md)
117
- - [19 · `/qc-run-test`](19-qc-run-test.md)
118
- - [20 · `/qc-report`](20-qc-report.md)
119
-
120
- ### Phase Trace & Quality
121
- - [21 · `/validate-traces`](21-validate-traces.md)
122
- - [22 · `/generate-spec-manifest`](22-generate-spec-manifest.md)
123
-
124
- ### Lệnh xuyên suốt (Cross-cutting)
125
- - [23 · `/fix-bug`](23-fix-bug.md)
126
- - [24 · `/debug`](24-debug.md)
127
- - [25 · `/report-bug`](25-report-bug.md)
128
- - [26 · `/propose-scenario`](26-propose-scenario.md)
129
- - [27 · `/learn`](27-learn.md)
130
- - [28 · `/sync`](28-sync.md)
131
- - [29 · `/update-framework`](29-update-framework.md)
132
-
133
- ---
134
-
135
- *Nguồn: `commands/*.md` (build từ `.tmpl` + `steps/`). Khi command đổi, cập nhật trang tương ứng ở đây.*
1
+ # 🔬 Explain — Giải phẫu từng command (Command Deep-Dive)
2
+
3
+ > Tài liệu **đi sâu vào bên trong** từng command của pipeline, theo đúng thứ tự thực thi. Mục tiêu: làm **cơ sở review, phân tích và tối ưu** các bước trong pipeline.
4
+ >
5
+ > Khác với [Pipeline Steps](../02-concepts/pipeline-steps/) (tầng khái niệm, gom theo phase), thư mục này bám **logic thực tế trong command file** (`commands/*.md`) — từng bước command làm gì, giải quyết vấn đề gì, và **điểm nào đáng cân nhắc tối ưu**.
6
+
7
+ ---
8
+
9
+ ## Cách đọc (How to read)
10
+
11
+ Mỗi trang command theo cùng một khuôn:
12
+
13
+ | Mục | Nội dung |
14
+ |-----|----------|
15
+ | **Một câu** | Command làm gì |
16
+ | **Vấn đề giải quyết** | Tại sao command này tồn tại |
17
+ | **Vị trí & tiền đề** | Chạy sau gì, cần gì mở khoá |
18
+ | **Input / Output** | Đầu vào & sản phẩm cụ thể |
19
+ | **Các bước xử lý** | ⭐ Đi từng bước bên trong, dễ hiểu |
20
+ | **Checkpoint & Gate** | Điểm dừng con người |
21
+ | **Cơ chế đặc biệt** | Phần logic riêng đáng chú ý |
22
+ | **👓 Góc nhìn tối ưu** | Điểm review/optimize: chi phí, rủi ro, phụ thuộc |
23
+ | **Kết nối** | Bước trước ← → bước sau |
24
+
25
+ ---
26
+
27
+ ## ⭐ Bộ khung chung mọi command (Shared Skeleton)
28
+
29
+ **Đọc phần này trước.** Mọi command file được build từ `.tmpl` + `{{include:steps/*.md}}`, nên đều có **cùng một bộ khung** bao quanh logic riêng. Hiểu bộ khung một lần → các trang command chỉ cần nói phần **riêng**.
30
+
31
+ Cấu trúc một command file:
32
+
33
+ ```
34
+ ┌─ Gate (steps/gate) ──────────── chung, giống hệt mọi lệnh
35
+ ├─ Context Loader (steps/context-loader) ── chung, 7 bước
36
+ ├─ Business Language Guard (steps/business-language) ── chung, chỉ lệnh viết doc nghiệp vụ
37
+ ├─ ★ LOGIC RIÊNG CỦA LỆNH ★ ──── phần mỗi trang explain tập trung
38
+ └─ Report Footer (steps/report-footer) ── chung
39
+ ```
40
+
41
+ ### 1 · Gate — Cổng vào chuẩn (5 bước con)
42
+
43
+ Chạy **trước** mọi logic riêng:
44
+
45
+ | Bước | Tên | Việc | Ý nghĩa tối ưu |
46
+ |------|-----|------|----------------|
47
+ | 0 | **Sub-agent mode** | Nếu `$ARGUMENTS` là JSON có `_agent_mode` → bỏ Gate 1/2/3, chạy đúng phạm vi orchestrator giao (target_file, uc_id, uc_section, dimension) | Cơ chế fan-out per-UC dùng chính lệnh này làm "worker" |
48
+ | 0-B | **Model check** | Khuyến nghị Opus. `Y`=tiếp · `S`=bỏ qua (⚠️ report) · khác=DỪNG | Checkpoint mềm; sub-agent bỏ qua (orchestrator đã check) |
49
+ | 1 | **Target file** | Phân giải file mục tiêu từ path / UC-ID / ticket bằng glob theo bố cục feature-package; nhiều kết quả → hỏi | Điểm hay tốn 1 vòng hỏi khi `$ARGUMENTS` rỗng |
50
+ | 2 | **Context loader** | Chạy 7 bước nạp context (mục 2 dưới) | Nơi quyết định "đúng-đủ-gọn" — trọng tâm tối ưu |
51
+ | 3 | **CHECKPOINT** | Trình target + scope → chờ `Y` | Read-only command bỏ qua |
52
+
53
+ ### 2 · Context Loader — "Thủ thư" (7 bước)
54
+
55
+ Nạp context theo thứ tự chống Lost-in-the-Middle (đầu = "build gì", giữa = ràng buộc, cuối = "follow style này"):
56
+
57
+ | Bước | Nạp gì | Ghi chú |
58
+ |------|--------|---------|
59
+ | 1 | **project-context.yaml** | tech_stack, conventions, domains, paths; trích `domain`/`prd_slug` từ path target |
60
+ | 1.5 | **Service routing** (umbrella) | Khớp domain → service; dạng phẳng (2a) hay map-theo-platform (2b); override paths sang `spec_source` |
61
+ | 1.6 | **Service conventions** (umbrella) | Nạp `build_command`/`test_command` riêng của service; set `service_root` |
62
+ | 2 | **Module stack-profile** | `.agent/modules/{module}/stack-profile.yaml` — layer/test pattern |
63
+ | 3 | **CLAUDE.md phân tầng** | root (BASE) + service overlay (stack) — **overlay thắng**; §2 layer/package, §3 naming, §5 error |
64
+ | 4 | **data-protection** | Pattern file nhạy cảm — cấm truy cập cả phiên |
65
+ | 5 | **Business dictionary** | Canonical + **banned terms** (thực thi chủ động) + enum registry |
66
+ | 6 | **Core entities** | Entity catalog + field registry + relationship map |
67
+ | 6.5 | **platform_type** | Suy `backend`/`web-frontend`/`mobile` từ module |
68
+ | 6.7 | **Project lessons** | Guardrail từ `/learn` — ràng buộc cứng ngang coding standards |
69
+ | 7 | **Recap** | In khối `[CTX LOADED]` — đẩy sự thật quan trọng lên cuối bộ nhớ |
70
+
71
+ > 👓 **Đây là component quyết định 80% chất lượng.** Khi review tối ưu: chú ý `required` vs `optional`, filter theo domain, và budget context (~50% window).
72
+
73
+ ### 3 · Business Language Guard (chỉ lệnh viết doc nghiệp vụ)
74
+
75
+ Chặn thuật ngữ kỹ thuật rò vào PRD/BDD/product-definition. 4 nhóm xử lý: (1) tương tác/UI → diễn đạt lại nghiệp vụ · (2) visual thuần → chuyển Design Spec · (3) backend/contract → bỏ về Tech Docs · (4) ẩn dụ dữ liệu → xét ngữ cảnh (không thay máy móc). Áp cho `/define-product`, `/generate-prd`, `/refine-prd`, `/review-context`, `/generate-bdd`.
76
+
77
+ ### 4 · Report Footer (mọi lệnh)
78
+
79
+ Kết thúc bằng: **Status badge** (✅/❌/⚠️) · **Output Artifacts** (file tạo/sửa) · **Pipeline Position** (`◀ bạn ở đây`) · **Next command** (gợi ý lệnh kế + tham số).
80
+
81
+ ---
82
+
83
+ ## Danh sách command theo thứ tự pipeline (Pipeline Order)
84
+
85
+ ### Phase Setup & Discovery
86
+ - [00 · `/setup-ai-first`](00-setup-ai-first.md)
87
+ - [00b · `/generate-architecture`](00b-generate-architecture.md)
88
+ - [01 · `/define-product`](01-define-product.md)
89
+
90
+ ### Phase Specification (PRD)
91
+ - [02 · `/generate-prd`](02-generate-prd.md)
92
+ - [02b · `/extend-prd`](02b-extend-prd.md) — thêm yêu cầu vào PRD **đã duyệt**
93
+ - [02c · `/amend-prd`](02c-amend-prd.md) — **đổi** một yêu cầu đã duyệt (sửa tại chỗ)
94
+ - [03 · `/refine-prd`](03-refine-prd.md)
95
+ - [04 · `/review-context`](04-review-context.md) *(dùng cho cả PRD & BDD)*
96
+
97
+ ### Phase Design
98
+ - [05 · `/generate-design-spec`](05-generate-design-spec.md)
99
+ - [06 · `/generate-bdd`](06-generate-bdd.md)
100
+ - [07 · `/generate-tech-docs`](07-generate-tech-docs.md)
101
+ - [08 · `/review-tech-docs`](08-review-tech-docs.md)
102
+
103
+ ### Phase Implementation
104
+ - [09 · `/generate-code`](09-generate-code.md)
105
+ - [10 · `/review-code`](10-review-code.md)
106
+ - [11 · `/map-testids`](11-map-testids.md)
107
+
108
+ ### Phase Dev Self-Test
109
+ - [12 · `/dev-gen-test`](12-dev-gen-test.md)
110
+ - [13 · `/dev-run-test`](13-dev-run-test.md)
111
+ - [14 · `/dev-smoke-test`](14-dev-smoke-test.md)
112
+
113
+ ### Phase QC Automation
114
+ - [15 · `/qc-analyze`](15-qc-analyze.md)
115
+ - [16 · `/qc-plan`](16-qc-plan.md)
116
+ - [17 · `/qc-design-test`](17-qc-design-test.md)
117
+ - [18 · `/qc-review`](18-qc-review.md)
118
+ - [19 · `/qc-run-test`](19-qc-run-test.md)
119
+ - [20 · `/qc-report`](20-qc-report.md)
120
+
121
+ ### Phase Trace & Quality
122
+ - [21 · `/validate-traces`](21-validate-traces.md)
123
+ - [22 · `/generate-spec-manifest`](22-generate-spec-manifest.md)
124
+
125
+ ### Lệnh xuyên suốt (Cross-cutting)
126
+ - [23 · `/fix-bug`](23-fix-bug.md)
127
+ - [24 · `/debug`](24-debug.md)
128
+ - [25 · `/report-bug`](25-report-bug.md)
129
+ - [26 · `/propose-scenario`](26-propose-scenario.md)
130
+ - [27 · `/learn`](27-learn.md)
131
+ - [28 · `/sync`](28-sync.md)
132
+ - [29 · `/update-framework`](29-update-framework.md)
133
+
134
+ ---
135
+
136
+ *Nguồn: `commands/*.md` (build từ `.tmpl` + `steps/`). Khi command đổi, cập nhật trang tương ứng ở đây.*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@educa-corp/sdd-framework",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Spec Driven Development workflow framework for Claude Code",
5
5
  "bin": {
6
6
  "sdd-framework": "./bin/index.js"
@@ -19,15 +19,8 @@
19
19
  },
20
20
  "files": [
21
21
  "bin/",
22
- "commands/",
23
22
  "core/",
24
- "hooks/",
25
- "modules/",
26
- "rules/",
27
23
  "scripts/",
28
- "skills/",
29
- "steps/",
30
- "templates/",
31
24
  "docs/"
32
25
  ],
33
26
  "keywords": [