@anhth2/spec-driven-dev-plugin 0.9.2 → 0.11.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 (223) hide show
  1. package/commands/debug.md +50 -20
  2. package/commands/define-product.md +49 -19
  3. package/commands/{generate-tests.md → dev-gen-test.md} +85 -23
  4. package/commands/{generate-tests.tmpl → dev-gen-test.tmpl} +18 -4
  5. package/{core/commands/run-tests.md → commands/dev-run-test.md} +102 -21
  6. package/commands/{run-tests.tmpl → dev-run-test.tmpl} +35 -2
  7. package/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
  8. package/commands/{smoke-test.tmpl → dev-smoke-test.tmpl} +5 -5
  9. package/commands/fix-bug.md +50 -20
  10. package/commands/generate-bdd.md +78 -21
  11. package/commands/generate-bdd.tmpl +11 -2
  12. package/commands/generate-code.md +123 -23
  13. package/commands/generate-code.tmpl +56 -4
  14. package/commands/generate-design-spec.md +142 -47
  15. package/commands/generate-design-spec.tmpl +93 -28
  16. package/commands/generate-prd.md +49 -19
  17. package/commands/generate-spec-manifest.md +49 -19
  18. package/commands/generate-tech-docs.md +50 -20
  19. package/commands/generate-tech-docs.tmpl +1 -1
  20. package/commands/learn.md +50 -20
  21. package/commands/propose-scenario.md +50 -20
  22. package/commands/propose-scenario.tmpl +1 -1
  23. package/commands/qc-analyze.md +514 -0
  24. package/commands/qc-analyze.tmpl +71 -0
  25. package/commands/qc-design-test.md +510 -0
  26. package/commands/qc-design-test.tmpl +67 -0
  27. package/commands/qc-plan.md +492 -0
  28. package/commands/qc-plan.tmpl +49 -0
  29. package/commands/qc-report.md +491 -0
  30. package/commands/qc-report.tmpl +48 -0
  31. package/commands/qc-review.md +496 -0
  32. package/commands/qc-review.tmpl +53 -0
  33. package/commands/qc-run-test.md +538 -0
  34. package/commands/qc-run-test.tmpl +77 -0
  35. package/commands/refine-prd.md +203 -24
  36. package/commands/refine-prd.tmpl +16 -5
  37. package/commands/report-bug.md +49 -19
  38. package/commands/review-code.md +51 -21
  39. package/commands/review-code.tmpl +1 -1
  40. package/commands/review-context.md +198 -20
  41. package/commands/review-context.tmpl +11 -1
  42. package/commands/review-tech-docs.md +49 -19
  43. package/commands/setup-ai-first.md +14 -7
  44. package/commands/sync.md +30 -20
  45. package/commands/sync.tmpl +16 -13
  46. package/commands/update-framework.md +14 -7
  47. package/commands/validate-traces.md +106 -45
  48. package/commands/validate-traces.tmpl +57 -26
  49. package/core/FRAMEWORK_VERSION +1 -1
  50. package/core/commands/debug.md +50 -20
  51. package/core/commands/define-product.md +49 -19
  52. package/core/commands/{generate-tests.md → dev-gen-test.md} +85 -23
  53. package/{commands/run-tests.md → core/commands/dev-run-test.md} +102 -21
  54. package/core/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
  55. package/core/commands/fix-bug.md +50 -20
  56. package/core/commands/generate-bdd.md +78 -21
  57. package/core/commands/generate-code.md +123 -23
  58. package/core/commands/generate-design-spec.md +142 -47
  59. package/core/commands/generate-prd.md +49 -19
  60. package/core/commands/generate-spec-manifest.md +49 -19
  61. package/core/commands/generate-tech-docs.md +50 -20
  62. package/core/commands/learn.md +50 -20
  63. package/core/commands/propose-scenario.md +50 -20
  64. package/core/commands/qc-analyze.md +514 -0
  65. package/core/commands/qc-design-test.md +510 -0
  66. package/core/commands/qc-plan.md +492 -0
  67. package/core/commands/qc-report.md +491 -0
  68. package/core/commands/qc-review.md +496 -0
  69. package/core/commands/qc-run-test.md +538 -0
  70. package/core/commands/refine-prd.md +203 -24
  71. package/core/commands/report-bug.md +49 -19
  72. package/core/commands/review-code.md +51 -21
  73. package/core/commands/review-context.md +198 -20
  74. package/core/commands/review-tech-docs.md +49 -19
  75. package/core/commands/setup-ai-first.md +14 -7
  76. package/core/commands/sync.md +30 -20
  77. package/core/commands/update-framework.md +14 -7
  78. package/core/commands/validate-traces.md +106 -45
  79. package/core/modules/qc-playwright/stack-profile.yaml +65 -0
  80. package/core/skills/code/SKILL.md +63 -26
  81. package/core/skills/debug/SKILL.md +78 -34
  82. package/core/skills/design-spec/SKILL.md +49 -19
  83. package/core/skills/discovery/SKILL.md +49 -19
  84. package/core/skills/prd/SKILL.md +28 -14
  85. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  86. package/core/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  87. package/core/skills/qc/qa-analyst/business-rules.md +55 -0
  88. package/core/skills/qc/qa-analyst/data-flow.md +60 -0
  89. package/core/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  90. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  91. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  92. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  93. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  94. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  95. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  96. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  97. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  98. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  99. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  100. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  101. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  102. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  103. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  104. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  105. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  106. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  107. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  108. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  109. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  110. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  111. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  112. package/core/skills/qc/qa-runner/e2e.md +49 -0
  113. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  114. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  115. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  116. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  117. package/core/skills/qc/qa-runner/integration.md +47 -0
  118. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  119. package/core/skills/qc/qa-runner/report/report.md +37 -0
  120. package/core/skills/setup-ai-first/SKILL.md +14 -7
  121. package/core/skills/spec/SKILL.md +28 -14
  122. package/core/skills/test/SKILL.md +121 -54
  123. package/core/steps/capture-lesson.md +1 -1
  124. package/core/steps/context-loader.md +35 -12
  125. package/core/steps/report-footer.md +14 -7
  126. package/core/steps/review-fanout.md +138 -0
  127. package/core/steps/spawn-agent.md +1 -1
  128. package/core/steps/trace-mirror.md +18 -0
  129. package/core/templates/design-spec.template.md +16 -8
  130. package/core/templates/project-context.yaml +8 -0
  131. package/docs/01-getting-started/README.md +19 -0
  132. package/docs/01-getting-started/core-concepts.md +102 -0
  133. package/docs/01-getting-started/installation.md +154 -0
  134. package/docs/01-getting-started/quickstart.md +85 -0
  135. package/docs/02-guides/README.md +27 -0
  136. package/docs/02-guides/developer/README.md +46 -0
  137. package/docs/02-guides/developer/bdd-and-trace.md +123 -0
  138. package/docs/02-guides/developer/commands.md +76 -0
  139. package/docs/02-guides/developer/pr-checklist.md +15 -0
  140. package/docs/02-guides/developer/scenarios.md +448 -0
  141. package/docs/02-guides/developer/workflow.md +59 -0
  142. package/docs/02-guides/product-owner/README.md +77 -0
  143. package/docs/02-guides/product-owner/commands.md +30 -0
  144. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  145. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  146. package/docs/02-guides/product-owner/scenarios.md +357 -0
  147. package/docs/02-guides/qc-automation.md +92 -0
  148. package/docs/02-guides/tester/README.md +72 -0
  149. package/docs/02-guides/tester/bug-reporting.md +117 -0
  150. package/docs/02-guides/tester/reading-specs.md +79 -0
  151. package/docs/02-guides/tester/scenarios.md +186 -0
  152. package/docs/02-guides/tester/spec-manifest.md +124 -0
  153. package/docs/02-guides/tester/test-checklist.md +31 -0
  154. package/docs/02-guides/tester/workflow.md +79 -0
  155. package/docs/03-concepts/README.md +19 -0
  156. package/docs/03-concepts/architecture.md +243 -0
  157. package/docs/03-concepts/pipeline.md +249 -0
  158. package/docs/03-concepts/traceability.md +148 -0
  159. package/docs/04-operations/README.md +33 -0
  160. package/docs/04-operations/bug-flow.md +321 -0
  161. package/docs/04-operations/publishing.md +137 -0
  162. package/docs/04-operations/sync-and-update.md +328 -0
  163. package/docs/05-reference/README.md +29 -0
  164. package/docs/05-reference/commands.md +229 -0
  165. package/docs/05-reference/modules.md +110 -0
  166. package/docs/05-reference/trace-schema.md +146 -0
  167. package/docs/README.md +51 -0
  168. package/modules/qc-playwright/stack-profile.yaml +65 -0
  169. package/package.json +2 -2
  170. package/skills/code/SKILL.md +63 -26
  171. package/skills/debug/SKILL.md +78 -34
  172. package/skills/debug/SKILL.tmpl +1 -1
  173. package/skills/design-spec/SKILL.md +49 -19
  174. package/skills/discovery/SKILL.md +49 -19
  175. package/skills/prd/SKILL.md +28 -14
  176. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  177. package/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  178. package/skills/qc/qa-analyst/business-rules.md +55 -0
  179. package/skills/qc/qa-analyst/data-flow.md +60 -0
  180. package/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  181. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  182. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  183. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  184. package/skills/qc/qa-designer/functional/api.md +45 -0
  185. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  186. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  187. package/skills/qc/qa-designer/integration/api.md +42 -0
  188. package/skills/qc/qa-designer/integration/db.md +39 -0
  189. package/skills/qc/qa-designer/integration/gui.md +40 -0
  190. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  191. package/skills/qc/qa-designer/non-functional.md +40 -0
  192. package/skills/qc/qa-planner/test-plan.md +120 -0
  193. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  194. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  195. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  196. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  197. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  198. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  199. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  200. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  201. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  202. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  203. package/skills/qc/qa-runner/e2e.md +49 -0
  204. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  205. package/skills/qc/qa-runner/functional/api.md +35 -0
  206. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  207. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  208. package/skills/qc/qa-runner/integration.md +47 -0
  209. package/skills/qc/qa-runner/non-functional.md +49 -0
  210. package/skills/qc/qa-runner/report/report.md +37 -0
  211. package/skills/setup-ai-first/SKILL.md +14 -7
  212. package/skills/spec/SKILL.md +28 -14
  213. package/skills/test/SKILL.md +121 -54
  214. package/skills/test/SKILL.tmpl +9 -9
  215. package/steps/capture-lesson.md +1 -1
  216. package/steps/context-loader.md +35 -12
  217. package/steps/report-footer.md +14 -7
  218. package/steps/review-fanout.md +138 -0
  219. package/steps/spawn-agent.md +1 -1
  220. package/steps/trace-mirror.md +18 -0
  221. package/templates/design-spec.template.md +16 -8
  222. package/templates/project-context.yaml +8 -0
  223. package/ARCHITECTURE.md +0 -247
@@ -161,7 +161,7 @@ If `services` section is present:
161
161
 
162
162
  **2. Route to service** — if active domain matches a key in `services`:
163
163
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
164
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
164
+ - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
165
165
  - Store `active_service` = `services.{domain}.path`
166
166
  - Store `active_service_module` = `services.{domain}.module`
167
167
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -173,7 +173,7 @@ If `services` section is present:
173
173
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
174
174
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
175
175
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
176
- - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
176
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
177
177
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
178
178
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
179
179
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -204,7 +204,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
204
204
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
205
205
 
206
206
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
207
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
207
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
208
208
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
209
209
 
210
210
  **4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
@@ -219,19 +219,41 @@ If the file does not exist → skip silently.
219
219
 
220
220
  ---
221
221
 
222
- ## Step 3 — [CRITICAL] Load CLAUDE.md
222
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
223
223
 
224
224
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
225
225
 
226
- Read `CLAUDE.md`. Extract and store:
226
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
227
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
228
+ root, but the implementation code lives in a service submodule with its OWN stack,
229
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
230
+
231
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
232
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
233
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
234
+ single-service mode) the project's only architecture + coding standards.
235
+
236
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
237
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
238
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
239
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
240
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
241
+ coding standards, and error handling. Layer-1 values that the service does not redefine
242
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
243
+
244
+ From the **merged** result, extract and store:
227
245
 
228
246
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
229
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
230
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
231
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
232
- - **§7 Git Conventions** → branch naming pattern, commit message format
247
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
248
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
249
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
250
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
233
251
 
234
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
252
+ **Resolution rules:**
253
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
254
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
255
+ - If `service_root` is set but `{service_root}/CLAUDE.md` is **missing** → fall back to root CLAUDE.md and flag ⚠️ in the Step 7 recap (the service has no architecture/coding-standards definition — code generation will use umbrella defaults, which may be the wrong stack).
256
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
235
257
 
236
258
  ---
237
259
 
@@ -297,7 +319,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
297
319
 
298
320
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
299
321
 
300
- These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (generate-tests, debug, fix-bug, smoke-test).
322
+ These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (dev-gen-test, debug, fix-bug, dev-smoke-test).
301
323
 
302
324
  ---
303
325
 
@@ -331,7 +353,8 @@ Output exactly this block:
331
353
  [CTX LOADED]
332
354
  Stack : {language} / {framework} / {database}
333
355
  Platform : {active_module} ({platform_type})
334
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
356
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
357
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
335
358
  Ticket : {ticket_prefix}-
336
359
  Dict : {loaded — N canonical terms, M banned terms | missing}
337
360
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -811,7 +834,7 @@ After generating all `.feature` files, create or update `{paths.trace_dir}/{UC-I
811
834
 
812
835
  **TSV columns (tab-separated, one header row + one data row per scenario):**
813
836
  ```
814
- sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tprd_version\tbdd_version\ttech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
837
+ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tdev_selftest\tdev_selftest_at\tqc_status\tqc_run_at\tprd_version\tbdd_version\ttech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
815
838
  ```
816
839
 
817
840
  **Rules:**
@@ -819,7 +842,7 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
819
842
  - If file exists (re-generation) → for each SC in the new `.feature`:
820
843
  - SC already in `.tsv` AND `spec_ver` is unchanged → update only: `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Leave all other columns unchanged.
821
844
  - SC already in `.tsv` AND `spec_ver` changed (scenario was modified) → update: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` AND set `status = DRIFT` immediately (so the TSV reflects drift without waiting for `/validate-traces`). Leave `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` unchanged.
822
- - SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` all set to `—`.
845
+ - SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `tech_doc_revision` all set to `—`.
823
846
  - SC no longer in `.feature` (removed) → delete its row.
824
847
 
825
848
  **Values to write for each scenario:**
@@ -833,6 +856,10 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
833
856
  | `implemented_by` | `—` |
834
857
  | `test_count` | `—` |
835
858
  | `test_classes` | `—` |
859
+ | `dev_selftest` | `—` (no tests run yet) |
860
+ | `dev_selftest_at` | `—` |
861
+ | `qc_status` | `—` (official QC automation result — set by `/qc-run-test`) |
862
+ | `qc_run_at` | `—` |
836
863
  | `prd_version` | `@trace.prd_version` from `.feature` header |
837
864
  | `bdd_version` | `@trace.bdd_version` from `.feature` header |
838
865
  | `tech_doc_revision` | `—` |
@@ -842,6 +869,27 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
842
869
  | `status` | `UNTRACKED` |
843
870
  | `last_updated` | today `YYYY-MM-DD` |
844
871
 
872
+ ## Refresh Panel Mirror
873
+ # Refresh Living Docs panel mirror *(local, umbrella mode)*
874
+
875
+ *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
876
+ the service `.trace/` IS the panel location, so nothing to mirror.*
877
+
878
+ After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
879
+
880
+ 1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
881
+ 2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
882
+ just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
883
+ (create the dir; overwrite). Use `active_service` for `{service-name}`.
884
+
885
+ This keeps the open workspace's Living Docs panel current **between syncs** — it is a
886
+ **local convenience mirror only**. The *canonical* report in the spec module
887
+ (`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
888
+ `/sync` or `/validate-traces` (those need every service's data, so a single per-UC
889
+ command cannot produce them). For orchestrated commands, do this once in the orchestrator
890
+ after all sub-agents return — not inside each sub-agent.
891
+
892
+
845
893
  ## Output
846
894
 
847
895
  # Report Footer — Standard Command Output Format
@@ -880,15 +928,22 @@ Suggest the logical next command based on workflow phase:
880
928
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
881
929
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
882
930
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
931
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
932
+ | /qc-plan | `/qc-design-test {UC-ID}` |
933
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
934
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
935
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
936
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
937
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
883
938
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
884
939
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
885
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
886
- | /generate-tests | `/run-tests {UC-ID}` |
887
- | /run-tests (passing) | `/review-code {UC-ID}` |
888
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
889
- | /review-code | `/smoke-test {UC-ID}` or create PR |
890
- | /smoke-test | Create PR and link to ticket |
891
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
940
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
941
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
942
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
943
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
944
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
945
+ | /dev-smoke-test | Create PR and link to ticket |
946
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
892
947
  | /fix-bug | Create PR and link to ticket |
893
948
  | /debug | `/fix-bug {ticket-id}` if fix needed |
894
949
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -930,4 +985,6 @@ Next (umbrella):
930
985
  → /review-context {feature-file} to verify coverage
931
986
  → /generate-tech-docs {feature-file}
932
987
  → /generate-code {feature-file}
988
+
989
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
933
990
  ```
@@ -458,7 +458,7 @@ After generating all `.feature` files, create or update `{paths.trace_dir}/{UC-I
458
458
 
459
459
  **TSV columns (tab-separated, one header row + one data row per scenario):**
460
460
  ```
461
- sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tprd_version\tbdd_version\ttech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
461
+ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tdev_selftest\tdev_selftest_at\tqc_status\tqc_run_at\tprd_version\tbdd_version\ttech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
462
462
  ```
463
463
 
464
464
  **Rules:**
@@ -466,7 +466,7 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
466
466
  - If file exists (re-generation) → for each SC in the new `.feature`:
467
467
  - SC already in `.tsv` AND `spec_ver` is unchanged → update only: `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Leave all other columns unchanged.
468
468
  - SC already in `.tsv` AND `spec_ver` changed (scenario was modified) → update: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` AND set `status = DRIFT` immediately (so the TSV reflects drift without waiting for `/validate-traces`). Leave `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` unchanged.
469
- - SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` all set to `—`.
469
+ - SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `tech_doc_revision` all set to `—`.
470
470
  - SC no longer in `.feature` (removed) → delete its row.
471
471
 
472
472
  **Values to write for each scenario:**
@@ -480,6 +480,10 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
480
480
  | `implemented_by` | `—` |
481
481
  | `test_count` | `—` |
482
482
  | `test_classes` | `—` |
483
+ | `dev_selftest` | `—` (no tests run yet) |
484
+ | `dev_selftest_at` | `—` |
485
+ | `qc_status` | `—` (official QC automation result — set by `/qc-run-test`) |
486
+ | `qc_run_at` | `—` |
483
487
  | `prd_version` | `@trace.prd_version` from `.feature` header |
484
488
  | `bdd_version` | `@trace.bdd_version` from `.feature` header |
485
489
  | `tech_doc_revision` | `—` |
@@ -489,6 +493,9 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
489
493
  | `status` | `UNTRACKED` |
490
494
  | `last_updated` | today `YYYY-MM-DD` |
491
495
 
496
+ ## Refresh Panel Mirror
497
+ {{include:steps/trace-mirror.md}}
498
+
492
499
  ## Output
493
500
 
494
501
  {{include:steps/report-footer.md}}
@@ -517,4 +524,6 @@ Next (umbrella):
517
524
  → /review-context {feature-file} to verify coverage
518
525
  → /generate-tech-docs {feature-file}
519
526
  → /generate-code {feature-file}
527
+
528
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
520
529
  ```
@@ -163,7 +163,7 @@ If `services` section is present:
163
163
 
164
164
  **2. Route to service** — if active domain matches a key in `services`:
165
165
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
166
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
166
+ - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
167
167
  - Store `active_service` = `services.{domain}.path`
168
168
  - Store `active_service_module` = `services.{domain}.module`
169
169
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -175,7 +175,7 @@ If `services` section is present:
175
175
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
176
176
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
177
177
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
178
- - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
178
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
179
179
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
180
180
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
181
181
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -206,7 +206,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
206
206
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
207
207
 
208
208
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
209
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
209
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
210
210
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
211
211
 
212
212
  **4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
@@ -221,19 +221,41 @@ If the file does not exist → skip silently.
221
221
 
222
222
  ---
223
223
 
224
- ## Step 3 — [CRITICAL] Load CLAUDE.md
224
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
225
225
 
226
226
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
227
227
 
228
- Read `CLAUDE.md`. Extract and store:
228
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
229
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
230
+ root, but the implementation code lives in a service submodule with its OWN stack,
231
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
232
+
233
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
234
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
235
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
236
+ single-service mode) the project's only architecture + coding standards.
237
+
238
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
239
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
240
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
241
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
242
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
243
+ coding standards, and error handling. Layer-1 values that the service does not redefine
244
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
245
+
246
+ From the **merged** result, extract and store:
229
247
 
230
248
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
231
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
232
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
233
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
234
- - **§7 Git Conventions** → branch naming pattern, commit message format
249
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
250
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
251
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
252
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
235
253
 
236
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
254
+ **Resolution rules:**
255
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
256
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
257
+ - If `service_root` is set but `{service_root}/CLAUDE.md` is **missing** → fall back to root CLAUDE.md and flag ⚠️ in the Step 7 recap (the service has no architecture/coding-standards definition — code generation will use umbrella defaults, which may be the wrong stack).
258
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
237
259
 
238
260
  ---
239
261
 
@@ -299,7 +321,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
299
321
 
300
322
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
301
323
 
302
- These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (generate-tests, debug, fix-bug, smoke-test).
324
+ These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (dev-gen-test, debug, fix-bug, dev-smoke-test).
303
325
 
304
326
  ---
305
327
 
@@ -333,7 +355,8 @@ Output exactly this block:
333
355
  [CTX LOADED]
334
356
  Stack : {language} / {framework} / {database}
335
357
  Platform : {active_module} ({platform_type})
336
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
358
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
359
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
337
360
  Ticket : {ticket_prefix}-
338
361
  Dict : {loaded — N canonical terms, M banned terms | missing}
339
362
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -380,6 +403,7 @@ Read:
380
403
  1. The scoped `.feature` file only
381
404
  2. Tech-doc at `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md` (if exists)
382
405
  3. CLAUDE.md §architecture + §coding_standards
406
+ 4. **(FE/App only)** Design Spec at `{paths.design_spec_dir}/{domain}/{TICKET-ID}-design-spec-*{slug}.md` (if exists) — source of screens, component inventory, and the per-screen Figma frame links.
383
407
 
384
408
  ---
385
409
 
@@ -403,6 +427,51 @@ Load System BDD for this UC: find `{specs_dir}/{domain}/system/{TICKET-ID}*.feat
403
427
  Extract all `Then` clauses → collect implied response shapes and error states.
404
428
  If System BDD not found → warn: "System BDD not found — mock layer will use placeholder fixtures." Continue.
405
429
 
430
+ **Then run the Figma Dev Mode MCP Check below** before generating any UI — the Design
431
+ Spec's frame links are the visual contract, and the local MCP reads them with far more
432
+ fidelity than a plain web link.
433
+
434
+ ---
435
+
436
+ ## Figma Dev Mode MCP Check *(FE/App UI generation only)*
437
+
438
+ *Run this only when `platform` is `web`/`app` AND generating UI (`--phase=ui`, or default
439
+ mode for an FE/App feature). Skip entirely for BE / `system` platform.*
440
+
441
+ The PO authored the Design Spec from **Figma web links** (read-only, limited). For
442
+ codegen, the **local Figma Dev Mode MCP server** (built into the Figma **desktop app**)
443
+ gives far more: exact layout, design **variables/tokens**, **Code Connect** component
444
+ mappings, selection context, and code snippets — things a web URL alone cannot return.
445
+
446
+ **Step 1 — Detect the local MCP.** Check whether a Figma Dev Mode MCP server is connected
447
+ (a `get_design_context` / `get_code` style Figma tool is available via MCP).
448
+
449
+ **Step 2 — If NOT connected → suggest the dev enable it, then wait:**
450
+
451
+ ```
452
+ 🎨 Figma Dev Mode MCP not detected.
453
+ For accurate FE code (real tokens, components, Code Connect), use the LOCAL server:
454
+
455
+ 1. Open the Figma DESKTOP app (not the browser)
456
+ 2. Open the file/frame for this feature
457
+ 3. Enable the Dev Mode MCP server:
458
+ Figma menu → Preferences → "Enable Dev Mode MCP Server"
459
+ (requires Dev or Full seat; server runs at http://127.0.0.1:3845)
460
+ 4. Make sure this MCP server is added in your Claude Code MCP config
461
+ 5. Select the frame for the screen you're implementing, then continue
462
+
463
+ Type C to continue once enabled, or S to skip (fall back to web links + text spec).
464
+ ```
465
+
466
+ - `C` → re-detect; if now connected → proceed using the local MCP.
467
+ - `S` → proceed in **fallback mode**: use the Design Spec's web frame links + textual spec
468
+ only; add a ⚠️ note in the final report that UI was generated without local Figma fidelity.
469
+
470
+ **Step 3 — When the local MCP IS connected:** for each screen being implemented, pull the
471
+ selected frame via the Figma MCP and ground the UI on the returned layout, variables, and
472
+ Code Connect mappings. Prefer Code-Connect-mapped components over inventing markup; use the
473
+ real token names, not hardcoded values.
474
+
406
475
  **If `--phase=integration`:**
407
476
  Read tech-doc `@trace.status` from `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`.
408
477
  If `draft` or `in-review` → warn:
@@ -425,7 +494,7 @@ Read `{paths.trace_dir}/{UC-ID}.tsv` if it exists. For each scenario row, note i
425
494
  | `UNTRACKED` | `implemented_by == —` | Generate — scenario has no code yet |
426
495
  | `DRIFT` | `spec_ver != gen_ver` | Regenerate — scenario updated since last codegen |
427
496
  | `OK` | implemented + tested | Skip unless explicitly re-generating |
428
- | `GAP` | implemented, no tests | Skip codegen — already coded; run `/generate-tests` instead |
497
+ | `GAP` | implemented, no tests | Skip codegen — already coded; run `/dev-gen-test` instead |
429
498
 
430
499
  Use these statuses to populate the **Scenarios** count in the CHECKPOINT plan (`{X} new, {Y} drifted, {Z} synced-skip`).
431
500
  If `.tsv` does not exist → treat all scenarios as `UNTRACKED`.
@@ -579,9 +648,30 @@ Update `{paths.trace_dir}/{UC-ID}.tsv` — for each implemented scenario, find t
579
648
  | `fe_phase` | `ui` if `--phase=ui` \| `integrated` if `--phase=integration` \| `—` if no phase flag |
580
649
  | `last_updated` | today `YYYY-MM-DD` |
581
650
 
582
- Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`) unchanged.
651
+ Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`) unchanged.
583
652
  `status` is computed by `/validate-traces` — do not set here.
584
653
 
654
+ ## Refresh Panel Mirror
655
+ # Refresh Living Docs panel mirror *(local, umbrella mode)*
656
+
657
+ *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
658
+ the service `.trace/` IS the panel location, so nothing to mirror.*
659
+
660
+ After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
661
+
662
+ 1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
663
+ 2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
664
+ just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
665
+ (create the dir; overwrite). Use `active_service` for `{service-name}`.
666
+
667
+ This keeps the open workspace's Living Docs panel current **between syncs** — it is a
668
+ **local convenience mirror only**. The *canonical* report in the spec module
669
+ (`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
670
+ `/sync` or `/validate-traces` (those need every service's data, so a single per-UC
671
+ command cannot produce them). For orchestrated commands, do this once in the orchestrator
672
+ after all sub-agents return — not inside each sub-agent.
673
+
674
+
585
675
  ## Commit
586
676
  ```bash
587
677
  git add {files}
@@ -626,15 +716,22 @@ Suggest the logical next command based on workflow phase:
626
716
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
627
717
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
628
718
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
719
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
720
+ | /qc-plan | `/qc-design-test {UC-ID}` |
721
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
722
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
723
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
724
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
725
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
629
726
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
630
727
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
631
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
632
- | /generate-tests | `/run-tests {UC-ID}` |
633
- | /run-tests (passing) | `/review-code {UC-ID}` |
634
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
635
- | /review-code | `/smoke-test {UC-ID}` or create PR |
636
- | /smoke-test | Create PR and link to ticket |
637
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
728
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
729
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
730
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
731
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
732
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
733
+ | /dev-smoke-test | Create PR and link to ticket |
734
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
638
735
  | /fix-bug | Create PR and link to ticket |
639
736
  | /debug | `/fix-bug {ticket-id}` if fix needed |
640
737
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -658,6 +755,7 @@ Files: created={N}, extended={M}, skipped={K} | Build: SUCCESS
658
755
  Branch: feature/{TICKET_ID}-{slug}
659
756
  Phase : {UI (mock layer) | Integration (real API) | Default (full)}
660
757
  fe_phase : {ui | integrated | —}
758
+ Figma : {local Dev Mode MCP (grounded) | ⚠️ web links + text spec only (no local MCP) | n/a for BE} ← FE/App UI only
661
759
 
662
760
  Next:
663
761
  --phase=ui done:
@@ -667,9 +765,11 @@ Next:
667
765
 
668
766
  --phase=integration done:
669
767
  → /review-code {UC-ID} ← code review required
670
- → /generate-tests {UC-ID} ← integration test suite
768
+ → /dev-gen-test {UC-ID} ← integration test suite
671
769
 
672
770
  Default (no phase flag):
673
771
  → /review-code {UC-ID} ← code review required before tests
674
- → /generate-tests {UC-ID}
772
+ → /dev-gen-test {UC-ID}
773
+
774
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
675
775
  ```
@@ -27,6 +27,7 @@ Read:
27
27
  1. The scoped `.feature` file only
28
28
  2. Tech-doc at `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md` (if exists)
29
29
  3. CLAUDE.md §architecture + §coding_standards
30
+ 4. **(FE/App only)** Design Spec at `{paths.design_spec_dir}/{domain}/{TICKET-ID}-design-spec-*{slug}.md` (if exists) — source of screens, component inventory, and the per-screen Figma frame links.
30
31
 
31
32
  ---
32
33
 
@@ -50,6 +51,51 @@ Load System BDD for this UC: find `{specs_dir}/{domain}/system/{TICKET-ID}*.feat
50
51
  Extract all `Then` clauses → collect implied response shapes and error states.
51
52
  If System BDD not found → warn: "System BDD not found — mock layer will use placeholder fixtures." Continue.
52
53
 
54
+ **Then run the Figma Dev Mode MCP Check below** before generating any UI — the Design
55
+ Spec's frame links are the visual contract, and the local MCP reads them with far more
56
+ fidelity than a plain web link.
57
+
58
+ ---
59
+
60
+ ## Figma Dev Mode MCP Check *(FE/App UI generation only)*
61
+
62
+ *Run this only when `platform` is `web`/`app` AND generating UI (`--phase=ui`, or default
63
+ mode for an FE/App feature). Skip entirely for BE / `system` platform.*
64
+
65
+ The PO authored the Design Spec from **Figma web links** (read-only, limited). For
66
+ codegen, the **local Figma Dev Mode MCP server** (built into the Figma **desktop app**)
67
+ gives far more: exact layout, design **variables/tokens**, **Code Connect** component
68
+ mappings, selection context, and code snippets — things a web URL alone cannot return.
69
+
70
+ **Step 1 — Detect the local MCP.** Check whether a Figma Dev Mode MCP server is connected
71
+ (a `get_design_context` / `get_code` style Figma tool is available via MCP).
72
+
73
+ **Step 2 — If NOT connected → suggest the dev enable it, then wait:**
74
+
75
+ ```
76
+ 🎨 Figma Dev Mode MCP not detected.
77
+ For accurate FE code (real tokens, components, Code Connect), use the LOCAL server:
78
+
79
+ 1. Open the Figma DESKTOP app (not the browser)
80
+ 2. Open the file/frame for this feature
81
+ 3. Enable the Dev Mode MCP server:
82
+ Figma menu → Preferences → "Enable Dev Mode MCP Server"
83
+ (requires Dev or Full seat; server runs at http://127.0.0.1:3845)
84
+ 4. Make sure this MCP server is added in your Claude Code MCP config
85
+ 5. Select the frame for the screen you're implementing, then continue
86
+
87
+ Type C to continue once enabled, or S to skip (fall back to web links + text spec).
88
+ ```
89
+
90
+ - `C` → re-detect; if now connected → proceed using the local MCP.
91
+ - `S` → proceed in **fallback mode**: use the Design Spec's web frame links + textual spec
92
+ only; add a ⚠️ note in the final report that UI was generated without local Figma fidelity.
93
+
94
+ **Step 3 — When the local MCP IS connected:** for each screen being implemented, pull the
95
+ selected frame via the Figma MCP and ground the UI on the returned layout, variables, and
96
+ Code Connect mappings. Prefer Code-Connect-mapped components over inventing markup; use the
97
+ real token names, not hardcoded values.
98
+
53
99
  **If `--phase=integration`:**
54
100
  Read tech-doc `@trace.status` from `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`.
55
101
  If `draft` or `in-review` → warn:
@@ -72,7 +118,7 @@ Read `{paths.trace_dir}/{UC-ID}.tsv` if it exists. For each scenario row, note i
72
118
  | `UNTRACKED` | `implemented_by == —` | Generate — scenario has no code yet |
73
119
  | `DRIFT` | `spec_ver != gen_ver` | Regenerate — scenario updated since last codegen |
74
120
  | `OK` | implemented + tested | Skip unless explicitly re-generating |
75
- | `GAP` | implemented, no tests | Skip codegen — already coded; run `/generate-tests` instead |
121
+ | `GAP` | implemented, no tests | Skip codegen — already coded; run `/dev-gen-test` instead |
76
122
 
77
123
  Use these statuses to populate the **Scenarios** count in the CHECKPOINT plan (`{X} new, {Y} drifted, {Z} synced-skip`).
78
124
  If `.tsv` does not exist → treat all scenarios as `UNTRACKED`.
@@ -226,9 +272,12 @@ Update `{paths.trace_dir}/{UC-ID}.tsv` — for each implemented scenario, find t
226
272
  | `fe_phase` | `ui` if `--phase=ui` \| `integrated` if `--phase=integration` \| `—` if no phase flag |
227
273
  | `last_updated` | today `YYYY-MM-DD` |
228
274
 
229
- Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`) unchanged.
275
+ Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`) unchanged.
230
276
  `status` is computed by `/validate-traces` — do not set here.
231
277
 
278
+ ## Refresh Panel Mirror
279
+ {{include:steps/trace-mirror.md}}
280
+
232
281
  ## Commit
233
282
  ```bash
234
283
  git add {files}
@@ -245,6 +294,7 @@ Files: created={N}, extended={M}, skipped={K} | Build: SUCCESS
245
294
  Branch: feature/{TICKET_ID}-{slug}
246
295
  Phase : {UI (mock layer) | Integration (real API) | Default (full)}
247
296
  fe_phase : {ui | integrated | —}
297
+ Figma : {local Dev Mode MCP (grounded) | ⚠️ web links + text spec only (no local MCP) | n/a for BE} ← FE/App UI only
248
298
 
249
299
  Next:
250
300
  --phase=ui done:
@@ -254,9 +304,11 @@ Next:
254
304
 
255
305
  --phase=integration done:
256
306
  → /review-code {UC-ID} ← code review required
257
- → /generate-tests {UC-ID} ← integration test suite
307
+ → /dev-gen-test {UC-ID} ← integration test suite
258
308
 
259
309
  Default (no phase flag):
260
310
  → /review-code {UC-ID} ← code review required before tests
261
- → /generate-tests {UC-ID}
311
+ → /dev-gen-test {UC-ID}
312
+
313
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
262
314
  ```