@educa-corp/sdd-framework 0.6.0 → 0.7.1

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 (223) 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 +418 -31
  6. package/core/FRAMEWORK_VERSION +1 -1
  7. package/{commands/extend-prd.md → core/commands/amend-prd.md} +206 -173
  8. package/core/commands/dev-run-test.md +48 -10
  9. package/core/commands/extend-prd.md +39 -12
  10. package/core/commands/generate-bdd.md +52 -10
  11. package/core/commands/generate-code.md +35 -2
  12. package/core/commands/generate-tech-docs.md +36 -4
  13. package/core/commands/map-testids.md +1 -1
  14. package/core/commands/qc-run-test.md +29 -3
  15. package/core/commands/refine-prd.md +13 -2
  16. package/core/commands/review-context.md +43 -8
  17. package/core/commands/sync.md +105 -1
  18. package/core/commands/validate-traces.md +289 -16
  19. package/core/rules/workflow.md +34 -0
  20. package/core/steps/context-loader.md +27 -6
  21. package/core/templates/feature.template +1 -1
  22. package/core/templates/project-context.yaml +3 -3
  23. package/core/templates/tech-design.template.md +2 -2
  24. package/docs/02-concepts/architecture.md +37 -1
  25. package/docs/02-concepts/overview.md +1 -1
  26. package/docs/02-concepts/pipeline-steps/02-specification.md +13 -7
  27. package/docs/02-concepts/pipeline-steps/07-dev-selftest.md +2 -0
  28. package/docs/02-concepts/pipeline-steps/08-qc-automation.md +1 -0
  29. package/docs/02-concepts/pipeline-steps/09-validate-traces.md +34 -3
  30. package/docs/02-concepts/pipeline-steps/10-feedback-loop.md +10 -1
  31. package/docs/02-concepts/traceability.md +187 -183
  32. package/docs/03-guides/architect.md +13 -4
  33. package/docs/03-guides/developer.md +1 -0
  34. package/docs/03-guides/product-owner.md +89 -72
  35. package/docs/03-guides/tester-qa.md +81 -81
  36. package/docs/04-reference/commands.md +148 -134
  37. package/docs/04-reference/trace-schema.md +45 -1
  38. package/docs/explain/02b-extend-prd.md +1 -1
  39. package/docs/explain/02c-amend-prd.md +152 -0
  40. package/docs/explain/06-generate-bdd.md +1 -1
  41. package/docs/explain/13-dev-run-test.md +15 -1
  42. package/docs/explain/19-qc-run-test.md +91 -87
  43. package/docs/explain/21-validate-traces.md +79 -75
  44. package/docs/explain/28-sync.md +25 -0
  45. package/docs/explain/README.md +136 -135
  46. package/package.json +1 -8
  47. package/commands/debug.md +0 -529
  48. package/commands/debug.tmpl +0 -260
  49. package/commands/define-product.md +0 -438
  50. package/commands/define-product.tmpl +0 -225
  51. package/commands/dev-gen-test.md +0 -700
  52. package/commands/dev-gen-test.tmpl +0 -490
  53. package/commands/dev-run-test.md +0 -435
  54. package/commands/dev-run-test.tmpl +0 -225
  55. package/commands/dev-smoke-test.md +0 -374
  56. package/commands/dev-smoke-test.tmpl +0 -217
  57. package/commands/extend-prd.tmpl +0 -273
  58. package/commands/fix-bug.md +0 -519
  59. package/commands/fix-bug.tmpl +0 -197
  60. package/commands/generate-architecture.md +0 -354
  61. package/commands/generate-architecture.tmpl +0 -197
  62. package/commands/generate-bdd.md +0 -923
  63. package/commands/generate-bdd.tmpl +0 -590
  64. package/commands/generate-code.md +0 -859
  65. package/commands/generate-code.tmpl +0 -649
  66. package/commands/generate-design-spec.md +0 -737
  67. package/commands/generate-design-spec.tmpl +0 -524
  68. package/commands/generate-prd.md +0 -722
  69. package/commands/generate-prd.tmpl +0 -226
  70. package/commands/generate-spec-manifest.md +0 -321
  71. package/commands/generate-spec-manifest.tmpl +0 -164
  72. package/commands/generate-tech-docs.md +0 -920
  73. package/commands/generate-tech-docs.tmpl +0 -273
  74. package/commands/learn.md +0 -399
  75. package/commands/learn.tmpl +0 -130
  76. package/commands/map-testids.md +0 -238
  77. package/commands/map-testids.tmpl +0 -81
  78. package/commands/propose-scenario.md +0 -359
  79. package/commands/propose-scenario.tmpl +0 -202
  80. package/commands/qc-analyze.md +0 -269
  81. package/commands/qc-analyze.tmpl +0 -112
  82. package/commands/qc-design-test.md +0 -226
  83. package/commands/qc-design-test.tmpl +0 -69
  84. package/commands/qc-plan.md +0 -206
  85. package/commands/qc-plan.tmpl +0 -49
  86. package/commands/qc-report.md +0 -217
  87. package/commands/qc-report.tmpl +0 -60
  88. package/commands/qc-review.md +0 -210
  89. package/commands/qc-review.tmpl +0 -53
  90. package/commands/qc-run-test.md +0 -326
  91. package/commands/qc-run-test.tmpl +0 -116
  92. package/commands/refine-prd.md +0 -653
  93. package/commands/refine-prd.tmpl +0 -281
  94. package/commands/report-bug.md +0 -305
  95. package/commands/report-bug.tmpl +0 -148
  96. package/commands/review-code.md +0 -415
  97. package/commands/review-code.tmpl +0 -146
  98. package/commands/review-context.md +0 -902
  99. package/commands/review-context.tmpl +0 -530
  100. package/commands/review-tech-docs.md +0 -561
  101. package/commands/review-tech-docs.tmpl +0 -404
  102. package/commands/setup-ai-first.md +0 -602
  103. package/commands/setup-ai-first.tmpl +0 -450
  104. package/commands/sync.md +0 -430
  105. package/commands/sync.tmpl +0 -429
  106. package/commands/update-framework.md +0 -203
  107. package/commands/update-framework.tmpl +0 -202
  108. package/commands/validate-traces.md +0 -1077
  109. package/commands/validate-traces.tmpl +0 -920
  110. package/hooks/data-guard.js +0 -232
  111. package/hooks/settings.json +0 -19
  112. package/modules/android-compose/module.yaml +0 -13
  113. package/modules/android-compose/stack-profile.yaml +0 -57
  114. package/modules/angular/architecture-snippets/component-patterns.md +0 -187
  115. package/modules/angular/module.yaml +0 -6
  116. package/modules/angular/stack-profile.yaml +0 -38
  117. package/modules/context-engineering/architecture-snippets/context-design.md +0 -119
  118. package/modules/context-engineering/module.yaml +0 -9
  119. package/modules/context-engineering/stack-profile.yaml +0 -61
  120. package/modules/dotnet/architecture-snippets/clean-arch.md +0 -160
  121. package/modules/dotnet/module.yaml +0 -6
  122. package/modules/dotnet/stack-profile.yaml +0 -50
  123. package/modules/flutter/module.yaml +0 -14
  124. package/modules/flutter/stack-profile.yaml +0 -59
  125. package/modules/golang/architecture-snippets/domain-layout.md +0 -283
  126. package/modules/golang/module.yaml +0 -6
  127. package/modules/golang/stack-profile.yaml +0 -40
  128. package/modules/ios-swiftui/module.yaml +0 -13
  129. package/modules/ios-swiftui/stack-profile.yaml +0 -55
  130. package/modules/java-spring/architecture-snippets/layered-arch.md +0 -201
  131. package/modules/java-spring/module.yaml +0 -15
  132. package/modules/java-spring/stack-profile.yaml +0 -28
  133. package/modules/nextjs/architecture-snippets/app-router-patterns.md +0 -269
  134. package/modules/nextjs/module.yaml +0 -14
  135. package/modules/nextjs/stack-profile.yaml +0 -74
  136. package/modules/nuxt/module.yaml +0 -14
  137. package/modules/nuxt/stack-profile.yaml +0 -58
  138. package/modules/phaser-game/architecture-snippets/phaser-scene-patterns.md +0 -646
  139. package/modules/phaser-game/module.yaml +0 -15
  140. package/modules/phaser-game/stack-profile.yaml +0 -90
  141. package/modules/php-laravel/architecture-snippets/service-repository.md +0 -302
  142. package/modules/php-laravel/module.yaml +0 -15
  143. package/modules/php-laravel/stack-profile.yaml +0 -56
  144. package/modules/qc-playwright/stack-profile.yaml +0 -66
  145. package/modules/react/architecture-snippets/hooks-query-patterns.md +0 -254
  146. package/modules/react/module.yaml +0 -14
  147. package/modules/react/stack-profile.yaml +0 -63
  148. package/modules/react-native/module.yaml +0 -14
  149. package/modules/react-native/stack-profile.yaml +0 -56
  150. package/modules/vue/module.yaml +0 -14
  151. package/modules/vue/stack-profile.yaml +0 -65
  152. package/rules/data-protection.md +0 -80
  153. package/rules/workflow.md +0 -99
  154. package/skills/code/SKILL.md +0 -19
  155. package/skills/code/SKILL.tmpl +0 -19
  156. package/skills/debug/SKILL.md +0 -19
  157. package/skills/debug/SKILL.tmpl +0 -19
  158. package/skills/design-spec/SKILL.md +0 -11
  159. package/skills/design-spec/SKILL.tmpl +0 -11
  160. package/skills/discovery/SKILL.md +0 -14
  161. package/skills/discovery/SKILL.tmpl +0 -14
  162. package/skills/prd/SKILL.md +0 -19
  163. package/skills/prd/SKILL.tmpl +0 -19
  164. package/skills/qc/qa-analyst/DOC_GAPS.template.md +0 -63
  165. package/skills/qc/qa-analyst/acceptance-criteria.md +0 -60
  166. package/skills/qc/qa-analyst/business-rules.md +0 -59
  167. package/skills/qc/qa-analyst/data-flow.md +0 -64
  168. package/skills/qc/qa-analyst/spec-breakdown.md +0 -61
  169. package/skills/qc/qa-designer/e2e/journey.md +0 -41
  170. package/skills/qc/qa-designer/exploratory/charter.md +0 -68
  171. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +0 -43
  172. package/skills/qc/qa-designer/functional/api.md +0 -45
  173. package/skills/qc/qa-designer/functional/gui-feature.md +0 -46
  174. package/skills/qc/qa-designer/functional/gui-screen.md +0 -52
  175. package/skills/qc/qa-designer/integration/api.md +0 -42
  176. package/skills/qc/qa-designer/integration/db.md +0 -39
  177. package/skills/qc/qa-designer/integration/gui.md +0 -40
  178. package/skills/qc/qa-designer/integration/kafka.md +0 -40
  179. package/skills/qc/qa-designer/non-functional.md +0 -40
  180. package/skills/qc/qa-planner/test-plan.md +0 -120
  181. package/skills/qc/qa-reviewer/script/e2e.md +0 -87
  182. package/skills/qc/qa-reviewer/script/exploratory.md +0 -45
  183. package/skills/qc/qa-reviewer/script/functional.md +0 -101
  184. package/skills/qc/qa-reviewer/script/integration.md +0 -91
  185. package/skills/qc/qa-reviewer/script/non-functional.md +0 -126
  186. package/skills/qc/qa-reviewer/test-case/e2e.md +0 -73
  187. package/skills/qc/qa-reviewer/test-case/exploratory.md +0 -43
  188. package/skills/qc/qa-reviewer/test-case/functional.md +0 -76
  189. package/skills/qc/qa-reviewer/test-case/integration.md +0 -69
  190. package/skills/qc/qa-reviewer/test-case/non-functional.md +0 -73
  191. package/skills/qc/qa-runner/e2e.md +0 -49
  192. package/skills/qc/qa-runner/exploratory/session.md +0 -36
  193. package/skills/qc/qa-runner/functional/api.md +0 -35
  194. package/skills/qc/qa-runner/functional/gui-feature.md +0 -51
  195. package/skills/qc/qa-runner/functional/gui-screen.md +0 -55
  196. package/skills/qc/qa-runner/integration.md +0 -47
  197. package/skills/qc/qa-runner/non-functional.md +0 -49
  198. package/skills/qc/qa-runner/report/report.md +0 -37
  199. package/skills/setup-ai-first/SKILL.md +0 -19
  200. package/skills/setup-ai-first/SKILL.tmpl +0 -19
  201. package/skills/spec/SKILL.md +0 -19
  202. package/skills/spec/SKILL.tmpl +0 -19
  203. package/skills/test/SKILL.md +0 -18
  204. package/skills/test/SKILL.tmpl +0 -18
  205. package/steps/business-language.md +0 -56
  206. package/steps/capture-lesson.md +0 -112
  207. package/steps/context-loader.md +0 -406
  208. package/steps/gate.md +0 -151
  209. package/steps/report-footer.md +0 -125
  210. package/steps/review-fanout.md +0 -159
  211. package/steps/spawn-agent.md +0 -129
  212. package/steps/trace-mirror.md +0 -53
  213. package/templates/README.md +0 -70
  214. package/templates/architecture.template.md +0 -394
  215. package/templates/ci/trace-gate.yml +0 -146
  216. package/templates/design-spec.template.md +0 -217
  217. package/templates/feature.template +0 -123
  218. package/templates/hooks/pre-push +0 -61
  219. package/templates/platform-guide.template.md +0 -145
  220. package/templates/prd.template.md +0 -283
  221. package/templates/product-definition.template.md +0 -188
  222. package/templates/project-context.yaml +0 -212
  223. 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.1",
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": [