@educa-corp/sdd-framework 0.1.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 (382) hide show
  1. package/bin/build.js +230 -0
  2. package/bin/index.js +609 -0
  3. package/commands/debug.md +835 -0
  4. package/commands/debug.tmpl +257 -0
  5. package/commands/define-product.md +746 -0
  6. package/commands/define-product.tmpl +191 -0
  7. package/commands/dev-gen-test.md +1015 -0
  8. package/commands/dev-gen-test.tmpl +490 -0
  9. package/commands/dev-run-test.md +749 -0
  10. package/commands/dev-run-test.tmpl +224 -0
  11. package/commands/dev-smoke-test.md +716 -0
  12. package/commands/dev-smoke-test.tmpl +217 -0
  13. package/commands/fix-bug.md +749 -0
  14. package/commands/fix-bug.tmpl +171 -0
  15. package/commands/generate-bdd.md +1144 -0
  16. package/commands/generate-bdd.tmpl +499 -0
  17. package/commands/generate-code.md +1038 -0
  18. package/commands/generate-code.tmpl +513 -0
  19. package/commands/generate-design-spec.md +1079 -0
  20. package/commands/generate-design-spec.tmpl +524 -0
  21. package/commands/generate-prd.md +945 -0
  22. package/commands/generate-prd.tmpl +166 -0
  23. package/commands/generate-spec-manifest.md +663 -0
  24. package/commands/generate-spec-manifest.tmpl +164 -0
  25. package/commands/generate-tech-docs.md +1249 -0
  26. package/commands/generate-tech-docs.tmpl +252 -0
  27. package/commands/learn.md +641 -0
  28. package/commands/learn.tmpl +63 -0
  29. package/commands/map-testids.md +580 -0
  30. package/commands/map-testids.tmpl +81 -0
  31. package/commands/propose-scenario.md +632 -0
  32. package/commands/propose-scenario.tmpl +133 -0
  33. package/commands/qc-analyze.md +611 -0
  34. package/commands/qc-analyze.tmpl +112 -0
  35. package/commands/qc-design-test.md +567 -0
  36. package/commands/qc-design-test.tmpl +68 -0
  37. package/commands/qc-plan.md +548 -0
  38. package/commands/qc-plan.tmpl +49 -0
  39. package/commands/qc-report.md +559 -0
  40. package/commands/qc-report.tmpl +60 -0
  41. package/commands/qc-review.md +552 -0
  42. package/commands/qc-review.tmpl +53 -0
  43. package/commands/qc-run-test.md +609 -0
  44. package/commands/qc-run-test.tmpl +84 -0
  45. package/commands/refine-prd.md +992 -0
  46. package/commands/refine-prd.tmpl +278 -0
  47. package/commands/report-bug.md +647 -0
  48. package/commands/report-bug.tmpl +148 -0
  49. package/commands/review-code.md +682 -0
  50. package/commands/review-code.tmpl +104 -0
  51. package/commands/review-context.md +1202 -0
  52. package/commands/review-context.tmpl +488 -0
  53. package/commands/review-tech-docs.md +871 -0
  54. package/commands/review-tech-docs.tmpl +372 -0
  55. package/commands/setup-ai-first.md +546 -0
  56. package/commands/setup-ai-first.tmpl +358 -0
  57. package/commands/sync.md +451 -0
  58. package/commands/sync.tmpl +351 -0
  59. package/commands/update-framework.md +251 -0
  60. package/commands/update-framework.tmpl +151 -0
  61. package/commands/validate-traces.md +928 -0
  62. package/commands/validate-traces.tmpl +429 -0
  63. package/core/FRAMEWORK_VERSION +1 -0
  64. package/core/commands/debug.md +835 -0
  65. package/core/commands/define-product.md +746 -0
  66. package/core/commands/dev-gen-test.md +1015 -0
  67. package/core/commands/dev-run-test.md +749 -0
  68. package/core/commands/dev-smoke-test.md +716 -0
  69. package/core/commands/fix-bug.md +749 -0
  70. package/core/commands/generate-bdd.md +1144 -0
  71. package/core/commands/generate-code.md +1038 -0
  72. package/core/commands/generate-design-spec.md +1079 -0
  73. package/core/commands/generate-prd.md +945 -0
  74. package/core/commands/generate-spec-manifest.md +663 -0
  75. package/core/commands/generate-tech-docs.md +1249 -0
  76. package/core/commands/learn.md +641 -0
  77. package/core/commands/map-testids.md +580 -0
  78. package/core/commands/propose-scenario.md +632 -0
  79. package/core/commands/qc-analyze.md +611 -0
  80. package/core/commands/qc-design-test.md +567 -0
  81. package/core/commands/qc-plan.md +548 -0
  82. package/core/commands/qc-report.md +559 -0
  83. package/core/commands/qc-review.md +552 -0
  84. package/core/commands/qc-run-test.md +609 -0
  85. package/core/commands/refine-prd.md +992 -0
  86. package/core/commands/report-bug.md +647 -0
  87. package/core/commands/review-code.md +682 -0
  88. package/core/commands/review-context.md +1202 -0
  89. package/core/commands/review-tech-docs.md +871 -0
  90. package/core/commands/setup-ai-first.md +546 -0
  91. package/core/commands/sync.md +451 -0
  92. package/core/commands/update-framework.md +251 -0
  93. package/core/commands/validate-traces.md +928 -0
  94. package/core/hooks/data-guard.js +141 -0
  95. package/core/hooks/settings.json +18 -0
  96. package/core/modules/android-compose/module.yaml +13 -0
  97. package/core/modules/android-compose/stack-profile.yaml +57 -0
  98. package/core/modules/angular/architecture-snippets/component-patterns.md +187 -0
  99. package/core/modules/angular/module.yaml +6 -0
  100. package/core/modules/angular/stack-profile.yaml +38 -0
  101. package/core/modules/context-engineering/architecture-snippets/context-design.md +119 -0
  102. package/core/modules/context-engineering/module.yaml +9 -0
  103. package/core/modules/context-engineering/stack-profile.yaml +61 -0
  104. package/core/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
  105. package/core/modules/dotnet/module.yaml +6 -0
  106. package/core/modules/dotnet/stack-profile.yaml +50 -0
  107. package/core/modules/flutter/module.yaml +14 -0
  108. package/core/modules/flutter/stack-profile.yaml +59 -0
  109. package/core/modules/golang/architecture-snippets/domain-layout.md +283 -0
  110. package/core/modules/golang/module.yaml +6 -0
  111. package/core/modules/golang/stack-profile.yaml +40 -0
  112. package/core/modules/ios-swiftui/module.yaml +13 -0
  113. package/core/modules/ios-swiftui/stack-profile.yaml +55 -0
  114. package/core/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
  115. package/core/modules/java-spring/module.yaml +15 -0
  116. package/core/modules/java-spring/stack-profile.yaml +28 -0
  117. package/core/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
  118. package/core/modules/nextjs/module.yaml +14 -0
  119. package/core/modules/nextjs/stack-profile.yaml +74 -0
  120. package/core/modules/nuxt/module.yaml +14 -0
  121. package/core/modules/nuxt/stack-profile.yaml +58 -0
  122. package/core/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
  123. package/core/modules/php-laravel/module.yaml +15 -0
  124. package/core/modules/php-laravel/stack-profile.yaml +56 -0
  125. package/core/modules/qc-playwright/stack-profile.yaml +66 -0
  126. package/core/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
  127. package/core/modules/react/module.yaml +14 -0
  128. package/core/modules/react/stack-profile.yaml +63 -0
  129. package/core/modules/react-native/module.yaml +14 -0
  130. package/core/modules/react-native/stack-profile.yaml +56 -0
  131. package/core/modules/vue/module.yaml +14 -0
  132. package/core/modules/vue/stack-profile.yaml +65 -0
  133. package/core/rules/data-protection.md +80 -0
  134. package/core/rules/workflow.md +44 -0
  135. package/core/skills/code/SKILL.md +19 -0
  136. package/core/skills/debug/SKILL.md +19 -0
  137. package/core/skills/design-spec/SKILL.md +11 -0
  138. package/core/skills/discovery/SKILL.md +14 -0
  139. package/core/skills/prd/SKILL.md +19 -0
  140. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  141. package/core/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
  142. package/core/skills/qc/qa-analyst/business-rules.md +59 -0
  143. package/core/skills/qc/qa-analyst/data-flow.md +64 -0
  144. package/core/skills/qc/qa-analyst/spec-breakdown.md +61 -0
  145. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  146. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  147. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  148. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  149. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  150. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  151. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  152. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  153. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  154. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  155. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  156. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  157. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  158. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  159. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  160. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  161. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  162. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  163. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  164. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  165. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  166. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  167. package/core/skills/qc/qa-runner/e2e.md +49 -0
  168. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  169. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  170. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  171. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  172. package/core/skills/qc/qa-runner/integration.md +47 -0
  173. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  174. package/core/skills/qc/qa-runner/report/report.md +37 -0
  175. package/core/skills/setup-ai-first/SKILL.md +11 -0
  176. package/core/skills/spec/SKILL.md +19 -0
  177. package/core/skills/test/SKILL.md +18 -0
  178. package/core/steps/business-language.md +56 -0
  179. package/core/steps/capture-lesson.md +79 -0
  180. package/core/steps/context-loader.md +311 -0
  181. package/core/steps/gate.md +88 -0
  182. package/core/steps/report-footer.md +100 -0
  183. package/core/steps/review-fanout.md +159 -0
  184. package/core/steps/spawn-agent.md +129 -0
  185. package/core/steps/trace-mirror.md +26 -0
  186. package/core/templates/architecture.template.md +113 -0
  187. package/core/templates/design-spec.template.md +217 -0
  188. package/core/templates/feature.template +120 -0
  189. package/core/templates/platform-guide.template.md +145 -0
  190. package/core/templates/prd.template.md +224 -0
  191. package/core/templates/product-definition.template.md +188 -0
  192. package/core/templates/project-context.yaml +161 -0
  193. package/core/templates/tech-design.template.md +498 -0
  194. package/docs/01-getting-started/README.md +19 -0
  195. package/docs/01-getting-started/core-concepts.md +102 -0
  196. package/docs/01-getting-started/installation.md +156 -0
  197. package/docs/01-getting-started/quickstart.md +86 -0
  198. package/docs/02-guides/README.md +26 -0
  199. package/docs/02-guides/bdd-input-checklist.md +68 -0
  200. package/docs/02-guides/developer/README.md +49 -0
  201. package/docs/02-guides/developer/bdd-and-trace.md +126 -0
  202. package/docs/02-guides/developer/commands.md +76 -0
  203. package/docs/02-guides/developer/pr-checklist.md +16 -0
  204. package/docs/02-guides/developer/scenarios.md +460 -0
  205. package/docs/02-guides/developer/workflow.md +121 -0
  206. package/docs/02-guides/prd-input-checklist.md +94 -0
  207. package/docs/02-guides/product-owner/README.md +81 -0
  208. package/docs/02-guides/product-owner/commands.md +30 -0
  209. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  210. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  211. package/docs/02-guides/product-owner/scenarios.md +438 -0
  212. package/docs/02-guides/tech-docs-input-checklist.md +109 -0
  213. package/docs/02-guides/tester/README.md +75 -0
  214. package/docs/02-guides/tester/bug-reporting.md +117 -0
  215. package/docs/02-guides/tester/qc-automation.md +165 -0
  216. package/docs/02-guides/tester/reading-specs.md +79 -0
  217. package/docs/02-guides/tester/scenarios.md +186 -0
  218. package/docs/02-guides/tester/spec-manifest.md +130 -0
  219. package/docs/02-guides/tester/test-checklist.md +31 -0
  220. package/docs/02-guides/tester/workflow.md +77 -0
  221. package/docs/03-concepts/README.md +20 -0
  222. package/docs/03-concepts/architecture.md +248 -0
  223. package/docs/03-concepts/mechanisms-explained.md +124 -0
  224. package/docs/03-concepts/pipeline.md +278 -0
  225. package/docs/03-concepts/traceability.md +152 -0
  226. package/docs/04-operations/README.md +33 -0
  227. package/docs/04-operations/bug-flow.md +364 -0
  228. package/docs/04-operations/publishing.md +154 -0
  229. package/docs/04-operations/sync-and-update.md +522 -0
  230. package/docs/05-reference/README.md +34 -0
  231. package/docs/05-reference/command-cheatsheet.md +147 -0
  232. package/docs/05-reference/commands.md +234 -0
  233. package/docs/05-reference/model-selection.md +74 -0
  234. package/docs/05-reference/modules.md +110 -0
  235. package/docs/05-reference/trace-schema.md +154 -0
  236. package/docs/06-commands/README.md +75 -0
  237. package/docs/06-commands/explain-debug.md +32 -0
  238. package/docs/06-commands/explain-define-product.md +43 -0
  239. package/docs/06-commands/explain-dev-gen-test.md +28 -0
  240. package/docs/06-commands/explain-dev-run-test.md +24 -0
  241. package/docs/06-commands/explain-dev-smoke-test.md +25 -0
  242. package/docs/06-commands/explain-fix-bug.md +28 -0
  243. package/docs/06-commands/explain-generate-bdd.md +45 -0
  244. package/docs/06-commands/explain-generate-code.md +53 -0
  245. package/docs/06-commands/explain-generate-design-spec.md +54 -0
  246. package/docs/06-commands/explain-generate-prd.md +45 -0
  247. package/docs/06-commands/explain-generate-spec-manifest.md +20 -0
  248. package/docs/06-commands/explain-generate-tech-docs.md +56 -0
  249. package/docs/06-commands/explain-learn.md +21 -0
  250. package/docs/06-commands/explain-map-testids.md +28 -0
  251. package/docs/06-commands/explain-propose-scenario.md +24 -0
  252. package/docs/06-commands/explain-qc-analyze.md +22 -0
  253. package/docs/06-commands/explain-qc-design-test.md +20 -0
  254. package/docs/06-commands/explain-qc-plan.md +21 -0
  255. package/docs/06-commands/explain-qc-report.md +23 -0
  256. package/docs/06-commands/explain-qc-review.md +24 -0
  257. package/docs/06-commands/explain-qc-run-test.md +27 -0
  258. package/docs/06-commands/explain-refine-prd.md +51 -0
  259. package/docs/06-commands/explain-report-bug.md +24 -0
  260. package/docs/06-commands/explain-review-code.md +45 -0
  261. package/docs/06-commands/explain-review-context.md +68 -0
  262. package/docs/06-commands/explain-review-tech-docs.md +45 -0
  263. package/docs/06-commands/explain-setup-ai-first.md +25 -0
  264. package/docs/06-commands/explain-sync.md +24 -0
  265. package/docs/06-commands/explain-update-framework.md +22 -0
  266. package/docs/06-commands/explain-validate-traces.md +25 -0
  267. package/docs/README.md +53 -0
  268. package/docs/t-sample.md +826 -0
  269. package/hooks/data-guard.js +141 -0
  270. package/hooks/settings.json +18 -0
  271. package/modules/android-compose/module.yaml +13 -0
  272. package/modules/android-compose/stack-profile.yaml +57 -0
  273. package/modules/angular/architecture-snippets/component-patterns.md +187 -0
  274. package/modules/angular/module.yaml +6 -0
  275. package/modules/angular/stack-profile.yaml +38 -0
  276. package/modules/context-engineering/architecture-snippets/context-design.md +119 -0
  277. package/modules/context-engineering/module.yaml +9 -0
  278. package/modules/context-engineering/stack-profile.yaml +61 -0
  279. package/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
  280. package/modules/dotnet/module.yaml +6 -0
  281. package/modules/dotnet/stack-profile.yaml +50 -0
  282. package/modules/flutter/module.yaml +14 -0
  283. package/modules/flutter/stack-profile.yaml +59 -0
  284. package/modules/golang/architecture-snippets/domain-layout.md +283 -0
  285. package/modules/golang/module.yaml +6 -0
  286. package/modules/golang/stack-profile.yaml +40 -0
  287. package/modules/ios-swiftui/module.yaml +13 -0
  288. package/modules/ios-swiftui/stack-profile.yaml +55 -0
  289. package/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
  290. package/modules/java-spring/module.yaml +15 -0
  291. package/modules/java-spring/stack-profile.yaml +28 -0
  292. package/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
  293. package/modules/nextjs/module.yaml +14 -0
  294. package/modules/nextjs/stack-profile.yaml +74 -0
  295. package/modules/nuxt/module.yaml +14 -0
  296. package/modules/nuxt/stack-profile.yaml +58 -0
  297. package/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
  298. package/modules/php-laravel/module.yaml +15 -0
  299. package/modules/php-laravel/stack-profile.yaml +56 -0
  300. package/modules/qc-playwright/stack-profile.yaml +66 -0
  301. package/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
  302. package/modules/react/module.yaml +14 -0
  303. package/modules/react/stack-profile.yaml +63 -0
  304. package/modules/react-native/module.yaml +14 -0
  305. package/modules/react-native/stack-profile.yaml +56 -0
  306. package/modules/vue/module.yaml +14 -0
  307. package/modules/vue/stack-profile.yaml +65 -0
  308. package/package.json +49 -0
  309. package/readme.txt +1 -0
  310. package/rules/data-protection.md +80 -0
  311. package/rules/workflow.md +44 -0
  312. package/scripts/init.sh +49 -0
  313. package/scripts/migrate-specs.js +258 -0
  314. package/scripts/rename-prd-files.js +174 -0
  315. package/scripts/upgrade.sh +94 -0
  316. package/skills/code/SKILL.md +19 -0
  317. package/skills/code/SKILL.tmpl +19 -0
  318. package/skills/debug/SKILL.md +19 -0
  319. package/skills/debug/SKILL.tmpl +19 -0
  320. package/skills/design-spec/SKILL.md +11 -0
  321. package/skills/design-spec/SKILL.tmpl +11 -0
  322. package/skills/discovery/SKILL.md +14 -0
  323. package/skills/discovery/SKILL.tmpl +14 -0
  324. package/skills/prd/SKILL.md +19 -0
  325. package/skills/prd/SKILL.tmpl +19 -0
  326. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  327. package/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
  328. package/skills/qc/qa-analyst/business-rules.md +59 -0
  329. package/skills/qc/qa-analyst/data-flow.md +64 -0
  330. package/skills/qc/qa-analyst/spec-breakdown.md +61 -0
  331. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  332. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  333. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  334. package/skills/qc/qa-designer/functional/api.md +45 -0
  335. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  336. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  337. package/skills/qc/qa-designer/integration/api.md +42 -0
  338. package/skills/qc/qa-designer/integration/db.md +39 -0
  339. package/skills/qc/qa-designer/integration/gui.md +40 -0
  340. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  341. package/skills/qc/qa-designer/non-functional.md +40 -0
  342. package/skills/qc/qa-planner/test-plan.md +120 -0
  343. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  344. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  345. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  346. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  347. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  348. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  349. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  350. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  351. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  352. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  353. package/skills/qc/qa-runner/e2e.md +49 -0
  354. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  355. package/skills/qc/qa-runner/functional/api.md +35 -0
  356. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  357. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  358. package/skills/qc/qa-runner/integration.md +47 -0
  359. package/skills/qc/qa-runner/non-functional.md +49 -0
  360. package/skills/qc/qa-runner/report/report.md +37 -0
  361. package/skills/setup-ai-first/SKILL.md +11 -0
  362. package/skills/setup-ai-first/SKILL.tmpl +11 -0
  363. package/skills/spec/SKILL.md +19 -0
  364. package/skills/spec/SKILL.tmpl +19 -0
  365. package/skills/test/SKILL.md +18 -0
  366. package/skills/test/SKILL.tmpl +18 -0
  367. package/steps/business-language.md +56 -0
  368. package/steps/capture-lesson.md +79 -0
  369. package/steps/context-loader.md +311 -0
  370. package/steps/gate.md +88 -0
  371. package/steps/report-footer.md +100 -0
  372. package/steps/review-fanout.md +159 -0
  373. package/steps/spawn-agent.md +129 -0
  374. package/steps/trace-mirror.md +26 -0
  375. package/templates/architecture.template.md +113 -0
  376. package/templates/design-spec.template.md +217 -0
  377. package/templates/feature.template +120 -0
  378. package/templates/platform-guide.template.md +145 -0
  379. package/templates/prd.template.md +224 -0
  380. package/templates/product-definition.template.md +188 -0
  381. package/templates/project-context.yaml +161 -0
  382. package/templates/tech-design.template.md +498 -0
@@ -0,0 +1,156 @@
1
+ [📚 Docs](../README.md) › [Getting Started](README.md) › Installation
2
+
3
+ # Installation
4
+
5
+ Cài đặt framework vào project và (tùy chọn) VS Code extension.
6
+
7
+ ## Mục lục
8
+
9
+ - [Prerequisites](#prerequisites)
10
+ - [Cài framework](#cài-framework)
11
+ - [Kiểm tra cài đặt](#kiểm-tra-cài-đặt)
12
+ - [Upgrade](#upgrade)
13
+ - [QC automation stack (tùy chọn)](#qc-automation-stack-tùy-chọn)
14
+ - [VS Code extension (khuyến nghị)](#vs-code-extension-khuyến-nghị)
15
+ - [Uninstall](#uninstall)
16
+
17
+ ## Prerequisites
18
+
19
+ | Tool | Version | Link |
20
+ |------|---------|------|
21
+ | Node.js | bất kỳ (check: `node -v`) | [nodejs.org](https://nodejs.org) |
22
+ | Claude Code CLI | Latest | [claude.ai/code](https://claude.ai/code) |
23
+ | VS Code | ≥ 1.85 | [code.visualstudio.com](https://code.visualstudio.com) |
24
+ | Git | bất kỳ | |
25
+
26
+ > Claude Code cần subscription (Claude Pro / Team / API key).
27
+
28
+ ## Cài framework
29
+
30
+ Chạy từ **thư mục root của project**. Cách khuyến nghị là `--init` — cài framework vào `.agent/` (commit vào git, cả team dùng chung) và tạo shortcut trong `.claude/commands/`.
31
+
32
+ ```bash
33
+ # Single-service project:
34
+ npx @educa-corp/sdd-framework --init --module java-spring
35
+
36
+ # Multi-service monorepo (cài vào từng subfolder trong 1 lệnh):
37
+ npx @educa-corp/sdd-framework --init \
38
+ --services backend:java-spring,web-admin:react,app-mobile:flutter
39
+ ```
40
+
41
+ Kết quả:
42
+ - `.agent/` — toàn bộ framework files (commit vào git, shared với team)
43
+ - `.claude/commands/` — shortcut trỏ về `.agent/commands/`
44
+ - `.agent/FRAMEWORK_VERSION` — tracking version để upgrade
45
+
46
+ ```bash
47
+ git add .agent/ .claude/commands/
48
+ git commit -m "chore: init spec-driven-docs"
49
+ ```
50
+
51
+ > **Multi-repo / umbrella?** Xem hướng dẫn umbrella setup chi tiết trong [Operations › Sync & Update §4 Umbrella mode](../04-operations/sync-and-update.md#4-umbrella-mode--git-submodule).
52
+
53
+ ### Legacy install (global / per-project)
54
+
55
+ ```bash
56
+ npx @educa-corp/sdd-framework # global: ~/.claude/commands/
57
+ npx @educa-corp/sdd-framework --project # project: ./.claude/commands/
58
+ ```
59
+
60
+ ## Kiểm tra cài đặt
61
+
62
+ Mở Claude Code tại project, gõ `/` — bạn sẽ thấy các lệnh:
63
+
64
+ ```
65
+ /setup-ai-first
66
+ /define-product
67
+ /generate-prd
68
+ /generate-bdd
69
+ ...
70
+ ```
71
+
72
+ > Không thấy lệnh? Chạy lại lệnh cài (global lưu tại `~/.claude/commands/`, trên Windows: `ls "$env:USERPROFILE\.claude\commands\"`).
73
+
74
+ ## Upgrade
75
+
76
+ Từ **trong Claude Code** (khuyến nghị — check version, xử lý umbrella mode, review diff):
77
+
78
+ ```
79
+ /update-framework
80
+ ```
81
+
82
+ Hoặc từ terminal:
83
+
84
+ ```bash
85
+ bash scripts/upgrade.sh
86
+ # hoặc:
87
+ npx @educa-corp/sdd-framework@latest --init
88
+ git diff .agent/ && git add .agent/ && git commit -m "chore: upgrade framework"
89
+ ```
90
+
91
+ > Chỉ upgrade framework command files. `project-context.yaml`, `CLAUDE.md`, domain-knowledge, và `.trace/` không bao giờ bị ghi đè. Để sync *content* của project (submodule code/specs) dùng `/sync`.
92
+ >
93
+ > ⚠️ **QC skills & upgrade:** `--init` / `upgrade.sh` ghi đè **toàn bộ** `.agent/` — **gồm cả** `.agent/skills/qc/`. Nếu QC chỉnh skills trực tiếp trong `.agent/skills/qc/`, các thay đổi đó **mất** khi upgrade. Để giữ an toàn, trỏ `paths.qc_skills_dir` ra một repo/submodule QC **ngoài** `.agent/` (vd `qc-base/.claude/skills`) — upgrade không bao giờ chạm tới đó. Chi tiết: [../02-guides/tester/qc-automation.md#skill-sourcing--upgrade-safety](../02-guides/tester/qc-automation.md#skill-sourcing--upgrade-safety).
94
+
95
+ ## QC automation stack (tùy chọn)
96
+
97
+ Bộ QC suite chính thức (`/qc-*`) là **native** trong framework. Hai lệnh cuối — `/qc-run-test` và `/qc-report` — dùng stack module **`qc-playwright`**, **độc lập với dev module**. Cài riêng:
98
+
99
+ ```bash
100
+ # 1. Python 3 + pytest-playwright
101
+ pip install pytest-playwright
102
+
103
+ # 2. Cài browsers
104
+ python3 -m playwright install
105
+ ```
106
+
107
+ `qc-playwright` = Python + pytest-playwright + Page Object (output: Playwright Trace + pytest-html). Chi tiết pipeline: [../02-guides/tester/qc-automation.md](../02-guides/tester/qc-automation.md).
108
+
109
+ ## VS Code extension (khuyến nghị)
110
+
111
+ **Spec Driven Docs Tools** là VS Code extension với 2 panels. Không bắt buộc nhưng khuyến nghị. VS Code tự cập nhật khi có version mới.
112
+
113
+ ```bash
114
+ code --install-extension SpecDrivenDocsTools.spec-driven-docs-tool
115
+ ```
116
+
117
+ Hoặc: `Ctrl+Shift+P` → **"Extensions: Install from Marketplace"** → search **Spec Driven Docs Tools**.
118
+
119
+ ### Panel 1 — Review Board
120
+
121
+ Đọc `*-findings.yaml` từ `.agent/review/` — hỗ trợ findings từ mọi review command (`/refine-prd`, `/review-context`, `/review-tech-docs`).
122
+
123
+ - Lens tabs: All / QA / DEV / SA / PO hoặc PRD / BDD / TECH.
124
+ - Mỗi finding có badge `⚡ auto-fix` / `👤 human`.
125
+ - 4 actions: Accept · Modify (có note) · Defer · Reject — kèm progress bar, full-text search.
126
+ - **Smart Apply** spawn terminal chạy đúng lệnh `--resume`.
127
+
128
+ Mở Review Board: sidebar panel (Activity Bar), hoặc right-click file `*-findings.yaml` → "Open Review Board", hoặc Command Palette. Nếu panel trống: file phải có đuôi `-findings.yaml`, nằm trong `.agent/review/`, và đóng hẳn rồi mở lại VS Code.
129
+
130
+ ### Panel 2 — Living Documentation
131
+
132
+ Đọc `.trace/*.tsv` — dashboard traceability health toàn project.
133
+
134
+ - Stat cards: PRDs, Use Cases, Scenarios, Code Cov%, Test Cov%, Drift, Gap.
135
+ - Drill-down: PRD → UC → per-scenario table (Spec ver, Gen ver, Code, Tests, `dev_selftest`, `qc_status`, Waiting on, Status). *Waiting on* = `qc_owner` + `qc_blocked_by` (chờ dev → `BUG-{id}` / chờ PO → `GAP-{id}`).
136
+ - Status badges: ✅ OK · ⚠️ DRIFT · 🔴 GAP · — UNTRACKED. Filter + search + live reload.
137
+
138
+ Mở: `Ctrl+Shift+P` → **"Spec Driven Docs Tools: Open Living Documentation"**. Mở được cả ở umbrella root lẫn trong một service submodule riêng lẻ. Nếu trống, chạy `/generate-bdd` cho ≥1 feature để tạo file `.trace/{UC-ID}-{platform}.tsv` đầu tiên.
139
+
140
+ > Report canonical sinh vào spec module tại `{spec_source}/.living-docs/` (gitignored); bản mirror cục bộ ở `./.trace`. Chi tiết traceability: [core-concepts.md](core-concepts.md) và [../03-concepts/traceability.md](../03-concepts/traceability.md).
141
+
142
+ ## Uninstall
143
+
144
+ **Mac/Linux:**
145
+ ```bash
146
+ rm -rf .agent/ .claude/commands/
147
+ ```
148
+
149
+ **Windows (PowerShell):**
150
+ ```powershell
151
+ Remove-Item -Recurse -Force .agent, .claude\commands
152
+ ```
153
+
154
+ ---
155
+
156
+ Cài xong? → [quickstart.md](quickstart.md) để chạy feature đầu tiên.
@@ -0,0 +1,86 @@
1
+ [📚 Docs](../README.md) › [Getting Started](README.md) › Quick Start
2
+
3
+ # Quick Start
4
+
5
+ Chạy feature đầu tiên end-to-end theo happy path. Mở Claude Code tại root project và làm theo thứ tự.
6
+
7
+ ## Mục lục
8
+
9
+ - [Bước 0 — Setup project (một lần)](#bước-0--setup-project-một-lần)
10
+ - [Happy-path command sequence](#happy-path-command-sequence)
11
+ - [Bước tiếp theo](#bước-tiếp-theo)
12
+
13
+ ## Bước 0 — Setup project (một lần)
14
+
15
+ ```bash
16
+ # 1. Cài framework (nếu chưa) — xem installation.md
17
+ npx @educa-corp/sdd-framework --init
18
+
19
+ # 2. Mở project trong Claude Code, tạo cấu trúc + config files:
20
+ /setup-ai-first
21
+ ```
22
+
23
+ `/setup-ai-first` tạo cấu trúc thư mục (`specs/`, `tech-docs/`, `.trace/`, `.agent/`, `CLAUDE.md`). Sau đó điền thông tin thực tế vào 4 file config:
24
+
25
+ | File | Nội dung |
26
+ |------|----------|
27
+ | `CLAUDE.md` | Architecture layers, coding standards, git conventions |
28
+ | `.agent/project-context.yaml` | Tech stack, services, paths, ticket prefix |
29
+ | `specs/domain-knowledge/business-dictionary.md` | Canonical terms, banned terms |
30
+ | `specs/domain-knowledge/core-entities.md` | Entity glossary (fields, relationships) |
31
+
32
+ > Project đã có sẵn `specs/`, `CLAUDE.md`, `.agent/project-context.yaml`? Bỏ qua bước này, vào thẳng happy path bên dưới. Chi tiết điền config + Figma setup: xem [../02-guides](../02-guides) và [../03-concepts](../03-concepts).
33
+
34
+ ## Happy-path command sequence
35
+
36
+ Discovery → PRD → BDD → Tech Design → Code → Dev self-check:
37
+
38
+ ```
39
+ # PHASE 1 — DISCOVERY
40
+ /define-product
41
+ → specs/product-definition/{slug}.md
42
+
43
+ # PHASE 2 — PRD
44
+ /generate-prd specs/product-definition/{slug}.md
45
+ → specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md
46
+ /refine-prd specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md # AI suggestions → Review Board
47
+ /refine-prd --resume specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md # apply + bump version
48
+ /review-context specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md # quality gate (P0–P5)
49
+ /review-context --resume specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md
50
+ → ✅ 0 critical → PO đặt | **Status** | approved | trong Metadata → tiếp Phase 3
51
+
52
+ # PHASE 3 — SPEC & DESIGN
53
+ # (FE/App only) /generate-design-spec specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md → designer + PO sign-off
54
+ /generate-bdd specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md
55
+ → specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature
56
+ /review-context specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature
57
+ /review-context --resume specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature # apply + bump bdd_version + reset @trace.status draft
58
+ → ✅ 0 critical → đặt # @trace.status: approved trong .feature → tiếp Tech Design
59
+ /generate-tech-docs specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature
60
+ → specs/{domain}/{prd-slug}/tech-docs/{TICKET-ID}-tech-design.md (1 doc full-stack/PRD)
61
+ /review-tech-docs specs/{domain}/{prd-slug}/tech-docs/{TICKET-ID}-tech-design.md
62
+ /review-tech-docs --resume specs/{domain}/{prd-slug}/tech-docs/{TICKET-ID}-tech-design.md
63
+
64
+ # PHASE 4 — CODE
65
+ /generate-code specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature
66
+ → src/... (@trace.implements tags)
67
+ /review-code # fix CRITICAL / MAJOR
68
+
69
+ # PHASE 5 — DEV SELF-CHECK (dev verify code của mình — KHÔNG phải QC suite chính thức)
70
+ /dev-gen-test specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature
71
+ → src/test/... (@trace.verifies tags)
72
+ /dev-run-test # sets dev_selftest in trace
73
+ /dev-smoke-test # optional — live endpoint check
74
+ /validate-traces {domain} # coverage & drift
75
+ ```
76
+
77
+ Mỗi review command ghi findings vào `.agent/review/*-findings.yaml`. Mở **Review Board** (VS Code panel) → Accept / Modify / Defer / Reject từng finding → chạy `--resume` để apply. Quick-fix không qua Review Board: `/review-context --fix {file}` (chỉ apply auto-fixable).
78
+
79
+ > **FE/App:** `/generate-code --phase=ui` (UI + mock adapter, tester test ngay) rồi `--phase=integration` (wire API thật sau sign-off).
80
+
81
+ ## Bước tiếp theo
82
+
83
+ - Hiểu khái niệm phía sau pipeline → [core-concepts.md](core-concepts.md).
84
+ - QC suite chính thức (`/qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report`) → [../02-guides/tester/qc-automation.md](../02-guides/tester/qc-automation.md).
85
+ - Role guides, scenarios thực tế, multi-repo/umbrella → [../02-guides](../02-guides) và [../03-concepts](../03-concepts).
86
+ - Full command reference → [../05-reference](../05-reference).
@@ -0,0 +1,26 @@
1
+ [📚 Docs](../README.md) › Guides
2
+
3
+ # Guides — Role Playbooks
4
+
5
+ Mỗi role trong framework spec-driven-docs có một guide riêng: vai trò, commands, workflow, và các tình huống thực tế. Bắt đầu từ guide khớp với role của bạn.
6
+
7
+ ## Mục Lục
8
+
9
+ | Guide | Dành cho | Nội dung |
10
+ |---|---|---|
11
+ | [Product Owner / BA](product-owner/README.md) | PO, BA | Viết PRD platform-agnostic, generate Design Spec + BDD, handoff cho dev team |
12
+ | [Developer (FE / BE / App)](developer/README.md) | Dev | Đọc PRD + BDD từ spec submodule, generate tech-docs + code, dev self-check, trace system |
13
+ | [Tester / QA](tester/README.md) | QA / Tester / QC | Spec-manifest, đọc spec chain, viết test cases, `/report-bug` + `/propose-scenario`, và chương **[QC Automation](tester/qc-automation.md)** (pipeline `/qc-*` 6 bước, `qc_status`, stack `qc-playwright`) — **một role duy nhất** |
14
+ | Designer | Designer, UX | Tham gia giai đoạn Design Spec — sign-off màn hình + component trước khi PO gen BDD. Chưa có guide riêng; xem [Product Owner › Design Spec](product-owner/scenarios.md#tình-huống-3--tạo-design-spec-và-bdd-sau-khi-prd-approved) để biết điểm giao. |
15
+
16
+ ## Phân biệt nhanh hai luồng test
17
+
18
+ - **Dev self-check** — `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test`, ghi `dev_selftest`. Smoke check của riêng dev, KHÔNG phải coverage chính thức.
19
+ - **QC chính thức** — pipeline `/qc-analyze … /qc-report`, ghi `qc_status`. Bộ test authoritative, do QC chạy.
20
+
21
+ Hai tín hiệu này đứng cạnh nhau trong Living Docs và không ghi đè nhau.
22
+
23
+ ## Xem thêm
24
+
25
+ - [Concepts › Traceability](../03-concepts/traceability.md) — trace chain PRD → BDD → Code
26
+ - [Reference › Commands](../05-reference/commands.md) — danh mục đầy đủ mọi command
@@ -0,0 +1,68 @@
1
+ [📚 Docs](../README.md) › [Guides](README.md) › Checklist Input BDD (System/BE)
2
+
3
+ # Checklist Input BDD (System / BE) — Để BDD Chuẩn Ngay Lần Đầu
4
+
5
+ > Áp cho `/generate-bdd` khi chọn platform **`system`** (BDD cho BE). Chuẩn bị đúng đầu vào để không phải sinh lại.
6
+
7
+ ## Hiểu trước cho đúng: System BDD có HAI kiểu sinh
8
+
9
+ Khi chọn platform `system`, lệnh tự phân loại:
10
+
11
+ - **BE thuần** (feature không có web/app) → System BDD **sinh thẳng từ PRD** (AC / Business Rules / Business Logic).
12
+ - **BE trong feature đa-platform** → System BDD **tổng hợp từ web + app BDD đã có** (BE suy ra để phục vụ các luồng client).
13
+
14
+ → Biết mình ở kiểu nào mới chuẩn bị đúng.
15
+
16
+ ---
17
+
18
+ ## Phần CHUNG — cả hai kiểu đều cần
19
+
20
+ **1. PRD đã duyệt + Luật/AC rõ ràng** *(đòn bẩy số 1)*
21
+ System BDD phủ **mỗi AC và mỗi Business Rule → ít nhất 1 scenario**. PRD mơ hồ ở Business Rules / Logic = BDD mơ hồ. Đây là chỗ quyết định nhiều nhất.
22
+
23
+ **2. Loại API đã chốt đúng trong PRD**
24
+ - **"Đã có sẵn"** (brownfield) → bảng **Existing API Contract trong PRD phải đầy đủ**, không còn dấu "⛔ còn thiếu". Lệnh dùng bảng này làm chuẩn và **bỏ qua bước tổng hợp**. Còn thiếu = BDD dễ bịa / sai shape.
25
+ - **"Tự làm mới"** → contract thiết kế sau; BDD chỉ tả hành vi nghiệp vụ.
26
+
27
+ **3. Từ điển + danh sách thực thể đã cập nhật**
28
+ System BDD viết bằng **ngôn ngữ sự kiện nghiệp vụ** ("hệ thống nhận X → trả về Y"), **không** dùng từ giao diện (click/tap), **không** chốt cứng shape JSON kỹ thuật. Tên thực thể / trường / enum phải đúng `core-entities.md`.
29
+
30
+ **4. Domain khớp cấu hình service** *(chế độ umbrella)*
31
+ Domain trong PRD phải khớp một service trong config; lệch là lệnh **dừng**.
32
+
33
+ ---
34
+
35
+ ## Phần RIÊNG theo kiểu
36
+
37
+ ### Nếu BE trong feature đa-platform (tổng hợp)
38
+
39
+ **5. Đã sinh web + app BDD TRƯỚC — đúng thứ tự outside-in**
40
+ Nếu sinh `system` khi **chưa có** web/app BDD → lệnh tưởng là "BE thuần", sinh từ PRD và **bỏ lỡ** các kỳ vọng client thật (token, profile, redirect…). Phải theo thứ tự **web → app → system**.
41
+
42
+ **6. Sẵn sàng quyết "xung đột cross-platform"**
43
+ Nếu web và app **kỳ vọng khác nhau** (response / lỗi / luật) → lệnh **dừng ở CHECKPOINT** bắt PO chọn cách hoà: gộp chung / phân biệt theo platform / tách endpoint. Web+app BDD nên nhất quán, hoặc PO sẵn sàng quyết ngay — nếu không sẽ tắc.
44
+
45
+ ### Nếu BE thuần
46
+
47
+ Bỏ qua câu 5–6. Dồn lực vào câu 1–3: PRD Business Rules / Logic + contract + thực thể.
48
+
49
+ ---
50
+
51
+ ## Checklist nhanh — trước khi `/generate-bdd` (system)
52
+
53
+ - [ ] PRD `approved`, mỗi AC/BR đủ rõ để suy ra scenario
54
+ - [ ] Loại API đã chốt; brownfield → bảng Existing API Contract **đầy đủ** (hết ⛔)
55
+ - [ ] `business-dictionary` + `core-entities` cập nhật (sự kiện / thực thể)
56
+ - [ ] Domain khớp cấu hình service (umbrella)
57
+ - [ ] *(đa-platform)* web + app BDD đã sinh + review **trước** system
58
+ - [ ] *(đa-platform)* sẵn sàng quyết xung đột cross-platform
59
+
60
+ ---
61
+
62
+ ## Sau khi sinh BDD
63
+
64
+ `/review-context` (BDD) bắt nốt sạn (coverage, Gherkin R1–R10, thuật ngữ); khi 0 critical → người duyệt đặt `# @trace.status: approved` rồi mới sang Tech Docs / Code / QC. Chuẩn bị tốt checklist trên thì bước review nhẹ.
65
+
66
+ ---
67
+
68
+ ← [Guides](README.md) · Liên quan: [Checklist Input PRD](prd-input-checklist.md) · [Checklist Input Tech-Docs (BE)](tech-docs-input-checklist.md)
@@ -0,0 +1,49 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › Developer
2
+
3
+ # Hướng Dẫn Developer — SDD Framework
4
+
5
+ Tài liệu dành cho **Developer (FE / BE / App)** — vai trò, commands, trace system, workflow, và các tình huống thực tế. Được chia nhỏ theo chủ đề để dễ đọc:
6
+
7
+ ## Mục Lục
8
+
9
+ | Trang | Nội dung |
10
+ |---|---|
11
+ | [Commands](commands.md) | Bảng lệnh cho dev · project lessons · xử lý feedback tester · khi nào dùng `--phase` |
12
+ | [BDD & Trace System](bdd-and-trace.md) | Tại sao BDD quan trọng với dev · `@trace.*` fields · trace chain · khi nào `/validate-traces` |
13
+ | [Checklist input BDD (System/BE)](../bdd-input-checklist.md) | Chuẩn bị để `/generate-bdd` (system) chuẩn ngay lần đầu |
14
+ | [Checklist input Tech-Docs (BE)](../tech-docs-input-checklist.md) | BDD khác tech-doc thế nào · chuẩn bị để `/generate-tech-docs` (BE) ra API contract chuẩn lần đầu |
15
+ | [Workflow](workflow.md) | Luồng làm việc cơ bản từ nhận PRD đến tạo PR |
16
+ | [Tình huống thực tế](scenarios.md) | 8 scenario: nhận PRD mới, đọc System/Web BDD, PRD đổi, API sign-off, bug từ tester, design spec, brownfield, umbrella, validate-traces |
17
+ | [Checklist trước khi tạo PR](pr-checklist.md) | Checklist verify trước khi mở PR |
18
+
19
+ ## Vai Trò Dev Trong Framework
20
+
21
+ ```
22
+ PO/BA Dev
23
+ ────────────────────── ──────────────────────────────────────
24
+ /define-product /review-context (đọc PRD + BDD)
25
+ /generate-prd → đọc BDD từ spec submodule
26
+ /refine-prd /generate-tech-docs (từ BDD → Tech Docs)
27
+ /review-context /generate-code (từ BDD + Tech Docs → Code)
28
+ /generate-design-spec → /dev-gen-test
29
+ /generate-bdd (web) /review-code
30
+ /generate-bdd (app) /dev-run-test
31
+ /generate-bdd (system) /fix-bug / /debug
32
+ /validate-traces
33
+ ```
34
+
35
+ **Dev chịu trách nhiệm:**
36
+ - Đọc và hiểu PRD + BDD từ spec submodule trước khi bắt đầu
37
+ - **KHÔNG tự generate BDD** — BDD đã được PO generate trong spec repo
38
+ - Đảm bảo code trace về đúng BDD scenario, BDD trace về đúng PRD
39
+ - **Duyệt BDD:** sau khi `/review-context` (BDD) sạch critical, Dev-lead/SA đặt `# @trace.status: approved` trong `.feature` (cổng trước tech-docs / code / QC)
40
+ - Báo PO/BA khi PRD hoặc BDD có gì không rõ hoặc mâu thuẫn — không tự suy diễn
41
+
42
+ **Dev KHÔNG làm:**
43
+ - Viết/sửa PRD — đó là việc của PO/BA
44
+ - Viết/sửa Design Spec — đó là việc của PO/BA + Designer
45
+ - Approve PRD — chỉ PO mới có quyền này
46
+
47
+ ---
48
+
49
+ *Xem thêm:* [Product Owner Guide](../product-owner/README.md) · [Tester Guide](../tester/README.md) · [chương QC Automation](../tester/qc-automation.md) · [Concepts › Traceability](../../03-concepts/traceability.md) · [Reference › Commands](../../05-reference/commands.md)
@@ -0,0 +1,126 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › [Developer](README.md) › BDD & Trace System
2
+
3
+ # BDD & Trace System
4
+
5
+ - [Tại sao BDD quan trọng với Dev](#tại-sao-bdd-quan-trọng-với-dev)
6
+ - [Hiểu Trace System](#hiểu-trace-system)
7
+
8
+ ## Tại Sao BDD Quan Trọng Với Dev
9
+
10
+ ### BDD không phải "viết test thêm"
11
+
12
+ BDD là **spec thực thi được** — nó định nghĩa CHÍNH XÁC hệ thống phải làm gì trước khi viết một dòng code.
13
+ ```
14
+ PRD (business language) → BDD (technical spec) → Code (implementation)
15
+ "Sai password 5 lần Given 5 failed logins if failCount >= 5:
16
+ → khoá 30 phút" Then account locked lockAccount(30min)
17
+ And locked_until = now+30m
18
+ ```
19
+
20
+ ### BDD định hướng kiến trúc code
21
+
22
+ BDD scenario là unit of work — mỗi scenario ánh xạ thành một test case, một function, một API endpoint. Viết BDD trước buộc dev phải nghĩ về interface trước implementation.
23
+ ```gherkin
24
+ # BDD này buộc dev phải tạo:
25
+ # - POST /auth/login endpoint
26
+ # - lockAccount(duration) service method
27
+ # - AccountLocked exception/response
28
+
29
+ Scenario: Lock account after 5 failed attempts
30
+ Given user "alice@example.com" exists
31
+ When user attempts login with wrong password 5 times
32
+ Then account is locked for 30 minutes
33
+ And login returns 423 Locked with "retry_after" header
34
+ ```
35
+
36
+ ### BDD là tài liệu sống
37
+
38
+ Khi BDD pass → code đang hoạt động đúng spec. Khi BDD fail → code lệch khỏi yêu cầu. Không cần đọc PRD để biết feature có đang hoạt động không — chạy BDD là biết ngay.
39
+
40
+ ### BDD đến từ spec repo — Dev đọc, không tự gen
41
+
42
+ BDD được PO generate trong spec repo, nằm tại `specs/{domain}/{prd-slug}/bdd/`:
43
+
44
+ | Subfolder | Platform | Dev team đọc |
45
+ |---|---|---|
46
+ | `web/` | FE/Web (clicks, sees, navigates) | FE/Web dev |
47
+ | `app/` | Mobile (taps, sees screen, navigates) | App dev |
48
+ | `system/` | System/BE (request, response, business rules) | BE dev |
49
+
50
+ Cả 3 subfolder đều trace về **cùng 1 PRD**. BE không cần đọc BDD của FE và ngược lại.
51
+
52
+ ## Hiểu Trace System
53
+
54
+ Framework dùng metadata `@trace.*` để liên kết PRD → BDD → Code. (Chi tiết khái niệm: [Concepts › Traceability](../../03-concepts/traceability.md).)
55
+
56
+ ### Các trace fields quan trọng
57
+
58
+ | Field | Vị trí | Ý nghĩa |
59
+ |---|---|---|
60
+ | `Domain` | bảng Metadata PRD | Domain của feature (auth, payment, ...) — dùng để route vào đúng service submodule |
61
+ | `@trace.module` | BDD / Tech Doc header | Module trong codebase sẽ implement |
62
+ | `@trace.prd` | BDD / Tech Doc header | Link về PRD gốc |
63
+ | `@trace.bdd` | Code comment / test | Link về BDD scenario |
64
+ | `Status` | bảng Metadata PRD | `draft` / `approved` — chỉ code khi `approved` |
65
+ | `@trace.status` | BDD `.feature` header | `draft` / `approved` — Dev-lead/SA đặt approved sau review-context BDD sạch; mirror → `uc_status` (dashboard) |
66
+ | `dev_selftest` | Trace TSV | `pass` / `fail` / `not_run` — kết quả dev self-check, set bởi `/dev-run-test`. Surfaced trong Living Docs để QC biết dev đã chạy self-check — **KHÔNG phải coverage chính thức** |
67
+ | `dev_selftest_at` | Trace TSV | Timestamp lần chạy `/dev-run-test` gần nhất |
68
+ | `qc_status` | Trace TSV | `pass` / `fail` / `skip` / `not_run` — kết quả **QC chính thức**, set bởi `/qc-run-test` (do QC chạy, KHÔNG phải dev). Orthogonal với `dev_selftest` và với coverage `status` |
69
+ | `qc_run_at` | Trace TSV | Timestamp lần chạy `/qc-run-test` gần nhất |
70
+
71
+ ### Ví dụ trace chain hoàn chỉnh
72
+
73
+ ```
74
+ specs/auth/login/{TICKET-ID}-login.md ← Metadata: Domain: auth, Status: approved
75
+
76
+ specs/auth/login/bdd/system/FT-001-UC1-login.feature ← @trace.prd: FT-001 · web/app/system riêng (system tổng hợp từ web+app)
77
+
78
+ src/auth/auth.service.ts ← // @trace.bdd: FT-001-UC1-SC1 (service submodule)
79
+
80
+ {spec_source}/.trace/auth/login/FT-001.tsv ← coverage/drift — authoritative ở SPEC repo
81
+ ```
82
+
83
+ ### Khi nào chạy /validate-traces?
84
+
85
+ - Sau khi refactor đổi tên file/function
86
+ - Sau khi PRD được PO cập nhật (version mới)
87
+ - Trước khi tạo PR lớn
88
+ - Khi CI báo trace validation fail
89
+ - **Sau mỗi codegen session trong umbrella mode** — để sync Living Docs panel
90
+
91
+ ```
92
+ /validate-traces
93
+ → Sẽ report: broken links, orphan BDD (không có PRD), dead code traces
94
+ ```
95
+
96
+ **Lưu ý khi dùng umbrella (submodule):**
97
+ ```
98
+ Vấn đề: Living Docs panel mở ở umbrella root (hoặc một service submodule đơn lẻ) → nếu không có mirror local → TRỐNG.
99
+ TSV authoritative nằm committed MỘT chỗ ở spec repo: {spec_source}/.trace/
100
+
101
+ Giải pháp: /validate-traces (hoặc /sync) regenerate canonical trace-report.json + TSV mirror
102
+ trong SPEC MODULE tại {spec_source}/.living-docs/ (gitignored), đồng thời ghi
103
+ mirror local tại ./.trace của workspace hiện tại để panel không trống khi dev mở
104
+ một service submodule đơn lẻ.
105
+
106
+ Lệnh chạy sau mỗi session:
107
+ /validate-traces
108
+ → Reads .trace/*.tsv authoritative (committed) MỘT chỗ: {spec_source}/.trace/ (mỗi row mang @trace.service)
109
+ → Writes trace-report.json → {spec_source}/.living-docs/ (gitignored, regenerated bởi /sync hoặc /validate-traces)
110
+ → Writes panel mirror → ./.trace của workspace hiện tại (non-empty khi mở repo lẻ)
111
+ → Living Docs panel cập nhật ngay
112
+ ```
113
+
114
+ > **Authoritative vs mirror:** `.trace/*.tsv` được **commit** ở spec repo `{spec_source}/.trace/` (nguồn sự thật, một chỗ). `{spec_source}/.living-docs/` và `./.trace` chỉ là mirror gitignored, regenerated bởi `/sync` hoặc `/validate-traces`.
115
+
116
+ Thêm `.living-docs/` (spec module) và umbrella/workspace `.trace/` mirror vào `.gitignore`:
117
+ ```
118
+ # .gitignore — spec module
119
+ .living-docs/
120
+ # .gitignore — workspace/umbrella root (mirror, không commit)
121
+ .trace/
122
+ ```
123
+
124
+ ---
125
+
126
+ ← [Commands](commands.md) · Tiếp theo: [Workflow](workflow.md)
@@ -0,0 +1,76 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › [Developer](README.md) › Commands
2
+
3
+ # Commands Dành Cho Dev
4
+
5
+ | Command | Mục đích | Khi nào dùng |
6
+ |---|---|---|
7
+ | `/sync` `[spec-branch]` | **One-command setup hoặc update** — git pull + submodule sync + Living Docs refresh. Truyền branch để override branch spec submodule (vd `/sync develop`) | **Mỗi sáng trước khi bắt đầu work** |
8
+ | `/update-framework` | Nâng cấp **bản thân framework** (`.agent/commands/`, steps/, modules/) từ npm | Khi có version framework mới — không đụng project-context/CLAUDE.md |
9
+ | `/review-context {prd-file}` | Đọc + xác nhận PRD + BDD đủ rõ trước khi code — fan-out review dimension thành sub-agent song song + completeness-critic loop, findings file đầy đủ ngay trong 1 lần chạy | **Bước đầu tiên** khi nhận PRD mới |
10
+ | `/generate-tech-docs {1..n BDD file}` | **1 doc full-stack/PRD.** Trỏ vào file BDD (system→§4 API contract; web/app→§4.5 client design) — gộp vào `{TICKET-ID}-tech-design.md`, append qua nhiều lần chạy. Cảnh báo >5 file/lần. Client thiếu design-spec → §4.5 degraded (soft) | Sau BDD approved. Nên trỏ System BDD trước (chốt §4), rồi web/app BDD (append §4.5 map theo §4.1) |
11
+ | `/generate-code {bdd-file}` | Sinh code — BE hoặc FE khi API đã sẵn sàng. Guard mềm: BDD `@trace.status` approved; FE/App design-spec approved+fresh+sanity | Sau khi tech docs `approved` |
12
+ | `/generate-code {bdd-file} --phase=ui` | FE: gen UI + mock adapter. Mock **shape** từ BE contract nếu có (chuẩn) → else infer từ System BDD + warn (`mock_source=contract\|system-bdd`); fixture values luôn từ System BDD | Ngay sau khi đọc BDD (BE chưa cần deploy API) |
13
+ | `/generate-code {bdd-file} --phase=integration` | FE: wire API thật thay mock | Sau khi sign-off gate `approved` |
14
+ | `/dev-gen-test {bdd-file}` | **Dev self-check** — sinh test cases từ BDD để dev tự verify code mình vừa gen (KHÔNG phải bộ test chính thức của QC/dev-team) | Song song hoặc sau generate-code |
15
+ | `/review-code {file}` | Review code theo 4 lăng kính (Traceability/Layer/Coding Standards/Spec Compliance) | Trước khi tạo PR |
16
+ | `/review-tech-docs {tech-doc-file}` | Review chất lượng Tech Docs | Sau generate-tech-docs |
17
+ | `/dev-run-test` | **Dev self-check** — chạy test do dev tự gen để xác nhận code mình hoạt động (smoke/self-verify, KHÔNG phải coverage chính thức) — *umbrella mode: tự `cd` vào service_root, dùng service's `test_command`*. Ghi `dev_selftest` (pass/fail) vào trace TSV | Sau khi code + tests sẵn sàng |
18
+ | `/fix-bug {issue}` | Phân tích + fix bug có trace | Khi có bug report |
19
+ | `/debug {symptom}` | Debug vấn đề chưa rõ nguyên nhân | Khi cần trace root cause |
20
+ | `/dev-smoke-test` | **Dev self-check** — kiểm tra nhanh các luồng chính của code mình vừa làm (smoke, không thay thế bộ test chính thức) | Sau deploy hoặc merge lớn |
21
+ | `/validate-traces` | Kiểm tra toàn bộ trace chain còn hợp lệ | Sau refactor hoặc khi PRD update |
22
+ | `/learn {text}` | Ghi lại lỗi AI hay lặp thành guardrail | Khi AI lặp lại lỗi mà bạn không muốn nó tái diễn |
23
+
24
+ > **Dev self-check vs QC chính thức:** `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` (ghi `dev_selftest`) chỉ là **smoke self-check của riêng dev**. Bộ QC chính thức giờ là native pipeline `/qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report` — **do QC chạy, không phải việc của dev** — và ghi `qc_status` riêng. Chi tiết: [chương QC Automation](../tester/qc-automation.md).
25
+
26
+ > Danh mục đầy đủ mọi command: [Reference › Commands](../../05-reference/commands.md).
27
+
28
+ ## Project Lessons — dạy framework không lặp lỗi
29
+
30
+ AI đôi khi lặp đi lặp lại một lỗi trong dự án (vd: gọi repository thẳng từ controller, quên null-check). Thay vì sửa thủ công mỗi lần, **ghi lại thành "lesson"** — context-loader sẽ nạp nó vào đầu **mọi** lệnh như một ràng buộc cứng.
31
+
32
+ **2 cách ghi nhận:**
33
+ ```bash
34
+ # Cách 1 — chủ động
35
+ /learn AI hay gọi repository thẳng từ controller, phải đi qua service layer
36
+
37
+ # Cách 2 — tự động: khi /review-code, /fix-bug, /debug phát hiện lỗi lặp lại
38
+ # → nó hỏi "Record as a project lesson? (Y/N)" → Y
39
+ ```
40
+
41
+ **Lưu ở đâu:** `paths.lessons_file` (mặc định `specs/domain-knowledge/lessons-learned.md`; umbrella: `.agent/project-lessons.md` mỗi service). **Commit file này** để cả team cùng được bảo vệ.
42
+
43
+ > Đây là **bộ nhớ dự án**, không phải fine-tune model — lesson được nạp vào context mỗi lần chạy, nên AI "nhớ" và không lặp lại. Xem `[CTX LOADED]` có dòng `Lessons: loaded — N guardrails`.
44
+
45
+ ## Xử lý feedback từ tester
46
+
47
+ Tester gửi bug report (`/report-bug`) và đề xuất scenario (`/propose-scenario`) vào `feedback/` của **spec repo**. Khi dev chạy `/sync`, nó liệt kê:
48
+ ```
49
+ 📥 New tester feedback (pulled this sync):
50
+ Bug reports: BUG-20260608-01 FT-001 — ... [layer: Code]
51
+ Scenario proposals: FT-001-trailing-spaces → AC2 (pending review)
52
+ ```
53
+
54
+ Dev hành động theo phân loại:
55
+ - **Bug report** → `/fix-bug {BUG-ID}` (report đã có sẵn spec-context + AC bị vi phạm + layer)
56
+ - **Scenario proposal map vào AC sẵn có** → đặt `Status: accepted` trong file proposal → `/generate-bdd` tự chèn vào `.feature` rồi lưu trữ (`incorporated`); hoặc thêm tay. Rồi `/generate-code` + `/dev-gen-test`
57
+ - **Proposal là yêu cầu mới (PRD change request)** → chuyển PO sửa PRD trước
58
+
59
+ > Bug reports có thể đến từ hai nguồn: Tester dùng `/report-bug` trực tiếp, **hoặc** từ kết quả QC automation (`qc_status: fail` trong `.trace/*.tsv` → QC (hoặc tester) chạy `/report-bug` → `/sync` → dev thấy tại đây). Cả hai đều dùng cùng luồng `/fix-bug`.
60
+
61
+ > Tester chỉ *đề xuất* trong `feedback/` — dev/PO mới đưa vào BDD chính thức. Giữ đúng ownership.
62
+
63
+ ## Khi nào dùng `--phase` cho FE/App?
64
+
65
+ | Tình huống | Command |
66
+ |---|---|
67
+ | API **đã có sẵn** và đang hoạt động | `/generate-code {file}` — không flag, gen real API ngay |
68
+ | BE **chưa ready**, FE muốn bắt đầu ngay | `/generate-code {file} --phase=ui` — UI + mock adapter |
69
+ | Sign-off gate xong, cần wire API thật | `/generate-code {file} --phase=integration` |
70
+ | BE implement (system BDD) | `/generate-code {file}` — không flag |
71
+
72
+ > `--phase` chỉ có giá trị khi BE chưa sẵn sàng. Nếu API đã live → bỏ qua `--phase`, chạy thẳng default.
73
+
74
+ ---
75
+
76
+ ← [Developer Guide](README.md) · Tiếp theo: [BDD & Trace System](bdd-and-trace.md)
@@ -0,0 +1,16 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › [Developer](README.md) › PR Checklist
2
+
3
+ # Checklist Trước Khi Tạo PR
4
+
5
+ - [ ] `/validate-traces` → all green (không broken trace)
6
+ - [ ] `/dev-run-test` → all pass *(umbrella: đảm bảo service có `.agent/project-context.yaml` với `test_command` trước khi chạy)*
7
+ - [ ] `/review-code` → không có issue Critical hoặc Major chưa xử lý
8
+ - [ ] Code trace về đúng BDD scenarios trong `my-project-specs/specs/{domain}/{prd-slug}/bdd/`
9
+ - [ ] Code có `@trace.bdd` comment cho các function implement BDD scenario
10
+ - [ ] BDD `@trace.status: approved` (đã duyệt) trước khi code/PR; FE/App: Design Spec `Status: approved` + `Built from PRD` khớp PRD hiện tại
11
+ - [ ] Tech Docs đã được update nếu có thay đổi API/DB schema
12
+ - [ ] **Không tự sửa BDD** — BDD là của PO, nếu cần update thì báo PO rồi pull lại
13
+
14
+ ---
15
+
16
+ ← [Tình huống thực tế](scenarios.md)