@anhth2/spec-driven-dev-plugin 0.9.2 → 0.10.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 (94) hide show
  1. package/ARCHITECTURE.md +20 -9
  2. package/commands/debug.md +12 -12
  3. package/commands/define-product.md +11 -11
  4. package/commands/{generate-tests.md → dev-gen-test.md} +47 -15
  5. package/commands/{generate-tests.tmpl → dev-gen-test.tmpl} +18 -4
  6. package/{core/commands/run-tests.md → commands/dev-run-test.md} +61 -13
  7. package/commands/{run-tests.tmpl → dev-run-test.tmpl} +32 -2
  8. package/{core/commands/smoke-test.md → commands/dev-smoke-test.md} +16 -16
  9. package/commands/{smoke-test.tmpl → dev-smoke-test.tmpl} +5 -5
  10. package/commands/fix-bug.md +12 -12
  11. package/commands/generate-bdd.md +38 -13
  12. package/commands/generate-bdd.tmpl +9 -2
  13. package/commands/generate-code.md +85 -15
  14. package/commands/generate-code.tmpl +56 -4
  15. package/commands/generate-design-spec.md +104 -39
  16. package/commands/generate-design-spec.tmpl +93 -28
  17. package/commands/generate-prd.md +11 -11
  18. package/commands/generate-spec-manifest.md +11 -11
  19. package/commands/generate-tech-docs.md +12 -12
  20. package/commands/generate-tech-docs.tmpl +1 -1
  21. package/commands/learn.md +12 -12
  22. package/commands/propose-scenario.md +12 -12
  23. package/commands/propose-scenario.tmpl +1 -1
  24. package/commands/refine-prd.md +165 -16
  25. package/commands/refine-prd.tmpl +16 -5
  26. package/commands/report-bug.md +11 -11
  27. package/commands/review-code.md +13 -13
  28. package/commands/review-code.tmpl +1 -1
  29. package/commands/review-context.md +160 -12
  30. package/commands/review-context.tmpl +11 -1
  31. package/commands/review-tech-docs.md +11 -11
  32. package/commands/setup-ai-first.md +7 -7
  33. package/commands/sync.md +23 -20
  34. package/commands/sync.tmpl +16 -13
  35. package/commands/update-framework.md +7 -7
  36. package/commands/validate-traces.md +56 -37
  37. package/commands/validate-traces.tmpl +45 -26
  38. package/core/FRAMEWORK_VERSION +1 -1
  39. package/core/commands/debug.md +12 -12
  40. package/core/commands/define-product.md +11 -11
  41. package/core/commands/{generate-tests.md → dev-gen-test.md} +47 -15
  42. package/{commands/run-tests.md → core/commands/dev-run-test.md} +61 -13
  43. package/{commands/smoke-test.md → core/commands/dev-smoke-test.md} +16 -16
  44. package/core/commands/fix-bug.md +12 -12
  45. package/core/commands/generate-bdd.md +38 -13
  46. package/core/commands/generate-code.md +85 -15
  47. package/core/commands/generate-design-spec.md +104 -39
  48. package/core/commands/generate-prd.md +11 -11
  49. package/core/commands/generate-spec-manifest.md +11 -11
  50. package/core/commands/generate-tech-docs.md +12 -12
  51. package/core/commands/learn.md +12 -12
  52. package/core/commands/propose-scenario.md +12 -12
  53. package/core/commands/refine-prd.md +165 -16
  54. package/core/commands/report-bug.md +11 -11
  55. package/core/commands/review-code.md +13 -13
  56. package/core/commands/review-context.md +160 -12
  57. package/core/commands/review-tech-docs.md +11 -11
  58. package/core/commands/setup-ai-first.md +7 -7
  59. package/core/commands/sync.md +23 -20
  60. package/core/commands/update-framework.md +7 -7
  61. package/core/commands/validate-traces.md +56 -37
  62. package/core/skills/code/SKILL.md +18 -18
  63. package/core/skills/debug/SKILL.md +26 -26
  64. package/core/skills/design-spec/SKILL.md +11 -11
  65. package/core/skills/discovery/SKILL.md +11 -11
  66. package/core/skills/prd/SKILL.md +14 -14
  67. package/core/skills/setup-ai-first/SKILL.md +7 -7
  68. package/core/skills/spec/SKILL.md +14 -14
  69. package/core/skills/test/SKILL.md +38 -38
  70. package/core/steps/capture-lesson.md +1 -1
  71. package/core/steps/context-loader.md +4 -4
  72. package/core/steps/report-footer.md +7 -7
  73. package/core/steps/review-fanout.md +138 -0
  74. package/core/steps/spawn-agent.md +1 -1
  75. package/core/steps/trace-mirror.md +18 -0
  76. package/core/templates/design-spec.template.md +16 -8
  77. package/package.json +1 -1
  78. package/skills/code/SKILL.md +18 -18
  79. package/skills/debug/SKILL.md +26 -26
  80. package/skills/debug/SKILL.tmpl +1 -1
  81. package/skills/design-spec/SKILL.md +11 -11
  82. package/skills/discovery/SKILL.md +11 -11
  83. package/skills/prd/SKILL.md +14 -14
  84. package/skills/setup-ai-first/SKILL.md +7 -7
  85. package/skills/spec/SKILL.md +14 -14
  86. package/skills/test/SKILL.md +38 -38
  87. package/skills/test/SKILL.tmpl +9 -9
  88. package/steps/capture-lesson.md +1 -1
  89. package/steps/context-loader.md +4 -4
  90. package/steps/report-footer.md +7 -7
  91. package/steps/review-fanout.md +138 -0
  92. package/steps/spawn-agent.md +1 -1
  93. package/steps/trace-mirror.md +18 -0
  94. package/templates/design-spec.template.md +16 -8
@@ -1,6 +1,6 @@
1
- # /smoke-test — Smoke Test Live Service or App
1
+ # /dev-smoke-test — Smoke Test Live Service or App
2
2
 
3
- Use when service/app is **already running**. Different from `/run-tests` (no live server needed).
3
+ Use when service/app is **already running**. Different from `/dev-run-test` (no live server needed).
4
4
 
5
5
  ## Gate
6
6
  # Gate — Universal Entry Procedure
@@ -165,7 +165,7 @@ If `services` section is present:
165
165
 
166
166
  **2. Route to service** — if active domain matches a key in `services`:
167
167
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
168
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
168
+ - 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.
169
169
  - Store `active_service` = `services.{domain}.path`
170
170
  - Store `active_service_module` = `services.{domain}.module`
171
171
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -177,7 +177,7 @@ If `services` section is present:
177
177
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
178
178
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
179
179
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
180
- - 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`.
180
+ - 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.)*
181
181
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
182
182
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
183
183
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -208,7 +208,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
208
208
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
209
209
 
210
210
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
211
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
211
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
212
212
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
213
213
 
214
214
  **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).
@@ -301,7 +301,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
301
301
 
302
302
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
303
303
 
304
- 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).
304
+ 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).
305
305
 
306
306
  ---
307
307
 
@@ -367,7 +367,7 @@ Proceed to the next step of the calling command.
367
367
 
368
368
  ## Service Detection
369
369
 
370
- Read `active_module` from context. Use to select the correct smoke-test approach.
370
+ Read `active_module` from context. Use to select the correct dev-smoke-test approach.
371
371
 
372
372
  | Platform | Modules |
373
373
  |---|---|
@@ -527,7 +527,7 @@ npx react-native run-ios # build + install on iOS simulator
527
527
  # Open Xcode → select simulator → Product → Run
528
528
  ```
529
529
 
530
- ### Phase 2 — Manual smoke-test checklist
530
+ ### Phase 2 — Manual dev-smoke-test checklist
531
531
 
532
532
  For the UC under test, verify on device:
533
533
  1. Navigate to the screen for this UC
@@ -592,13 +592,13 @@ Suggest the logical next command based on workflow phase:
592
592
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
593
593
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
594
594
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
595
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
596
- | /generate-tests | `/run-tests {UC-ID}` |
597
- | /run-tests (passing) | `/review-code {UC-ID}` |
598
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
599
- | /review-code | `/smoke-test {UC-ID}` or create PR |
600
- | /smoke-test | Create PR and link to ticket |
601
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
595
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
596
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
597
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
598
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
599
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
600
+ | /dev-smoke-test | Create PR and link to ticket |
601
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
602
602
  | /fix-bug | Create PR and link to ticket |
603
603
  | /debug | `/fix-bug {ticket-id}` if fix needed |
604
604
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -617,7 +617,7 @@ Next : {suggested command with example arguments}
617
617
 
618
618
 
619
619
  ```
620
- /smoke-test Report — {UC-ID}
620
+ /dev-smoke-test Report — {UC-ID}
621
621
  Platform: {backend | web-frontend | mobile}
622
622
  | Endpoint / Flow | Status | Result |
623
623
  |-----------------------|-------------|---------|
@@ -1,6 +1,6 @@
1
- # /smoke-test — Smoke Test Live Service or App
1
+ # /dev-smoke-test — Smoke Test Live Service or App
2
2
 
3
- Use when service/app is **already running**. Different from `/run-tests` (no live server needed).
3
+ Use when service/app is **already running**. Different from `/dev-run-test` (no live server needed).
4
4
 
5
5
  ## Gate
6
6
  {{include:steps/gate.md}}
@@ -14,7 +14,7 @@ Use when service/app is **already running**. Different from `/run-tests` (no liv
14
14
 
15
15
  ## Service Detection
16
16
 
17
- Read `active_module` from context. Use to select the correct smoke-test approach.
17
+ Read `active_module` from context. Use to select the correct dev-smoke-test approach.
18
18
 
19
19
  | Platform | Modules |
20
20
  |---|---|
@@ -174,7 +174,7 @@ npx react-native run-ios # build + install on iOS simulator
174
174
  # Open Xcode → select simulator → Product → Run
175
175
  ```
176
176
 
177
- ### Phase 2 — Manual smoke-test checklist
177
+ ### Phase 2 — Manual dev-smoke-test checklist
178
178
 
179
179
  For the UC under test, verify on device:
180
180
  1. Navigate to the screen for this UC
@@ -204,7 +204,7 @@ Paste output into `/debug`.
204
204
  {{include:steps/report-footer.md}}
205
205
 
206
206
  ```
207
- /smoke-test Report — {UC-ID}
207
+ /dev-smoke-test Report — {UC-ID}
208
208
  Platform: {backend | web-frontend | mobile}
209
209
  | Endpoint / Flow | Status | Result |
210
210
  |-----------------------|-------------|---------|
@@ -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).
@@ -299,7 +299,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
299
299
 
300
300
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
301
301
 
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).
302
+ 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
303
 
304
304
  ---
305
305
 
@@ -533,7 +533,7 @@ If `lessons_path` does not exist, create it with this header first:
533
533
  | code-gen | /generate-code output |
534
534
  | bdd | /generate-bdd output |
535
535
  | tech-docs | /generate-tech-docs output |
536
- | tests | /generate-tests output |
536
+ | tests | /dev-gen-test output |
537
537
  | prd | /generate-prd, /refine-prd output |
538
538
  | general | every command |
539
539
 
@@ -598,13 +598,13 @@ Suggest the logical next command based on workflow phase:
598
598
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
599
599
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
600
600
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
601
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
602
- | /generate-tests | `/run-tests {UC-ID}` |
603
- | /run-tests (passing) | `/review-code {UC-ID}` |
604
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
605
- | /review-code | `/smoke-test {UC-ID}` or create PR |
606
- | /smoke-test | Create PR and link to ticket |
607
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
601
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
602
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
603
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
604
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
605
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
606
+ | /dev-smoke-test | Create PR and link to ticket |
607
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
608
608
  | /fix-bug | Create PR and link to ticket |
609
609
  | /debug | `/fix-bug {ticket-id}` if fix needed |
610
610
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -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).
@@ -297,7 +297,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
297
297
 
298
298
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
299
299
 
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).
300
+ 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
301
 
302
302
  ---
303
303
 
@@ -811,7 +811,7 @@ After generating all `.feature` files, create or update `{paths.trace_dir}/{UC-I
811
811
 
812
812
  **TSV columns (tab-separated, one header row + one data row per scenario):**
813
813
  ```
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
814
+ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tdev_selftest\tdev_selftest_at\tprd_version\tbdd_version\ttech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
815
815
  ```
816
816
 
817
817
  **Rules:**
@@ -819,7 +819,7 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
819
819
  - If file exists (re-generation) → for each SC in the new `.feature`:
820
820
  - 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
821
  - 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 `—`.
822
+ - 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`, `tech_doc_revision` all set to `—`.
823
823
  - SC no longer in `.feature` (removed) → delete its row.
824
824
 
825
825
  **Values to write for each scenario:**
@@ -833,6 +833,8 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
833
833
  | `implemented_by` | `—` |
834
834
  | `test_count` | `—` |
835
835
  | `test_classes` | `—` |
836
+ | `dev_selftest` | `—` (no tests run yet) |
837
+ | `dev_selftest_at` | `—` |
836
838
  | `prd_version` | `@trace.prd_version` from `.feature` header |
837
839
  | `bdd_version` | `@trace.bdd_version` from `.feature` header |
838
840
  | `tech_doc_revision` | `—` |
@@ -842,6 +844,27 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
842
844
  | `status` | `UNTRACKED` |
843
845
  | `last_updated` | today `YYYY-MM-DD` |
844
846
 
847
+ ## Refresh Panel Mirror
848
+ # Refresh Living Docs panel mirror *(local, umbrella mode)*
849
+
850
+ *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
851
+ the service `.trace/` IS the panel location, so nothing to mirror.*
852
+
853
+ After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
854
+
855
+ 1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
856
+ 2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
857
+ just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
858
+ (create the dir; overwrite). Use `active_service` for `{service-name}`.
859
+
860
+ This keeps the open workspace's Living Docs panel current **between syncs** — it is a
861
+ **local convenience mirror only**. The *canonical* report in the spec module
862
+ (`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
863
+ `/sync` or `/validate-traces` (those need every service's data, so a single per-UC
864
+ command cannot produce them). For orchestrated commands, do this once in the orchestrator
865
+ after all sub-agents return — not inside each sub-agent.
866
+
867
+
845
868
  ## Output
846
869
 
847
870
  # Report Footer — Standard Command Output Format
@@ -882,13 +905,13 @@ Suggest the logical next command based on workflow phase:
882
905
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
883
906
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
884
907
  | /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 |
908
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
909
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
910
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
911
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
912
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
913
+ | /dev-smoke-test | Create PR and link to ticket |
914
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
892
915
  | /fix-bug | Create PR and link to ticket |
893
916
  | /debug | `/fix-bug {ticket-id}` if fix needed |
894
917
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -930,4 +953,6 @@ Next (umbrella):
930
953
  → /review-context {feature-file} to verify coverage
931
954
  → /generate-tech-docs {feature-file}
932
955
  → /generate-code {feature-file}
956
+
957
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
933
958
  ```
@@ -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\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`, `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,8 @@ 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` | `—` |
483
485
  | `prd_version` | `@trace.prd_version` from `.feature` header |
484
486
  | `bdd_version` | `@trace.bdd_version` from `.feature` header |
485
487
  | `tech_doc_revision` | `—` |
@@ -489,6 +491,9 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
489
491
  | `status` | `UNTRACKED` |
490
492
  | `last_updated` | today `YYYY-MM-DD` |
491
493
 
494
+ ## Refresh Panel Mirror
495
+ {{include:steps/trace-mirror.md}}
496
+
492
497
  ## Output
493
498
 
494
499
  {{include:steps/report-footer.md}}
@@ -517,4 +522,6 @@ Next (umbrella):
517
522
  → /review-context {feature-file} to verify coverage
518
523
  → /generate-tech-docs {feature-file}
519
524
  → /generate-code {feature-file}
525
+
526
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
520
527
  ```
@@ -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).
@@ -299,7 +299,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
299
299
 
300
300
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
301
301
 
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).
302
+ 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
303
 
304
304
  ---
305
305
 
@@ -380,6 +380,7 @@ Read:
380
380
  1. The scoped `.feature` file only
381
381
  2. Tech-doc at `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md` (if exists)
382
382
  3. CLAUDE.md §architecture + §coding_standards
383
+ 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
384
 
384
385
  ---
385
386
 
@@ -403,6 +404,51 @@ Load System BDD for this UC: find `{specs_dir}/{domain}/system/{TICKET-ID}*.feat
403
404
  Extract all `Then` clauses → collect implied response shapes and error states.
404
405
  If System BDD not found → warn: "System BDD not found — mock layer will use placeholder fixtures." Continue.
405
406
 
407
+ **Then run the Figma Dev Mode MCP Check below** before generating any UI — the Design
408
+ Spec's frame links are the visual contract, and the local MCP reads them with far more
409
+ fidelity than a plain web link.
410
+
411
+ ---
412
+
413
+ ## Figma Dev Mode MCP Check *(FE/App UI generation only)*
414
+
415
+ *Run this only when `platform` is `web`/`app` AND generating UI (`--phase=ui`, or default
416
+ mode for an FE/App feature). Skip entirely for BE / `system` platform.*
417
+
418
+ The PO authored the Design Spec from **Figma web links** (read-only, limited). For
419
+ codegen, the **local Figma Dev Mode MCP server** (built into the Figma **desktop app**)
420
+ gives far more: exact layout, design **variables/tokens**, **Code Connect** component
421
+ mappings, selection context, and code snippets — things a web URL alone cannot return.
422
+
423
+ **Step 1 — Detect the local MCP.** Check whether a Figma Dev Mode MCP server is connected
424
+ (a `get_design_context` / `get_code` style Figma tool is available via MCP).
425
+
426
+ **Step 2 — If NOT connected → suggest the dev enable it, then wait:**
427
+
428
+ ```
429
+ 🎨 Figma Dev Mode MCP not detected.
430
+ For accurate FE code (real tokens, components, Code Connect), use the LOCAL server:
431
+
432
+ 1. Open the Figma DESKTOP app (not the browser)
433
+ 2. Open the file/frame for this feature
434
+ 3. Enable the Dev Mode MCP server:
435
+ Figma menu → Preferences → "Enable Dev Mode MCP Server"
436
+ (requires Dev or Full seat; server runs at http://127.0.0.1:3845)
437
+ 4. Make sure this MCP server is added in your Claude Code MCP config
438
+ 5. Select the frame for the screen you're implementing, then continue
439
+
440
+ Type C to continue once enabled, or S to skip (fall back to web links + text spec).
441
+ ```
442
+
443
+ - `C` → re-detect; if now connected → proceed using the local MCP.
444
+ - `S` → proceed in **fallback mode**: use the Design Spec's web frame links + textual spec
445
+ only; add a ⚠️ note in the final report that UI was generated without local Figma fidelity.
446
+
447
+ **Step 3 — When the local MCP IS connected:** for each screen being implemented, pull the
448
+ selected frame via the Figma MCP and ground the UI on the returned layout, variables, and
449
+ Code Connect mappings. Prefer Code-Connect-mapped components over inventing markup; use the
450
+ real token names, not hardcoded values.
451
+
406
452
  **If `--phase=integration`:**
407
453
  Read tech-doc `@trace.status` from `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`.
408
454
  If `draft` or `in-review` → warn:
@@ -425,7 +471,7 @@ Read `{paths.trace_dir}/{UC-ID}.tsv` if it exists. For each scenario row, note i
425
471
  | `UNTRACKED` | `implemented_by == —` | Generate — scenario has no code yet |
426
472
  | `DRIFT` | `spec_ver != gen_ver` | Regenerate — scenario updated since last codegen |
427
473
  | `OK` | implemented + tested | Skip unless explicitly re-generating |
428
- | `GAP` | implemented, no tests | Skip codegen — already coded; run `/generate-tests` instead |
474
+ | `GAP` | implemented, no tests | Skip codegen — already coded; run `/dev-gen-test` instead |
429
475
 
430
476
  Use these statuses to populate the **Scenarios** count in the CHECKPOINT plan (`{X} new, {Y} drifted, {Z} synced-skip`).
431
477
  If `.tsv` does not exist → treat all scenarios as `UNTRACKED`.
@@ -579,9 +625,30 @@ Update `{paths.trace_dir}/{UC-ID}.tsv` — for each implemented scenario, find t
579
625
  | `fe_phase` | `ui` if `--phase=ui` \| `integrated` if `--phase=integration` \| `—` if no phase flag |
580
626
  | `last_updated` | today `YYYY-MM-DD` |
581
627
 
582
- Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`) unchanged.
628
+ Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`) unchanged.
583
629
  `status` is computed by `/validate-traces` — do not set here.
584
630
 
631
+ ## Refresh Panel Mirror
632
+ # Refresh Living Docs panel mirror *(local, umbrella mode)*
633
+
634
+ *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
635
+ the service `.trace/` IS the panel location, so nothing to mirror.*
636
+
637
+ After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
638
+
639
+ 1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
640
+ 2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
641
+ just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
642
+ (create the dir; overwrite). Use `active_service` for `{service-name}`.
643
+
644
+ This keeps the open workspace's Living Docs panel current **between syncs** — it is a
645
+ **local convenience mirror only**. The *canonical* report in the spec module
646
+ (`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
647
+ `/sync` or `/validate-traces` (those need every service's data, so a single per-UC
648
+ command cannot produce them). For orchestrated commands, do this once in the orchestrator
649
+ after all sub-agents return — not inside each sub-agent.
650
+
651
+
585
652
  ## Commit
586
653
  ```bash
587
654
  git add {files}
@@ -628,13 +695,13 @@ Suggest the logical next command based on workflow phase:
628
695
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
629
696
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
630
697
  | /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 |
698
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
699
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
700
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
701
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
702
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
703
+ | /dev-smoke-test | Create PR and link to ticket |
704
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
638
705
  | /fix-bug | Create PR and link to ticket |
639
706
  | /debug | `/fix-bug {ticket-id}` if fix needed |
640
707
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -658,6 +725,7 @@ Files: created={N}, extended={M}, skipped={K} | Build: SUCCESS
658
725
  Branch: feature/{TICKET_ID}-{slug}
659
726
  Phase : {UI (mock layer) | Integration (real API) | Default (full)}
660
727
  fe_phase : {ui | integrated | —}
728
+ Figma : {local Dev Mode MCP (grounded) | ⚠️ web links + text spec only (no local MCP) | n/a for BE} ← FE/App UI only
661
729
 
662
730
  Next:
663
731
  --phase=ui done:
@@ -667,9 +735,11 @@ Next:
667
735
 
668
736
  --phase=integration done:
669
737
  → /review-code {UC-ID} ← code review required
670
- → /generate-tests {UC-ID} ← integration test suite
738
+ → /dev-gen-test {UC-ID} ← integration test suite
671
739
 
672
740
  Default (no phase flag):
673
741
  → /review-code {UC-ID} ← code review required before tests
674
- → /generate-tests {UC-ID}
742
+ → /dev-gen-test {UC-ID}
743
+
744
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
675
745
  ```