@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,164 +0,0 @@
1
- # /generate-spec-manifest — Sinh Spec Manifest cho External Agent
2
-
3
- Quét tất cả file spec và ghi một `spec-manifest.yaml` ở project root.
4
- File này dành cho **external agent** (vd agent của tester) — nó không commit vào git.
5
-
6
- ## Gate
7
-
8
- {{include:steps/gate.md}}
9
-
10
- *Lưu ý: Với lệnh này, không có target file — nó quét cả dự án. Bỏ qua `$ARGUMENTS` trừ khi truyền domain filter.*
11
-
12
- ## Context
13
-
14
- {{include:steps/context-loader.md}}
15
-
16
- ---
17
-
18
- ## Process
19
-
20
- ### Step 1 — Xác định scan root
21
-
22
- Đọc `project-context.yaml` để xác định mode và path:
23
-
24
- **Umbrella mode** (`setup.mode: umbrella`):
25
- ```
26
- spec_root = {setup.spec_source} ← spec submodule của PO
27
- prd_glob = {spec_root}/specs/*/*/*.md ← file .md ở gốc feature folder = PRD ({TICKET-ID}-{prd-slug}.md)
28
- pdd_glob = {spec_root}/specs/product-definition/**/*.md
29
- services = {services} ← map domain → paths
30
- ```
31
-
32
- **Single-service mode** (không có `setup.mode`):
33
- ```
34
- spec_root = .
35
- prd_glob = {paths.specs_dir}/*/*/*.md ← file .md ở gốc feature folder = PRD ({TICKET-ID}-{prd-slug}.md)
36
- pdd_glob = {paths.product_definitions_dir}/**/*.md
37
- services = { default: { specs_dir: {paths.specs_dir}, tech_docs_dir: {paths.tech_docs_dir} } }
38
- ```
39
-
40
- Nếu truyền domain filter trong `$ARGUMENTS` → chỉ quét PRD khớp domain đó.
41
-
42
- ---
43
-
44
- ### Step 2 — Quét file PRD
45
-
46
- Với mỗi file `.md` khớp `prd_glob`:
47
-
48
- 1. Đọc bảng metadata của file:
49
- - `TICKET-ID` từ `| **PRD ID** |`
50
- - `domain` từ `| **Domain** |`
51
- - `status` từ `| **Status** |`
52
- - `version` từ `| **Version** |`
53
- 2. Cũng đọc frontmatter `@trace.domain` nếu có (dùng cái này thay vì domain bảng metadata nếu cả hai tồn tại)
54
- 3. Ghi: `{ ticket_id, domain, status, version, prd_path }` — path tương đối với manifest root
55
-
56
- Skip file không xác định được `TICKET-ID`.
57
-
58
- ---
59
-
60
- ### Step 3 — Khớp file PDD
61
-
62
- Với mỗi TICKET-ID tìm thấy ở Step 2:
63
-
64
- Tìm `pdd_glob` một file có tên chứa TICKET-ID (vd `FT-001-*.md`).
65
- - Tìm thấy → ghi `pdd_path` (tương đối với manifest root)
66
- - Không thấy → ghi `pdd: null`
67
-
68
- ---
69
-
70
- ### Step 4 — Khớp file BDD và Tech-Doc theo từng service
71
-
72
- Với mỗi TICKET-ID, với mỗi service trong map `services`:
73
-
74
- **BDD:**
75
- - Glob `{service.specs_dir}/**/{TICKET-ID}*.feature`
76
- - Cũng kiểm tra file chứa `@trace.prd: {TICKET-ID}` trong frontmatter nếu glob không trả gì
77
- - Tìm thấy → ghi path dưới `bdd.{service_key}`
78
- - Không thấy → bỏ key (đừng ghi `null` cho service chưa có BDD)
79
-
80
- **Tech-docs:**
81
- - Glob `{service.tech_docs_dir}/**/{TICKET-ID}*.md`
82
- - Cũng kiểm tra file chứa `@trace.prd: {TICKET-ID}` nếu glob không trả gì
83
- - Tìm thấy → ghi path dưới `tech_docs.{service_key}`
84
- - Không thấy → bỏ key
85
-
86
- Mọi path tương đối với manifest root (umbrella root hoặc project root).
87
-
88
- ---
89
-
90
- ### Step 5 — Ghi spec-manifest.yaml
91
-
92
- Ghi vào `{manifest_root}/spec-manifest.yaml` (ghi đè nếu tồn tại).
93
-
94
- Format:
95
-
96
- ```yaml
97
- # Auto-generated by /generate-spec-manifest — DO NOT edit manually
98
- # To regenerate: /generate-spec-manifest
99
- # This file is excluded from git — see .gitignore
100
-
101
- version: "1.0"
102
- generated_at: "{YYYY-MM-DD}"
103
- project_mode: "{umbrella | single}"
104
-
105
- features:
106
- {TICKET-ID}:
107
- domain: {domain}
108
- status: {status}
109
- prd_version: "{version}"
110
- prd: "{prd_path}"
111
- pdd: "{pdd_path}" # omit if null
112
- tech_docs:
113
- {service_key}: "{path}" # only include services where file was found
114
- bdd:
115
- {service_key}: "{path}" # only include services where file was found
116
- ```
117
-
118
- Sort features theo TICKET-ID alphabet.
119
- Bỏ hẳn block `tech_docs` nếu không tìm thấy tech-doc cho service nào.
120
- Bỏ hẳn block `bdd` nếu không tìm thấy BDD cho service nào.
121
-
122
- ---
123
-
124
- ### Step 6 — Đảm bảo .gitignore
125
-
126
- Kiểm tra `{manifest_root}/.gitignore`:
127
- - Nếu `spec-manifest.yaml` đã được liệt kê → không làm gì
128
- - Nếu chưa → append vào `.gitignore`:
129
-
130
- ```
131
- # Auto-generated — do not commit
132
- spec-manifest.yaml
133
- ```
134
-
135
- In: `✅ spec-manifest.yaml added to .gitignore`
136
-
137
- ---
138
-
139
- ## Output
140
-
141
- {{include:steps/report-footer.md}}
142
-
143
- ```
144
- /generate-spec-manifest Hoàn tất
145
- ---
146
- Status : ✅ Complete
147
- Output : spec-manifest.yaml ({N} features)
148
- Mode : {umbrella | single}
149
- .gitignore : ✅ spec-manifest.yaml excluded
150
-
151
- Summary:
152
- {N} PRD scanned ({A} approved, {D} draft)
153
- {N} PDD matched
154
- {N} BDD file matched (across {S} services)
155
- {N} Tech-doc file matched (across {S} services)
156
-
157
- ⚠️ {N} PRD không có BDD khớp:
158
- - {TICKET-ID} ({domain}) — chạy /generate-bdd trước
159
- ⚠️ {N} PRD không có tech-docs khớp:
160
- - {TICKET-ID} ({domain}) — chạy /generate-tech-docs trước
161
-
162
- Next : Chia sẻ path spec-manifest.yaml với tester agent
163
- Sinh lại bất cứ lúc nào: /generate-spec-manifest
164
- ```