@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
package/ARCHITECTURE.md CHANGED
@@ -50,19 +50,26 @@
50
50
  ┌──────────────────────────────────────────────────────────────────────┐
51
51
  │ LAYER 4 — EXECUTION (command logic) │
52
52
  │ │
53
- │ DISCOVERY PRD / BDD CODE / TEST DEBUG
53
+ │ DISCOVERY PRD / BDD CODE / DEV-CHECK DEBUG
54
54
  │ /define-product /generate-prd /generate-code /fix-bug │
55
- │ /refine-prd /generate-tests /debug │
56
- │ /generate-bdd /run-tests /validate- │
57
- │ /generate-tech-docs /smoke-test traces
55
+ │ /refine-prd /dev-gen-test /debug │
56
+ │ /generate-bdd /dev-run-test /validate- │
57
+ │ /generate-tech-docs /dev-smoke-test traces
58
58
  │ /review-code /setup-ai-first │
59
+ │ │
60
+ │ Lưu ý: /dev-gen-test, /dev-run-test, /dev-smoke-test là dev │
61
+ │ self-check / smoke (dev tự kiểm code của mình), KHÔNG phải bộ │
62
+ │ test QC chính thức — QC là một flow riêng chạy sau. │
59
63
  └──────────────────────────────────────────────────────────────────────┘
60
64
 
61
65
  ┌──────────────────────────────────────────────────────────────────────┐
62
66
  │ LAYER 5 — OUTPUT (artifacts in consumer proj) │
63
67
  │ │
64
- specs/product-definition/ specs/prd/ specs/bdd/
65
- tech-docs/ src/ .trace/ .agent/review/
68
+ Spec module (cross-team, via {spec_source}):
69
+ specs/product-definition/ specs/prd/ specs/bdd/
70
+ │ specs/tech-docs/ (API contract) .living-docs/ (gitignored) │
71
+ │ Service submodule (per-service): │
72
+ │ src/ .trace/*.tsv (authoritative, committed) .agent/review/ │
66
73
  └──────────────────────────────────────────────────────────────────────┘
67
74
  ```
68
75
 
@@ -171,8 +178,8 @@ Main session (orchestrator — lightweight, chỉ coordinate)
171
178
  ├─ spawn codegen-agent ──→ /generate-code UC1 (own context window)
172
179
  │ └─ returns: src/ changes
173
180
 
174
- └─ spawn test-agent ──→ /generate-tests UC1 (own context window)
175
- └─ returns: test files
181
+ └─ spawn test-agent ──→ /dev-gen-test UC1 (own context window)
182
+ └─ returns: dev self-check test files (smoke, không phải QC)
176
183
 
177
184
  Benefits:
178
185
  - Main session không bị bloat bởi large file reads
@@ -222,7 +229,11 @@ spec-driven-dev/
222
229
  └── platform-guide.template.md
223
230
  ```
224
231
 
225
- > Build output (gitignored): `commands/*.md`, `skills/**/SKILL.md`, and `core/` (the distributable copied into a consumer's `.agent/` by `--init`). Consumer-side tester artifacts live in the shared spec repo under `feedback/bug-reports/` and `feedback/bdd-proposals/`. In umbrella mode the **API contract (tech-docs)** also lives in the shared spec repo (`{spec_source}/specs/tech-docs/`) so BE and FE/App read the same contract via the spec submodule.
232
+ > Build output (gitignored): `commands/*.md`, `skills/**/SKILL.md`, and `core/` (the distributable copied into a consumer's `.agent/` by `--init`). Consumer-side tester artifacts live in the shared spec repo under `feedback/bug-reports/` and `feedback/bdd-proposals/`. In umbrella mode the **API contract (tech-docs)** is a **cross-team artifact**: khi `setup.spec_source` được set, tech-docs LUÔN route về `{spec_source}/specs/tech-docs/` (giống PRD / design-spec / domain-knowledge), KHÔNG per-service để FE/App đọc contract qua spec submodule `/generate-code --phase=integration`. Chỉ khi không có `spec_source` thì tech-docs mới nằm per-service.
233
+
234
+ > **Living Docs / trace data location**: `.trace/*.tsv` của mỗi service là **authoritative** và được commit trong chính SERVICE submodule. Canonical report của Living Docs (`trace-report.json` + bản TSV mirror đã namespaced) được sinh vào SPEC MODULE tại `{spec_source}/.living-docs/` (gitignored) bởi `/sync` hoặc `/validate-traces`. Ngoài ra một panel mirror cục bộ tại `./.trace` của workspace hiện tại cũng được ghi để VS Code panel resolve được data ngay cả khi mở bên trong một service submodule (không chỉ ở umbrella root). Lý do: spec module được mount vào mọi umbrella/service workspace, nên nó là nơi chung, luôn resolve được cho cross-team dashboard.
235
+ >
236
+ > Trace TSV schema có thêm 2 cột `dev_selftest` (pass/fail/not_run) và `dev_selftest_at`, được set bởi `/dev-run-test` và surface trong Living Docs report như tín hiệu **dev self-check** (không phải coverage QC chính thức).
226
237
 
227
238
  ---
228
239
 
package/commands/debug.md CHANGED
@@ -166,7 +166,7 @@ If `services` section is present:
166
166
 
167
167
  **2. Route to service** — if active domain matches a key in `services`:
168
168
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
169
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
169
+ - 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.
170
170
  - Store `active_service` = `services.{domain}.path`
171
171
  - Store `active_service_module` = `services.{domain}.module`
172
172
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -178,7 +178,7 @@ If `services` section is present:
178
178
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
179
179
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
180
180
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
181
- - 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`.
181
+ - 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.)*
182
182
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
183
183
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
184
184
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -209,7 +209,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
209
209
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
210
210
 
211
211
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
212
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
212
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
213
213
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
214
214
 
215
215
  **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).
@@ -302,7 +302,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
302
302
 
303
303
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
304
304
 
305
- 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).
305
+ 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).
306
306
 
307
307
  ---
308
308
 
@@ -606,13 +606,13 @@ Suggest the logical next command based on workflow phase:
606
606
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
607
607
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
608
608
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
609
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
610
- | /generate-tests | `/run-tests {UC-ID}` |
611
- | /run-tests (passing) | `/review-code {UC-ID}` |
612
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
613
- | /review-code | `/smoke-test {UC-ID}` or create PR |
614
- | /smoke-test | Create PR and link to ticket |
615
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
609
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
610
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
611
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
612
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
613
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
614
+ | /dev-smoke-test | Create PR and link to ticket |
615
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
616
616
  | /fix-bug | Create PR and link to ticket |
617
617
  | /debug | `/fix-bug {ticket-id}` if fix needed |
618
618
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -723,7 +723,7 @@ If `lessons_path` does not exist, create it with this header first:
723
723
  | code-gen | /generate-code output |
724
724
  | bdd | /generate-bdd output |
725
725
  | tech-docs | /generate-tech-docs output |
726
- | tests | /generate-tests output |
726
+ | tests | /dev-gen-test output |
727
727
  | prd | /generate-prd, /refine-prd output |
728
728
  | general | every command |
729
729
 
@@ -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
 
@@ -540,13 +540,13 @@ Suggest the logical next command based on workflow phase:
540
540
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
541
541
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
542
542
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
543
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
544
- | /generate-tests | `/run-tests {UC-ID}` |
545
- | /run-tests (passing) | `/review-code {UC-ID}` |
546
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
547
- | /review-code | `/smoke-test {UC-ID}` or create PR |
548
- | /smoke-test | Create PR and link to ticket |
549
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
543
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
544
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
545
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
546
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
547
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
548
+ | /dev-smoke-test | Create PR and link to ticket |
549
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
550
550
  | /fix-bug | Create PR and link to ticket |
551
551
  | /debug | `/fix-bug {ticket-id}` if fix needed |
552
552
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -1,4 +1,10 @@
1
- # /generate-tests — Generate Unit & Integration Tests
1
+ # /dev-gen-test — Generate Dev Self-Check Tests
2
+
3
+ > **Scope — dev self-check (smoke), not the official test suite.** These tests let the
4
+ > developer quickly verify their own generated code against the BDD scenarios. They are a
5
+ > developer self-check, **not** the QC/dev-team's authoritative test suite (that has its
6
+ > own separate flow, implemented elsewhere). Results surface to the Living Docs dashboard
7
+ > as a **dev self-test** signal so QC can see the dev already ran their own checks.
2
8
 
3
9
  ## Gate
4
10
  # Gate — Universal Entry Procedure
@@ -163,7 +169,7 @@ If `services` section is present:
163
169
 
164
170
  **2. Route to service** — if active domain matches a key in `services`:
165
171
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
166
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
172
+ - 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
173
  - Store `active_service` = `services.{domain}.path`
168
174
  - Store `active_service_module` = `services.{domain}.module`
169
175
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -175,7 +181,7 @@ If `services` section is present:
175
181
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
176
182
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
177
183
  - 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`.
184
+ - 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
185
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
180
186
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
181
187
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -206,7 +212,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
206
212
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
207
213
 
208
214
  **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`
215
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
210
216
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
211
217
 
212
218
  **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 +305,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
299
305
 
300
306
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
301
307
 
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).
308
+ 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
309
 
304
310
  ---
305
311
 
@@ -810,9 +816,33 @@ After generating all test files, update `{paths.trace_dir}/{UC-ID}.tsv` — for
810
816
  |--------|-------|
811
817
  | `test_count` | number of test methods covering this SC |
812
818
  | `test_classes` | comma-separated test class / describe-block names |
819
+ | `dev_selftest` | `not_run` (tests now exist but have not been executed — `/dev-run-test` sets pass/fail) |
813
820
  | `last_updated` | today `YYYY-MM-DD` |
814
821
 
815
- Leave all other columns unchanged.
822
+ Leave all other columns unchanged (including `dev_selftest_at`, which `/dev-run-test` owns).
823
+
824
+ ---
825
+
826
+ ## Refresh Panel Mirror
827
+ # Refresh Living Docs panel mirror *(local, umbrella mode)*
828
+
829
+ *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
830
+ the service `.trace/` IS the panel location, so nothing to mirror.*
831
+
832
+ After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
833
+
834
+ 1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
835
+ 2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
836
+ just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
837
+ (create the dir; overwrite). Use `active_service` for `{service-name}`.
838
+
839
+ This keeps the open workspace's Living Docs panel current **between syncs** — it is a
840
+ **local convenience mirror only**. The *canonical* report in the spec module
841
+ (`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
842
+ `/sync` or `/validate-traces` (those need every service's data, so a single per-UC
843
+ command cannot produce them). For orchestrated commands, do this once in the orchestrator
844
+ after all sub-agents return — not inside each sub-agent.
845
+
816
846
 
817
847
  ---
818
848
 
@@ -856,13 +886,13 @@ Suggest the logical next command based on workflow phase:
856
886
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
857
887
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
858
888
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
859
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
860
- | /generate-tests | `/run-tests {UC-ID}` |
861
- | /run-tests (passing) | `/review-code {UC-ID}` |
862
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
863
- | /review-code | `/smoke-test {UC-ID}` or create PR |
864
- | /smoke-test | Create PR and link to ticket |
865
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
889
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
890
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
891
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
892
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
893
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
894
+ | /dev-smoke-test | Create PR and link to ticket |
895
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
866
896
  | /fix-bug | Create PR and link to ticket |
867
897
  | /debug | `/fix-bug {ticket-id}` if fix needed |
868
898
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -881,9 +911,11 @@ Next : {suggested command with example arguments}
881
911
 
882
912
 
883
913
  ```
884
- /generate-tests Complete — {UC-ID} ({active_module})
914
+ /dev-gen-test Complete — {UC-ID} ({active_module})
885
915
  ✅ {TestClass1} ({N} tests)
886
916
  ✅ {TestClass2} ({N} tests)
887
917
  Trace: {paths.trace_dir}/{UC-ID}.tsv updated
888
- Next: /run-tests {UC-ID}
918
+ Next: /dev-run-test {UC-ID}
919
+
920
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
889
921
  ```
@@ -1,4 +1,10 @@
1
- # /generate-tests — Generate Unit & Integration Tests
1
+ # /dev-gen-test — Generate Dev Self-Check Tests
2
+
3
+ > **Scope — dev self-check (smoke), not the official test suite.** These tests let the
4
+ > developer quickly verify their own generated code against the BDD scenarios. They are a
5
+ > developer self-check, **not** the QC/dev-team's authoritative test suite (that has its
6
+ > own separate flow, implemented elsewhere). Results surface to the Living Docs dashboard
7
+ > as a **dev self-test** signal so QC can see the dev already ran their own checks.
2
8
 
3
9
  ## Gate
4
10
  {{include:steps/gate.md}}
@@ -457,9 +463,15 @@ After generating all test files, update `{paths.trace_dir}/{UC-ID}.tsv` — for
457
463
  |--------|-------|
458
464
  | `test_count` | number of test methods covering this SC |
459
465
  | `test_classes` | comma-separated test class / describe-block names |
466
+ | `dev_selftest` | `not_run` (tests now exist but have not been executed — `/dev-run-test` sets pass/fail) |
460
467
  | `last_updated` | today `YYYY-MM-DD` |
461
468
 
462
- Leave all other columns unchanged.
469
+ Leave all other columns unchanged (including `dev_selftest_at`, which `/dev-run-test` owns).
470
+
471
+ ---
472
+
473
+ ## Refresh Panel Mirror
474
+ {{include:steps/trace-mirror.md}}
463
475
 
464
476
  ---
465
477
 
@@ -468,9 +480,11 @@ Leave all other columns unchanged.
468
480
  {{include:steps/report-footer.md}}
469
481
 
470
482
  ```
471
- /generate-tests Complete — {UC-ID} ({active_module})
483
+ /dev-gen-test Complete — {UC-ID} ({active_module})
472
484
  ✅ {TestClass1} ({N} tests)
473
485
  ✅ {TestClass2} ({N} tests)
474
486
  Trace: {paths.trace_dir}/{UC-ID}.tsv updated
475
- Next: /run-tests {UC-ID}
487
+ Next: /dev-run-test {UC-ID}
488
+
489
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
476
490
  ```
@@ -1,4 +1,10 @@
1
- # /run-tests — Run Tests & Report Results
1
+ # /dev-run-test — Run Dev Self-Check Tests & Report Results
2
+
3
+ > **Scope — dev self-check (smoke), not the official test suite.** Runs the tests produced
4
+ > by `/dev-gen-test` so the developer can confirm their own code works before review. This
5
+ > is a developer self-check, **not** the QC/dev-team's authoritative test run (separate flow).
6
+ > The pass/fail is published to Living Docs as a **dev self-test** signal — it tells QC the
7
+ > dev ran their checks; it is NOT a statement of official test coverage.
2
8
 
3
9
  ## Gate
4
10
  # Gate — Universal Entry Procedure
@@ -163,7 +169,7 @@ If `services` section is present:
163
169
 
164
170
  **2. Route to service** — if active domain matches a key in `services`:
165
171
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
166
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
172
+ - 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
173
  - Store `active_service` = `services.{domain}.path`
168
174
  - Store `active_service_module` = `services.{domain}.module`
169
175
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -175,7 +181,7 @@ If `services` section is present:
175
181
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
176
182
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
177
183
  - 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`.
184
+ - 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
185
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
180
186
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
181
187
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -206,7 +212,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
206
212
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
207
213
 
208
214
  **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`
215
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
210
216
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
211
217
 
212
218
  **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 +305,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
299
305
 
300
306
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
301
307
 
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).
308
+ 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
309
 
304
310
  ---
305
311
 
@@ -523,6 +529,44 @@ xcodebuild test -scheme {Scheme} -destination 'platform=iOS Simulator,name=iPhon
523
529
 
524
530
  ---
525
531
 
532
+ ## Write Trace State
533
+
534
+ After the run, persist results to the **authoritative TSV** in the service so they reach
535
+ the Living Docs report at the spec module (via `/sync` + `/validate-traces`). The test
536
+ files themselves stay in the service — only the run *status* is reported.
537
+
538
+ Update `{paths.trace_dir}/{UC-ID}.tsv` — for each scenario row (matched by `sc_id` via its
539
+ test's `@trace.verifies={UC-ID}-SC{N}` tag):
540
+
541
+ | Column | Value |
542
+ |--------|-------|
543
+ | `dev_selftest` | `pass` if all tests for this SC passed · `fail` if any failed · `not_run` if its tests were skipped/absent |
544
+ | `dev_selftest_at` | today `YYYY-MM-DD` |
545
+
546
+ Leave all other columns unchanged. `dev_selftest`/`dev_selftest_at` are orthogonal to `status`
547
+ (OK/GAP/DRIFT/UNTRACKED): `status` tracks *coverage*, `dev_selftest` tracks the latest *run result*.
548
+
549
+ ## Refresh Panel Mirror
550
+ # Refresh Living Docs panel mirror *(local, umbrella mode)*
551
+
552
+ *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
553
+ the service `.trace/` IS the panel location, so nothing to mirror.*
554
+
555
+ After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
556
+
557
+ 1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
558
+ 2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
559
+ just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
560
+ (create the dir; overwrite). Use `active_service` for `{service-name}`.
561
+
562
+ This keeps the open workspace's Living Docs panel current **between syncs** — it is a
563
+ **local convenience mirror only**. The *canonical* report in the spec module
564
+ (`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
565
+ `/sync` or `/validate-traces` (those need every service's data, so a single per-UC
566
+ command cannot produce them). For orchestrated commands, do this once in the orchestrator
567
+ after all sub-agents return — not inside each sub-agent.
568
+
569
+
526
570
  ## Output
527
571
 
528
572
  # Report Footer — Standard Command Output Format
@@ -563,13 +607,13 @@ Suggest the logical next command based on workflow phase:
563
607
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
564
608
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
565
609
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
566
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
567
- | /generate-tests | `/run-tests {UC-ID}` |
568
- | /run-tests (passing) | `/review-code {UC-ID}` |
569
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
570
- | /review-code | `/smoke-test {UC-ID}` or create PR |
571
- | /smoke-test | Create PR and link to ticket |
572
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
610
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
611
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
612
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
613
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
614
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
615
+ | /dev-smoke-test | Create PR and link to ticket |
616
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
573
617
  | /fix-bug | Create PR and link to ticket |
574
618
  | /debug | `/fix-bug {ticket-id}` if fix needed |
575
619
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -588,7 +632,7 @@ Next : {suggested command with example arguments}
588
632
 
589
633
 
590
634
  ```
591
- /run-tests Report — {UC-ID} ({active_module})
635
+ /dev-run-test Report — {UC-ID} ({active_module})
592
636
  ✅ Passed: {N} | ❌ Failed: {M} | ⏭️ Skipped: {K} | Duration: {X}s
593
637
 
594
638
  ## Failed Tests
@@ -598,7 +642,11 @@ Next : {suggested command with example arguments}
598
642
  ## Recommendations
599
643
  {specific fix per failure}
600
644
 
645
+ Trace: {paths.trace_dir}/{UC-ID}.tsv updated (dev_selftest, dev_selftest_at)
646
+
601
647
  Next:
602
648
  All tests pass → /review-code {UC-ID}
603
649
  Tests fail → /fix-bug {TICKET_ID} (real bug) or fix test (wrong expectation)
650
+
651
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
604
652
  ```
@@ -1,4 +1,10 @@
1
- # /run-tests — Run Tests & Report Results
1
+ # /dev-run-test — Run Dev Self-Check Tests & Report Results
2
+
3
+ > **Scope — dev self-check (smoke), not the official test suite.** Runs the tests produced
4
+ > by `/dev-gen-test` so the developer can confirm their own code works before review. This
5
+ > is a developer self-check, **not** the QC/dev-team's authoritative test run (separate flow).
6
+ > The pass/fail is published to Living Docs as a **dev self-test** signal — it tells QC the
7
+ > dev ran their checks; it is NOT a statement of official test coverage.
2
8
 
3
9
  ## Gate
4
10
  {{include:steps/gate.md}}
@@ -170,12 +176,32 @@ xcodebuild test -scheme {Scheme} -destination 'platform=iOS Simulator,name=iPhon
170
176
 
171
177
  ---
172
178
 
179
+ ## Write Trace State
180
+
181
+ After the run, persist results to the **authoritative TSV** in the service so they reach
182
+ the Living Docs report at the spec module (via `/sync` + `/validate-traces`). The test
183
+ files themselves stay in the service — only the run *status* is reported.
184
+
185
+ Update `{paths.trace_dir}/{UC-ID}.tsv` — for each scenario row (matched by `sc_id` via its
186
+ test's `@trace.verifies={UC-ID}-SC{N}` tag):
187
+
188
+ | Column | Value |
189
+ |--------|-------|
190
+ | `dev_selftest` | `pass` if all tests for this SC passed · `fail` if any failed · `not_run` if its tests were skipped/absent |
191
+ | `dev_selftest_at` | today `YYYY-MM-DD` |
192
+
193
+ Leave all other columns unchanged. `dev_selftest`/`dev_selftest_at` are orthogonal to `status`
194
+ (OK/GAP/DRIFT/UNTRACKED): `status` tracks *coverage*, `dev_selftest` tracks the latest *run result*.
195
+
196
+ ## Refresh Panel Mirror
197
+ {{include:steps/trace-mirror.md}}
198
+
173
199
  ## Output
174
200
 
175
201
  {{include:steps/report-footer.md}}
176
202
 
177
203
  ```
178
- /run-tests Report — {UC-ID} ({active_module})
204
+ /dev-run-test Report — {UC-ID} ({active_module})
179
205
  ✅ Passed: {N} | ❌ Failed: {M} | ⏭️ Skipped: {K} | Duration: {X}s
180
206
 
181
207
  ## Failed Tests
@@ -185,7 +211,11 @@ xcodebuild test -scheme {Scheme} -destination 'platform=iOS Simulator,name=iPhon
185
211
  ## Recommendations
186
212
  {specific fix per failure}
187
213
 
214
+ Trace: {paths.trace_dir}/{UC-ID}.tsv updated (dev_selftest, dev_selftest_at)
215
+
188
216
  Next:
189
217
  All tests pass → /review-code {UC-ID}
190
218
  Tests fail → /fix-bug {TICKET_ID} (real bug) or fix test (wrong expectation)
219
+
220
+ 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
191
221
  ```