@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,278 @@
1
+ [📚 Docs](../README.md) › [Concepts](README.md) › Pipeline
2
+
3
+ # Pipeline
4
+
5
+ Vòng đời feature đi qua các phase, mỗi transition lớn có **AI review (tìm findings) + cổng duyệt do người quyết** (xem note "Cổng duyệt" bên dưới):
6
+ **Discovery → PRD → Design-Spec → BDD → Tech-Docs → Code → Dev self-check → QC automation → Tester feedback.** Phần sau mô tả từng phase và **step-architecture model** đằng sau mỗi command.
7
+
8
+ ## Mục lục
9
+
10
+ - [Phase overview](#phase-overview)
11
+ - [Workflow chi tiết](#workflow-chi-tiết)
12
+ - [QC automation pipeline (Phase 5b)](#qc-automation-pipeline-phase-5b)
13
+ - [Command internals — step architecture](#command-internals--step-architecture)
14
+ - [gate.md — universal entry](#gatemd--universal-entry)
15
+ - [context-loader.md — context loading sequence](#context-loadermd--context-loading-sequence)
16
+ - [spawn-agent.md — sub-agent orchestration](#spawn-agentmd--sub-agent-orchestration)
17
+ - [report-footer.md — standard output format](#report-footermd--standard-output-format)
18
+
19
+ ---
20
+
21
+ ## Phase overview
22
+
23
+ | Phase | Who | Commands | Output |
24
+ |-------|-----|----------|--------|
25
+ | **0. Setup** *(one-time)* | Tech Lead | `/setup-ai-first`, `/sync`, `/sync-figma-*` | Config files, submodules, component catalog |
26
+ | **1. Discovery** | PO + AI | `/define-product` | `specs/product-definition/{TICKET-ID}-{slug}.md` |
27
+ | **2. PRD** | AI → SA/PO review | `/generate-prd`, `/refine-prd`, `/review-context` | `specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md` |
28
+ | **2b. Design Spec** *(FE/App only)* | AI → Designer/PO sign-off | `/generate-design-spec` | `specs/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{platform}-{slug}.md` |
29
+ | **3. BDD Spec** | AI → SA/Dev review | `/generate-bdd`, `/review-context` | `specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature` |
30
+ | **4. Tech Design** *(1 doc full-stack / PRD)* | AI → SA/Lead review | `/generate-tech-docs`, `/review-tech-docs` | `specs/{domain}/{prd-slug}/tech-docs/{TICKET-ID}-tech-design.md` — MỘT bản vẽ gộp cả BE (API contract, data model, DB) + client (§4.5 component/state/Figma per platform) + sequence xuyên tầng. Input = **file BDD tech lead trỏ** (1..n, batch); **append** vào doc chung khi trỏ BDD mới |
31
+ | **5. Code** | AI → Dev review | `/generate-code` *(FE: `--phase=ui`/`--phase=integration`)*, `/review-code` | `src/...` |
32
+ | **6. Dev Self-Check** | Dev (own code) | `/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test` | `src/test/...` — dev smoke (`dev_selftest`), tách khỏi QC suite |
33
+ | **6b. QC Automation** *(official QC suite)* | QC | `/qc-analyze` → `/qc-plan` → `/qc-design-test` → `/qc-review` → `/qc-run-test` → `/qc-report` | QC test designs + run results — set `qc_status` (`qc-playwright` module) |
34
+ | **7. Trace** | Tech Lead | `/validate-traces` | Coverage matrix + drift report |
35
+ | **8. Tester Feedback** | QA → PO/Dev | `/report-bug`, `/propose-scenario` → `/sync` surfaces | `{spec}/feedback/...` → bug fix / new scenario / PRD update |
36
+ | **Cross-cutting** | Any role | `/sync`, `/learn`, `/update-framework` | Synced repo · project guardrails · upgraded tooling |
37
+
38
+ > **PRD là platform-agnostic (Option C):** Một PRD phục vụ mọi platform — chỉ mô tả business outcome, không UI/API. FE/App: PRD → Design Spec (2b) → BDD. BE: PRD → BDD (skip 2b). Thêm platform sau không cần đổi PRD.
39
+
40
+ > **Cổng duyệt (human sign-off):** mỗi transition lớn có một **cổng do người quyết** — review (AI tìm findings) → người đặt trạng thái `approved` → bước sau. Ba cổng: **PRD** `Status: approved` (PO) · **Design Spec** `Status: approved` (PO+Designer) · **BDD** `@trace.status: approved` (Dev-lead). **Sửa nội dung sau khi duyệt → tự reset về `draft`** (PRD/Design/BDD đều vậy). Các lệnh tiêu thụ (`/generate-bdd`, `/generate-design-spec`, `/generate-tech-docs`, `/generate-code`, `/qc-analyze`) **cảnh báo mềm** nếu nguồn chưa `approved` (cho phép prototype, KHÔNG chặn cứng). Mỗi artifact còn ghi version nguồn để phát hiện **drift**: PRD `applied_to_version` (findings), Design Spec `Built from PRD`, BDD/tech-doc Version Check.
41
+
42
+ ---
43
+
44
+ ## Workflow chi tiết
45
+
46
+ ```
47
+ Phase 1: Discovery
48
+ /define-product ──────────→ specs/product-definition/{slug}.md
49
+ (7 phase Q&A: knowledge sync → feature def → user flow → clarify →
50
+ business rules → business logic → AC → validation matrix)
51
+
52
+ Phase 2: PRD
53
+ /generate-prd ────────────→ specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md
54
+ /refine-prd ──────────────→ .agent/review/{prd-slug}-findings.yaml
55
+ [Review Board: Accept/Modify/Reject]
56
+ /refine-prd --resume → apply + bump version
57
+ /review-context {prd} ────→ .agent/review/{prd-slug}-review-context-findings.yaml
58
+ --fix (auto-fixable) | Review Board → --resume (apply + bump)
59
+ Checks: banned terms (P1) · ambiguity AC/BR (P2) · conflicts (P3) · completeness (P4)
60
+ ✅ 0 critical → PO đặt Status: approved (Metadata) → Phase 2b/3 · ❌ NEEDS_FIX → fix + re-run
61
+
62
+ Phase 2b/3: Design Spec & BDD
63
+ /generate-design-spec ────→ specs/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{platform}-{slug}.md
64
+ (FE/App only — PO supplies node-level Figma link ?node-id= per screen;
65
+ AI fetches each frame via Figma MCP. Screen with no readable link → ❌ Missing → Status giữ draft;
66
+ ghi "Built from PRD: vX" để phát hiện lỗi thời; generate-bdd cảnh báo mềm nếu design-spec chưa approved)
67
+ [Designer review + PO sign-off → Status: approved]
68
+ /generate-bdd ────────────→ specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature
69
+ THỨ TỰ OUTSIDE-IN (khi có client): web → app → system
70
+ System BDD được TỔNG HỢP từ web+app BDD (client-facing trước → BE/system suy ra để phục vụ)
71
+ (project chỉ-BE, không web/app: system gen thẳng từ PRD)
72
+ (apply platform vocabulary: web "clicks" / mobile "taps" / backend "submits a request")
73
+ FE/App: đọc AC-UI + Screen States từ design-spec để phủ scenario (gate: approved + Built-from-PRD còn mới + sanity)
74
+ /review-context {feature} → .agent/review/{uc-id}-review-bdd-findings.yaml
75
+ Checks: PRD coverage (mỗi AC + BR bullet → ≥1 scenario) · Gherkin R1–R10 · compliance C1–C5
76
+ ✅ 0 critical → đặt @trace.status: approved (.feature) → Phase 4
77
+
78
+ Phase 4: Tech Design (MỘT doc full-stack / PRD — input = file BDD tech lead trỏ)
79
+ /generate-tech-docs {1..n file .feature / UC tech lead chọn} → specs/{domain}/{prd-slug}/tech-docs/{TICKET-ID}-tech-design.md
80
+ nạp CHỈ file được trỏ (batch, cảnh báo >5), bồi vào doc chung của PRD → 1 bản vẽ gộp:
81
+ BE §1–§4.4,§6–§8: API contract, data model, DB, caching (brownfield: reverse-document)
82
+ Client §4.5 (mỗi platform): components, state, Figma mapping, API-integration map (mọi call → endpoint §4.1),
83
+ Test Selectors (test-id ổn định cho element có action → QC locate khỏi scan)
84
+ §5 sequence diagram xuyên tầng (component→service→API→external→DB), 1/scenario
85
+ §10 UC Coverage = anchor cho APPEND
86
+ Fresh (chưa có doc) | Append (đã có → chỉ thêm UC/platform mới, cập nhật §10+Changelog, giữ phần cũ)
87
+ Gate: review-BDD sạch (mọi feature) · client thiếu design-spec → §4.5 degraded (soft)
88
+ /review-tech-docs ────────→ .agent/review/{TICKET-ID}-tech-review-findings.yaml
89
+ [Review Board] → --resume (apply + bump revision)
90
+ ✅ APPROVED → Phase 5
91
+
92
+ Phase 5: Code
93
+ /generate-code ───────────→ src/... (@trace.implements tags)
94
+ FE: --phase=ui (UI + mock adapter, tester-ready)
95
+ mock shape: §4 API contract của tech-doc nếu có (chuẩn) → else System BDD (tạm, warn) — fixture values luôn từ System BDD
96
+ → khi tech-doc có §4.5 client (trỏ /generate-tech-docs vào web|app BDD) & approved
97
+ → --phase=integration (wire real API theo §4.5.4 của tech-doc gộp)
98
+ (component enforcement: ✅ existing / ⚠️ TODO blocked / ❌ NEW confirm)
99
+ /review-code ─────────────→ Report: Critical / Major / Minor → fix CRITICAL/MAJOR
100
+
101
+ Phase 5 (cont): Dev Self-Check (dev verifies their OWN code — NOT the official QC suite)
102
+ /dev-gen-test ────────────→ src/test/... (@trace.verifies tags)
103
+ /dev-run-test ────────────→ records dev_selftest (pass/fail/not_run) + dev_selftest_at in trace
104
+ /dev-smoke-test ──────────→ live endpoint check (optional)
105
+ /validate-traces {domain} → coverage matrix + drift detection
106
+
107
+ Phase 5b: QC Automation (the OFFICIAL QC suite — see below)
108
+
109
+ Phase 6: Tester / QC Feedback (QA/QC → PO/Dev, closes the loop)
110
+ /report-bug {UC-ID} ──────→ {spec}/feedback/bug-reports/{BUG-ID}.md (State: Open) → push
111
+ /propose-scenario {UC-ID} → behavior ∈ AC → {spec}/feedback/bdd-proposals/{...}.md → push
112
+ behavior MỚI → {spec}/feedback/prd-change-requests/{...}.md → push
113
+ QC nguồn: /qc-run-test FAIL & /qc-analyze DOC_GAPS cũng route vào đây
114
+ PO/Dev: /sync → "📥 State: Open" → /fix-bug {BUG-ID} (Open→Fixed) · add BDD · update PRD
115
+ QC: /qc-run-test re-verify pass → bug Closed (qc_owner/qc_blocked_by clear)
116
+
117
+ Cross-cutting (any role, anytime)
118
+ /sync ────────────────────→ git pull + submodules + Living Docs + surface feedback
119
+ /learn "AI does X, should Y" → project guardrail (loaded vào mọi command)
120
+ /update-framework ────────→ upgrade framework tooling từ npm
121
+ ```
122
+
123
+ > **Large PRD (> 3 UC hoặc > 300 dòng):** `/generate-bdd`, `/generate-code`, `/dev-gen-test` tự chuyển sang **orchestration mode** — spawn 1 sub-agent/UC (xem [spawn-agent.md](#spawn-agentmd--sub-agent-orchestration)).
124
+
125
+ > **Phase 7 — `/validate-traces` statuses:** ✅ OK (code version khớp spec) · ⚠️ DRIFT (code gen từ PRD/BDD cũ → re-generate) · 🔴 GAP (scenario có trong spec nhưng không có code) · — UNTRACKED (scenario ghi nhận nhưng chưa code-gen). Chi tiết: [traceability.md](traceability.md).
126
+
127
+ ---
128
+
129
+ ## QC automation pipeline (Phase 5b)
130
+
131
+ Bộ test QC **chính thức** — native pipeline, chạy như một **branch sau khi BDD `@trace.status: approved`** (review-context BDD sạch + người duyệt; `/qc-analyze` cảnh báo mềm nếu chưa), song song / sau khi dev `/generate-code`. 6 stage tuần tự, port từ agent của team QC (QC repo nay chỉ còn reference):
132
+
133
+ ```
134
+ BDD approved (specs/{domain}/{prd-slug}/bdd/*.feature)
135
+
136
+ /qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report
137
+ (đọc UC/SC, phân tích) chạy test → set qc_status
138
+ ▼ ▼
139
+ QC analysis + test cases .trace/*.tsv: qc_status
140
+ → {qc_dir}/{UC-ID}/ (visible, mặc định docs/) (pass/fail/skip/not_run)
141
+ REQUIREMENT_ANALYSIS.md · DOC_GAPS.md · + qc_owner / qc_blocked_by
142
+ TEST_PLAN.md · test-cases/*.Test.md (skills load từ {qc_skills_dir})
143
+
144
+ ── Feedback loop về spec (đóng vòng) ───────────────────────────────────
145
+ /qc-analyze DOC_GAPS blocker (spec sai/mơ hồ) ┐
146
+ /qc-run-test FAIL = product-gap ├─▶ /report-bug · /propose-scenario
147
+ /qc-report tổng hợp gap → in sẵn lệnh ┘ │ (cùng flow tester)
148
+
149
+ feedback/ trong spec repo (State: Open)
150
+ → commit+push → PO/Dev thấy qua /sync (xem bug-flow.md)
151
+
152
+ Mapping: mỗi QC test → scenario qua @trace.verifies={UC-ID}-SC{N}
153
+ ```
154
+
155
+ - **Implementation module:** `qc-playwright` (Python + pytest-playwright + Page Object; Playwright Trace + pytest-html, KHÔNG dùng Allure). ĐỘC LẬP với dev implementation module — dùng bởi `/qc-run-test` & `/qc-report`.
156
+ - **Khác biệt với dev self-check:** dev self-check (`/dev-*`) → `dev_selftest` (smoke, dev tự kiểm); QC automation (`/qc-*`) → `qc_status` (coverage QC chính thức). Hai tín hiệu **orthogonal**, cả hai surface trong Living Docs → xem [traceability.md](traceability.md).
157
+
158
+ ---
159
+
160
+ ## Command internals — step architecture
161
+
162
+ Mỗi command trong `.agent/commands/` được compose từ các **step file** dùng chung trong `.agent/steps/`. Đây là nền tảng — mọi command gọi chúng theo thứ tự trước khi chạy logic riêng.
163
+
164
+ | File | Role | Called by |
165
+ |------|------|-----------|
166
+ | `gate.md` | Universal entry — model check, file resolution, context load, user checkpoint | Mọi command |
167
+ | `context-loader.md` | Multi-step context loading (stack → service routing → conventions → arch → safety → domain → UI → recap) | `gate.md` Step 2 |
168
+ | `spawn-agent.md` | Sub-agent orchestration cho PRD lớn | `generate-bdd`, `generate-code`, `dev-gen-test` |
169
+ | `capture-lesson.md` | Append/refine guardrail trong project lessons file | `learn`, `review-code`, `fix-bug`, `debug` |
170
+ | `report-footer.md` | Standard output format (status badge, artifact list, next command) | Mọi command |
171
+
172
+ ### gate.md — universal entry
173
+
174
+ Mọi command bắt đầu ở đây, theo thứ tự:
175
+
176
+ | Step | What it does |
177
+ |------|-------------|
178
+ | **Step 0** | Sub-agent mode check — nếu `$ARGUMENTS` là JSON payload với `_agent_mode: true`, skip Step 1–3, dùng slim context trực tiếp |
179
+ | **Step 0-B** | Model check — prompt switch sang `claude-opus` cho generation phức tạp; `S` để skip |
180
+ | **Step 1** | Resolve target file từ `$ARGUMENTS`; nếu thiếu, liệt kê candidate và hỏi user chọn |
181
+ | **Step 2** | Execute `context-loader.md` — load toàn bộ project context vào working memory |
182
+ | **Step 3** | CHECKPOINT — hiển thị summary (target file, stack, module, domains), chờ `Y` |
183
+
184
+ ```
185
+ CHECKPOINT
186
+ -----------
187
+ Target : specs/auth/FEAT-042-login/FEAT-042-login.md
188
+ Project : My App
189
+ Tech stack : TypeScript / React 18
190
+ Module : react
191
+ Domains : auth, profile
192
+
193
+ Proceed? (Y/N)
194
+ ```
195
+
196
+ ### context-loader.md — context loading sequence
197
+
198
+ Load toàn bộ project context vào working memory theo thứ tự ưu tiên nghiêm ngặt:
199
+
200
+ | Step | Priority | What loads |
201
+ |------|----------|-----------|
202
+ | 1 | PROJECT-CONFIG | `project-context.yaml` → stack, conventions, domains, services, paths |
203
+ | 1.5 | SERVICE ROUTING | *(umbrella only)* detect active domain, route `trace_dir` (+ code) tới service submodule, store `service_root`. Khi `spec_source` set: `specs_dir` (BDD) / `tech_docs_dir` / PRD / design-spec / domain-knowledge / feedback → **spec repo** (cross-team), KHÔNG per-service |
204
+ | 1.6 | SERVICE CONVENTIONS | *(umbrella only)* load `{service_root}/.agent/project-context.yaml` → override `test_command`, `build_command`, `paths.trace_dir` |
205
+ | 2 | PROJECT-CONFIG | `.agent/modules/{module}/stack-profile.yaml` → layer patterns |
206
+ | 3 | **CRITICAL** | `CLAUDE.md` → architecture layers, coding standards, naming |
207
+ | 4 | SAFETY | `.agent/rules/data-protection.md` → sensitive file patterns |
208
+ | 5 | DOMAIN | `business-dictionary.md` → canonical + banned terms |
209
+ | 6 | DOMAIN | `core-entities.md` → entity catalog |
210
+ | 6.7 | **GUARDRAILS** | `lessons_file` → mistakes tích lũy (via `/learn`) loaded như hard constraints |
211
+ | 6-B | UI COMPONENTS | `figma-components/{module}.md` → Figma name → code component + import path |
212
+ | 6-C | UI TOKENS | `figma-tokens.md` → design tokens |
213
+ | 7 | **RECAP** | `[CTX LOADED]` block — lock critical facts vào working memory |
214
+
215
+ **Anti-lost-in-middle:** critical facts (Step 3) load đầu tiên; RECAP (Step 7) restate ở cuối để fresh khi generation bắt đầu (recency effect).
216
+
217
+ ```
218
+ [CTX LOADED]
219
+ Stack : TypeScript / React 18 / PostgreSQL
220
+ Layers : Controller → Facade → Service → Repository
221
+ Services : 2 services: web-admin(react), api-backend(java-spring)
222
+ Svc Root : api-backend — conventions + trace_dir loaded from service config
223
+ Dict : loaded — 42 canonical terms, 8 banned terms
224
+ Entities : loaded — User, Order, Product
225
+ Lessons : loaded — 6 guardrails
226
+ Components : loaded — web-admin (react) — 23 components mapped
227
+ Tokens : loaded — colors: 18, spacing: 12, typography: 6
228
+ Status : FULL
229
+ ```
230
+
231
+ Status values: `FULL` · `PARTIAL — missing: {list}` · `MINIMAL` (chỉ project-context.yaml).
232
+
233
+ ### spawn-agent.md — sub-agent orchestration
234
+
235
+ Khi PRD vượt ngưỡng phức tạp, `generate-bdd`, `generate-code`, `dev-gen-test` tự chuyển từ single-session sang orchestration mode.
236
+
237
+ **Complexity thresholds:**
238
+
239
+ | Signal | Threshold | Action |
240
+ |--------|-----------|--------|
241
+ | UC count trong PRD | > 3 UC | Spawn 1 sub-agent / UC |
242
+ | PRD length | > 300 dòng | Spawn agents bất kể UC count |
243
+
244
+ **Orchestration flow:**
245
+
246
+ ```
247
+ Main session (orchestrator)
248
+ ├─ Step A: Build slim context JSON (stack + active_service + active_module + paths + arch summary + banned_terms)
249
+ ├─ Step B: Scan PRD → extract UC list [{uc_id, line_start, line_end}]
250
+ ├─ Step C: Announce plan → "Spawning N sub-agents..."
251
+ ├─ Step D: Spawn 1 sub-agent / UC (parallel)
252
+ │ mỗi agent nhận: { _agent_mode: true, uc_id, target_file, uc_section, context }
253
+ │ mỗi agent đọc CHỈ UC section của mình (không phải full PRD)
254
+ └─ Step E: Collect results → merge → { uc_id, files_created, status, errors }
255
+ ```
256
+
257
+ **Tiết kiệm context window:**
258
+
259
+ | Mode | What loads per agent |
260
+ |------|---------------------|
261
+ | Single session (≤ 3 UC) | Full context + full PRD + all UCs |
262
+ | Orchestrator | Slim context + UC heading list only |
263
+ | Each sub-agent | Slim context + **1 UC section only** |
264
+
265
+ ### report-footer.md — standard output format
266
+
267
+ Mọi command kết thúc với footer này:
268
+
269
+ ```
270
+ ---
271
+ Status : ✅ Complete
272
+ Output Artifacts:
273
+ created specs/auth/FEAT-042-login/bdd/FEAT-042-UC1-login.feature (3 scenarios)
274
+ updated .trace/auth/FEAT-042-login/FEAT-042.tsv
275
+ Next : /review-context specs/auth/FEAT-042-login/bdd/FEAT-042-UC1-login.feature
276
+ ```
277
+
278
+ **Status badges:** `✅ Complete` · `⚠️ Warnings` · `❌ Failed`. Field **Next** luôn gợi ý command tiếp theo hợp lý — không phải tra cứu.
@@ -0,0 +1,152 @@
1
+ [📚 Docs](../README.md) › [Concepts](README.md) › Traceability
2
+
3
+ # Traceability & Living Docs
4
+
5
+ Mỗi artifact link tới mọi artifact khác qua `@trace.*` tags, và trạng thái coverage/drift được tổng hợp vào **trace TSV** rồi surface trong **Living Docs**. Đây là cách framework đảm bảo *mọi dòng code trace về một scenario*, và phân biệt hai tín hiệu test độc lập: **`dev_selftest`** (dev tự kiểm) vs **`qc_status`** (QC chính thức).
6
+
7
+ ## Mục lục
8
+
9
+ - [Artifact chain & @trace tags](#artifact-chain--trace-tags)
10
+ - [Trace TSV — coverage & drift](#trace-tsv--coverage--drift)
11
+ - [Hai tín hiệu test: dev_selftest vs qc_status](#hai-tín-hiệu-test-dev_selftest-vs-qc_status)
12
+ - [Living Docs — canonical trong spec-module + panel mirror](#living-docs--canonical-trong-spec-module--panel-mirror)
13
+ - [/validate-traces](#validate-traces)
14
+
15
+ > Schema TSV đầy đủ (mọi cột) và full danh sách trace tag: xem [../05-reference/trace-schema.md](../05-reference/trace-schema.md). Trang này tập trung vào **khái niệm** và cách hai tín hiệu hoạt động.
16
+
17
+ ---
18
+
19
+ ## Artifact chain & @trace tags
20
+
21
+ Mỗi artifact liên kết về artifact trước nó bằng metadata (PRD: bảng **Metadata**; BDD / tech-doc / code / test: `@trace.*` tags):
22
+
23
+ ```
24
+ product-definition.md
25
+ └─► PRD.md (Domain, Status, Service/Module — đều trong bảng Metadata)
26
+ └─► specs/{domain}/{prd-slug}/bdd/{web|app|system}/{UC-ID}.feature (@trace.prd_version, @trace.module)
27
+ └─► specs/{domain}/{prd-slug}/tech-docs/{TICKET-ID}-tech-design.md (@trace.bdd_version)
28
+ └─► src/ code — service submodule (@trace.implements)
29
+ └─► src/test/ (@trace.verifies, @trace.service)
30
+ ════► {spec_source}/.trace/{domain}/{prd-slug}/{UC-ID}-{platform}.tsv — TSV authoritative ở SPEC repo (coverage/drift)
31
+ ```
32
+
33
+ **Các trace field quan trọng:**
34
+
35
+ | Field | Vị trí | Ý nghĩa |
36
+ |-------|--------|---------|
37
+ | `Domain` | bảng Metadata PRD | Domain của feature (auth, payment, …) — route vào đúng service submodule |
38
+ | `Status` | bảng Metadata PRD | `draft` / `approved` — dev team chỉ code khi `approved` |
39
+ | `@trace.status` | BDD `.feature` header | `draft` / `approved` — người đặt `approved` sau khi review-context BDD sạch; mirror vào `uc_status` |
40
+ | `uc_status` | trace TSV (mirror) | gương của BDD `@trace.status` — `/validate-traces` đồng bộ → dashboard `approved_ucs` |
41
+ | `@trace.service` / `@trace.module` | BDD / Tech Doc header | Service + module sẽ implement |
42
+ | `@trace.prd_version` / `@trace.bdd_version` | BDD / code / test | Version của spec mà artifact được sinh từ — base cho drift detection |
43
+ | `@trace.implements` | Code comment | Scenario mà code này implement: `={UC-ID}-SC{N}` |
44
+ | `@trace.verifies` | Test / QC test | Scenario mà test này verify: `={UC-ID}` hoặc `={UC-ID}-SC{N}` |
45
+ | `@trace.api_source: existing` | BDD header | Brownfield — API đã tồn tại, contract lấy từ PRD |
46
+
47
+ Ví dụ tags trong `.feature`, code, và test:
48
+
49
+ ```gherkin
50
+ # @trace.id: FEAT-001-UC1
51
+ # @trace.service: web-admin
52
+ # @trace.module: react
53
+ # @trace.prd_version: 1.2
54
+ # @trace.bdd_version: 3
55
+ ```
56
+ ```java
57
+ // @trace.implements=FEAT-001-UC1-SC2 // @trace.verifies=FEAT-001-UC1
58
+ // @trace.prd_version=1.2 // @trace.service=api-backend
59
+ // @trace.bdd_version=3 // @trace.test_type=integration
60
+ // @trace.tech_doc_revision=2
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Trace TSV — coverage & drift
66
+
67
+ `.trace/{domain}/{prd-slug}/{UC-ID}-{platform}.tsv` là nguồn sự thật per-scenario về trạng thái implement/test. Được **ghi** bởi `/generate-bdd`, `/generate-code`, `/dev-gen-test`, `/qc-run-test`, và **update** bởi `/validate-traces`. Khi `spec_source` set, file `.trace/**/*.tsv` authoritative **được commit ở một chỗ** trong spec repo (`{spec_source}/.trace/`) — một nơi cho PM quản lý; mỗi scenario mang `@trace.service`. (Không có `spec_source` → `.trace` per-service.)
68
+
69
+ Status coverage per scenario:
70
+
71
+ | Status | Meaning |
72
+ |--------|---------|
73
+ | ✅ OK | Code version khớp spec version |
74
+ | ⚠️ DRIFT | Code gen từ PRD/BDD cũ hơn — re-generate |
75
+ | 🔴 GAP | Scenario có trong spec nhưng không tìm thấy code implement |
76
+ | — UNTRACKED | Scenario ghi nhận nhưng chưa code-gen |
77
+
78
+ ---
79
+
80
+ ## Hai tín hiệu test: dev_selftest vs qc_status
81
+
82
+ Trace TSV mang **hai cột độc lập**, cả hai **orthogonal** với cột `status` (coverage) ở trên:
83
+
84
+ | Cột | Set bởi | Giá trị | Ý nghĩa |
85
+ |-----|---------|---------|---------|
86
+ | `dev_selftest` (+ `dev_selftest_at`) | `/dev-run-test` | `pass` / `fail` / `not_run` | **Dev self-check** — dev tự chạy bộ self-check test của mình trên scenario đó. **KHÔNG** phải coverage QC chính thức. |
87
+ | `qc_status` (+ `qc_run_at`) | `/qc-run-test` | `pass` / `fail` / `skip` / `not_run` | **QC chính thức** — kết quả native QC pipeline (do QC chạy, không phải dev), keyed theo `@trace.verifies={UC-ID}-SC{N}`. |
88
+
89
+ - **`dev_selftest`** là tín hiệu để QC **thấy** rằng developer đã smoke/self-check qua scenario đó. `dev_selftest: pass` chỉ nghĩa "dev đã tự kiểm" — không phải tuyên bố coverage.
90
+ - **`qc_status`** là coverage QC chính thức từ pipeline `/qc-analyze → … → /qc-run-test → /qc-report` (xem [pipeline.md](pipeline.md#qc-automation-pipeline-phase-5b)). `/qc-run-test` dùng stack module `qc-playwright`, độc lập với dev implementation module.
91
+ - Hai tín hiệu **sit side by side** trong Living Docs để dễ phân biệt hai luồng. Tester vẫn nên verify độc lập theo BDD + PRD ở phần chưa được automation cover.
92
+
93
+ > Phân biệt rõ: `/dev-*` (dev self-check, `dev_selftest`) ≠ `/qc-*` (official QC suite, `qc_status`). Đừng coi output của `/dev-*` là coverage chính thức.
94
+
95
+ ---
96
+
97
+ ## Living Docs — canonical trong spec-module + panel mirror
98
+
99
+ Living Docs (VS Code panel) đọc trace TSV và hiển thị traceability health toàn dự án:
100
+
101
+ ```
102
+ ┌──────────────────────────────────────────────────────────────────┐
103
+ │ PRDs Use Cases Scenarios Code Cov. Test Cov. Drift Gap │
104
+ │ 19 86 1077 93% 89% 212 93 │
105
+ └──────────────────────────────────────────────────────────────────┘
106
+ ```
107
+
108
+ - Drill down: PRD → UC → per-scenario table (Spec ver, Gen ver, Code, Tests, **Dev Self-Check**, **QC Status**, **Waiting on**, Status)
109
+ - **Waiting on** (cột `qc_owner` + `qc_blocked_by`): cho PO/PM thấy case chưa pass đang **chờ dev** (product-gap → `BUG-{id}`) hay **chờ PO** confirm/clarify (spec gap → `GAP-{id}`). Aggregates `waiting_dev` / `waiting_po` ở header dashboard.
110
+ - Status badges: ✅ OK · ⚠️ DRIFT · 🔴 GAP · — UNTRACKED · filter theo domain/PRD status/doc status · search theo UC/SC ID.
111
+ - Số **UC approved** (`approved_ucs`) trên dashboard = số UC có BDD `@trace.status: approved`, đồng bộ từ `.feature` qua `/validate-traces` (xem `uc_status` ở bảng trace field trên).
112
+
113
+ **Ba nơi chứa trace data — phân biệt authoritative vs mirror:**
114
+
115
+ | Vị trí | Vai trò | Commit? |
116
+ |--------|---------|---------|
117
+ | `{spec_source}/.trace/*.tsv` | **Authoritative** — nguồn sự thật, một chỗ cho cả team/PM (mỗi row mang `@trace.service`) | ✅ Committed trong spec repo |
118
+ | `{spec_source}/.living-docs/trace-report.json` | **Report** — dashboard tổng hợp, regenerate bởi `/sync` hoặc `/validate-traces` | ❌ Gitignored |
119
+ | `./.trace` của workspace hiện tại | **Panel mirror** — giữ Living Docs panel không trống khi mở Claude Code/VS Code ở một repo không phải spec repo | ❌ Gitignored |
120
+
121
+ **Vì sao authoritative + report nằm ở spec module?** Spec module được mount vào mọi umbrella/service workspace, nên là nơi chung luôn resolve được cho cross-team dashboard, và là **một chỗ duy nhất** để PM/PO quản lý trạng thái. Code-side commands (`/generate-code`, `/dev-run-test`, `/qc-run-test`) chạy trong service nhưng ghi trace cross-repo vào đây (giống `feedback/`). Panel mirror `./.trace` chỉ để panel không trống khi mở một repo lẻ.
122
+
123
+ Thêm vào `.gitignore` (report + mirror là read-only generated, không commit; `.trace/*.tsv` thì commit trong spec repo):
124
+ ```
125
+ # spec module
126
+ .living-docs/
127
+ # workspace không phải spec repo (panel mirror)
128
+ .trace/
129
+ ```
130
+
131
+ > **Prerequisite cho data chính xác:** umbrella cần `setup.spec_source` trỏ đúng spec submodule → framework ghi mọi trace TSV vào `{spec_source}/.trace`. (Chế độ không có `spec_source` mới cần `paths.trace_dir` per-service.)
132
+
133
+ ---
134
+
135
+ ## /validate-traces
136
+
137
+ Chạy `/validate-traces {domain}` bất cứ lúc nào (đặc biệt **sau mỗi codegen session trong umbrella mode**) để:
138
+
139
+ ```
140
+ /validate-traces {domain}
141
+ → Reads .trace/*.tsv authoritative (committed) từ MỘT chỗ: {spec_source}/.trace/
142
+ (mỗi scenario mang @trace.service — không cần quét/merge từng service)
143
+ → Writes trace-report.json → {spec_source}/.living-docs/ (generated, gitignored)
144
+ → Writes panel mirror → ./.trace của workspace hiện tại (non-empty khi mở repo lẻ)
145
+ → Living Docs panel cập nhật ngay
146
+ ```
147
+
148
+ Báo cáo: scenario nào chưa có code (GAP) · code nào gen từ PRD/BDD cũ (DRIFT) · broken links / orphan BDD (không có PRD) / dead code traces · coverage % per domain.
149
+
150
+ **Khi nào chạy:** sau refactor đổi tên file/function · sau khi PO cập nhật PRD (version mới) · trước PR lớn · khi CI báo trace validation fail · sau mỗi codegen session (umbrella).
151
+
152
+ > **Nguyên tắc:** không merge code khi traces broken — fix traces trước. `/sync` cũng regenerate Living Docs như một bước phụ; `/validate-traces` là lệnh chuyên trách kiểm tra trace chain.
@@ -0,0 +1,33 @@
1
+ [📚 Docs](../README.md) › Operations
2
+
3
+ # 04 · Operations
4
+
5
+ > Vận hành hằng ngày với framework: đồng bộ nội dung & nâng cấp framework, quy trình xử lý bug, và publish package lên npm.
6
+
7
+ Mục này dành cho cả team (PO · Dev · QC/Tester) và người maintain framework.
8
+
9
+ ---
10
+
11
+ ## Trong mục này
12
+
13
+ | Trang | Nội dung |
14
+ |-------|----------|
15
+ | [Sync & Update](sync-and-update.md) | `/sync` vs `/update-framework`, umbrella mode, đồng bộ Living Docs, workflow hằng ngày theo role |
16
+ | [Bug Flow](bug-flow.md) | Phân loại bug theo spec layer (Code/BDD/PRD/Design/Env), 6 case, format thông báo, checklist đóng bug |
17
+ | [Publishing](publishing.md) | Build + publish `@educa-corp/sdd-framework` lên npm, versioning, transfer ownership |
18
+
19
+ ---
20
+
21
+ ## Hai loại "update" — đừng nhầm
22
+
23
+ | | `/sync` | `/update-framework` |
24
+ |---|---|---|
25
+ | Update cái gì | Nội dung dự án: code/specs trong submodule + Living Docs | Bản thân framework: commands, steps, modules |
26
+ | Nguồn | Git remote của submodule | npm registry |
27
+ | Tần suất | Mỗi sáng / trước khi work | Khi có version framework mới (hiếm) |
28
+
29
+ Chi tiết: [Sync & Update](sync-and-update.md).
30
+
31
+ ---
32
+
33
+ *Xem thêm:* [02 · Guides](../02-guides/) (theo vai trò) · [03 · Concepts](../03-concepts/) (kiến trúc) · [05 · Reference](../05-reference/) (tra cứu lệnh).