@anhth2/spec-driven-dev-plugin 0.9.1 → 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.
- package/ARCHITECTURE.md +20 -9
- package/bin/index.js +1 -2
- package/commands/debug.md +13 -12
- package/commands/define-product.md +12 -11
- package/commands/{generate-tests.md → dev-gen-test.md} +48 -15
- package/commands/{generate-tests.tmpl → dev-gen-test.tmpl} +18 -4
- package/{core/commands/run-tests.md → commands/dev-run-test.md} +62 -13
- package/commands/{run-tests.tmpl → dev-run-test.tmpl} +32 -2
- package/{core/commands/smoke-test.md → commands/dev-smoke-test.md} +17 -16
- package/commands/{smoke-test.tmpl → dev-smoke-test.tmpl} +5 -5
- package/commands/fix-bug.md +13 -12
- package/commands/generate-bdd.md +39 -13
- package/commands/generate-bdd.tmpl +9 -2
- package/commands/generate-code.md +86 -15
- package/commands/generate-code.tmpl +56 -4
- package/commands/generate-design-spec.md +105 -39
- package/commands/generate-design-spec.tmpl +93 -28
- package/commands/generate-prd.md +12 -11
- package/commands/generate-spec-manifest.md +12 -11
- package/commands/generate-tech-docs.md +63 -22
- package/commands/generate-tech-docs.tmpl +51 -11
- package/commands/learn.md +13 -12
- package/commands/propose-scenario.md +13 -12
- package/commands/propose-scenario.tmpl +1 -1
- package/commands/refine-prd.md +166 -16
- package/commands/refine-prd.tmpl +16 -5
- package/commands/report-bug.md +12 -11
- package/commands/review-code.md +14 -13
- package/commands/review-code.tmpl +1 -1
- package/commands/review-context.md +161 -12
- package/commands/review-context.tmpl +11 -1
- package/commands/review-tech-docs.md +13 -11
- package/commands/review-tech-docs.tmpl +1 -0
- package/commands/setup-ai-first.md +7 -7
- package/commands/sync.md +23 -20
- package/commands/sync.tmpl +16 -13
- package/commands/update-framework.md +7 -7
- package/commands/validate-traces.md +57 -37
- package/commands/validate-traces.tmpl +45 -26
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +13 -12
- package/core/commands/define-product.md +12 -11
- package/core/commands/{generate-tests.md → dev-gen-test.md} +48 -15
- package/{commands/run-tests.md → core/commands/dev-run-test.md} +62 -13
- package/{commands/smoke-test.md → core/commands/dev-smoke-test.md} +17 -16
- package/core/commands/fix-bug.md +13 -12
- package/core/commands/generate-bdd.md +39 -13
- package/core/commands/generate-code.md +86 -15
- package/core/commands/generate-design-spec.md +105 -39
- package/core/commands/generate-prd.md +12 -11
- package/core/commands/generate-spec-manifest.md +12 -11
- package/core/commands/generate-tech-docs.md +63 -22
- package/core/commands/learn.md +13 -12
- package/core/commands/propose-scenario.md +13 -12
- package/core/commands/refine-prd.md +166 -16
- package/core/commands/report-bug.md +12 -11
- package/core/commands/review-code.md +14 -13
- package/core/commands/review-context.md +161 -12
- package/core/commands/review-tech-docs.md +13 -11
- package/core/commands/setup-ai-first.md +7 -7
- package/core/commands/sync.md +23 -20
- package/core/commands/update-framework.md +7 -7
- package/core/commands/validate-traces.md +57 -37
- package/core/modules/android-compose/module.yaml +13 -0
- package/core/modules/android-compose/stack-profile.yaml +57 -0
- package/core/modules/flutter/module.yaml +14 -0
- package/core/modules/flutter/stack-profile.yaml +59 -0
- package/core/modules/ios-swiftui/module.yaml +13 -0
- package/core/modules/ios-swiftui/stack-profile.yaml +55 -0
- package/core/modules/nuxt/module.yaml +14 -0
- package/core/modules/nuxt/stack-profile.yaml +58 -0
- package/core/modules/react-native/module.yaml +14 -0
- package/core/modules/react-native/stack-profile.yaml +56 -0
- package/core/modules/vue/module.yaml +14 -0
- package/core/modules/vue/stack-profile.yaml +65 -0
- package/core/skills/code/SKILL.md +19 -18
- package/core/skills/debug/SKILL.md +27 -26
- package/core/skills/design-spec/SKILL.md +12 -11
- package/core/skills/discovery/SKILL.md +12 -11
- package/core/skills/prd/SKILL.md +14 -14
- package/core/skills/setup-ai-first/SKILL.md +7 -7
- package/core/skills/spec/SKILL.md +14 -14
- package/core/skills/test/SKILL.md +40 -38
- package/core/steps/capture-lesson.md +1 -1
- package/core/steps/context-loader.md +5 -4
- package/core/steps/report-footer.md +7 -7
- package/core/steps/review-fanout.md +138 -0
- package/core/steps/spawn-agent.md +1 -1
- package/core/steps/trace-mirror.md +18 -0
- package/core/templates/design-spec.template.md +16 -8
- package/core/templates/product-definition.template.md +3 -3
- package/core/templates/project-context.yaml +4 -1
- package/modules/android-compose/module.yaml +13 -0
- package/modules/android-compose/stack-profile.yaml +57 -0
- package/modules/flutter/module.yaml +14 -0
- package/modules/flutter/stack-profile.yaml +59 -0
- package/modules/ios-swiftui/module.yaml +13 -0
- package/modules/ios-swiftui/stack-profile.yaml +55 -0
- package/modules/nuxt/module.yaml +14 -0
- package/modules/nuxt/stack-profile.yaml +58 -0
- package/modules/react-native/module.yaml +14 -0
- package/modules/react-native/stack-profile.yaml +56 -0
- package/modules/vue/module.yaml +14 -0
- package/modules/vue/stack-profile.yaml +65 -0
- package/package.json +1 -1
- package/skills/code/SKILL.md +19 -18
- package/skills/debug/SKILL.md +27 -26
- package/skills/debug/SKILL.tmpl +1 -1
- package/skills/design-spec/SKILL.md +12 -11
- package/skills/discovery/SKILL.md +12 -11
- package/skills/prd/SKILL.md +14 -14
- package/skills/setup-ai-first/SKILL.md +7 -7
- package/skills/spec/SKILL.md +14 -14
- package/skills/test/SKILL.md +40 -38
- package/skills/test/SKILL.tmpl +9 -9
- package/steps/capture-lesson.md +1 -1
- package/steps/context-loader.md +5 -4
- package/steps/report-footer.md +7 -7
- package/steps/review-fanout.md +138 -0
- package/steps/spawn-agent.md +1 -1
- package/steps/trace-mirror.md +18 -0
- package/templates/design-spec.template.md +16 -8
- package/templates/product-definition.template.md +3 -3
- package/templates/project-context.yaml +4 -1
|
@@ -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,13 +177,14 @@ 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` — **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.)*
|
|
180
181
|
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
181
182
|
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
182
183
|
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
183
184
|
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
184
185
|
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
185
186
|
|
|
186
|
-
> **Why under `spec_source`:**
|
|
187
|
+
> **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
|
|
187
188
|
|
|
188
189
|
---
|
|
189
190
|
|
|
@@ -207,7 +208,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
|
|
|
207
208
|
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
208
209
|
|
|
209
210
|
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
210
|
-
- Shell commands (`/run-
|
|
211
|
+
- Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
|
|
211
212
|
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
212
213
|
|
|
213
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).
|
|
@@ -300,7 +301,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
|
300
301
|
|
|
301
302
|
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
302
303
|
|
|
303
|
-
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (
|
|
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).
|
|
304
305
|
|
|
305
306
|
---
|
|
306
307
|
|
|
@@ -375,8 +376,12 @@ Check whether `services` array exists in `project-context.yaml`.
|
|
|
375
376
|
- Use `services[N].trace_dir` if explicitly set
|
|
376
377
|
- Otherwise default to `{services[N].path}/.trace`
|
|
377
378
|
- Set `all_trace_dirs = [ dir1, dir2, ... ]` — one per service
|
|
378
|
-
- Set `umbrella_root_trace = ".trace"` (at umbrella workspace root)
|
|
379
379
|
- Step 1 will read TSVs from ALL dirs in `all_trace_dirs`, tagged by service name
|
|
380
|
+
- **Resolve the Living Docs home (canonical report location):**
|
|
381
|
+
- If `setup.spec_source` is set → `living_docs_dir = {spec_source}/.living-docs`
|
|
382
|
+
*(the shared specs module — mounted inside every service/umbrella workspace, so the panel resolves it no matter which submodule the dev is standing in)*
|
|
383
|
+
- Else (umbrella without a separate spec repo) → `living_docs_dir = .living-docs` at umbrella root
|
|
384
|
+
- **Resolve the panel mirror:** `panel_mirror = ./.trace` at the **current workspace root** (wherever this command runs). The VS Code panel reads `.trace/trace-report.json` from the open workspace — writing the merged report here is what makes the view non-empty when a dev opens a service submodule directly.
|
|
380
385
|
|
|
381
386
|
**If no `services` key (single-service mode):**
|
|
382
387
|
- Set `all_trace_dirs = [ {paths.trace_dir} ]`
|
|
@@ -439,6 +444,7 @@ If code was generated from an older revision → flag `TECHDOC_DRIFT`.
|
|
|
439
444
|
*Skip this step if no TSV files existed (handled by Step 1 no-TSV path).*
|
|
440
445
|
|
|
441
446
|
For each `.tsv` file processed: write updated `spec_ver`, `status`, `last_updated` back to disk.
|
|
447
|
+
Do **not** modify `dev_selftest` or `dev_selftest_at` — those are owned by `/dev-run-test`; this command only reads them for the report.
|
|
442
448
|
|
|
443
449
|
### Step 7 — Compute dashboard aggregates
|
|
444
450
|
|
|
@@ -454,6 +460,11 @@ test_coverage = rows where test_count > 0 / total_scs
|
|
|
454
460
|
drift_count = rows where status == DRIFT
|
|
455
461
|
untracked_count = rows where status == UNTRACKED
|
|
456
462
|
gap_count = rows where status == GAP
|
|
463
|
+
dev_selftest_passing = rows where dev_selftest == pass
|
|
464
|
+
dev_selftest_failing = rows where dev_selftest == fail
|
|
465
|
+
dev_selftest_not_run = rows where dev_selftest in (not_run, —)
|
|
466
|
+
# NOTE: this is the DEV self-check signal (did the dev run their own smoke tests),
|
|
467
|
+
# NOT official QC/dev-team coverage — keep it labeled as such on the dashboard.
|
|
457
468
|
tech_docs_count = count .md files in {paths.tech_docs_dir}/{domain}/
|
|
458
469
|
```
|
|
459
470
|
|
|
@@ -481,6 +492,9 @@ Schema:
|
|
|
481
492
|
"drift_count": 0,
|
|
482
493
|
"gap_count": 0,
|
|
483
494
|
"untracked_count": 0,
|
|
495
|
+
"dev_selftest_passing": 0,
|
|
496
|
+
"dev_selftest_failing": 0,
|
|
497
|
+
"dev_selftest_not_run": 0,
|
|
484
498
|
"tech_docs_count": 0
|
|
485
499
|
},
|
|
486
500
|
"prds": [
|
|
@@ -506,6 +520,8 @@ Schema:
|
|
|
506
520
|
"implemented_by": "<ClassName.method or null>",
|
|
507
521
|
"test_count": 0,
|
|
508
522
|
"test_classes": ["<TestClass1>", "<TestClass2>"],
|
|
523
|
+
"dev_selftest": "pass | fail | not_run",
|
|
524
|
+
"dev_selftest_at": "<YYYY-MM-DD or null>",
|
|
509
525
|
"prd_version": "<prd version when BDD was generated>",
|
|
510
526
|
"bdd_version": "<bdd version when code was generated>",
|
|
511
527
|
"tech_doc_revision": 0,
|
|
@@ -532,7 +548,7 @@ Schema:
|
|
|
532
548
|
"sc_id": "<SC-ID>",
|
|
533
549
|
"sc_title": "<title>",
|
|
534
550
|
"implemented_by": "<method>",
|
|
535
|
-
"fix": "/
|
|
551
|
+
"fix": "/dev-gen-test <UC-ID>"
|
|
536
552
|
}
|
|
537
553
|
],
|
|
538
554
|
"untracked": [
|
|
@@ -570,37 +586,40 @@ Schema:
|
|
|
570
586
|
- `tech_doc_revision`: use integer; `0` if not yet generated
|
|
571
587
|
- `code_coverage_pct` / `test_coverage_pct`: round to nearest integer (0–100)
|
|
572
588
|
- Always write to `{paths.trace_dir}/trace-report.json` regardless of domain filter — if a domain filter was applied, include only those PRDs in `prds[]` but note the domain in the `domain` field
|
|
573
|
-
- **TSV `"—"` mapping**: when reading TSV files, map dash values to JSON types: `implemented_by: "—"` → `null`; `test_count: "—"` → `0`; `test_classes: "—"` → `[]`; `tech_doc_revision: "—"` → `0`
|
|
589
|
+
- **TSV `"—"` mapping**: when reading TSV files, map dash values to JSON types: `implemented_by: "—"` → `null`; `test_count: "—"` → `0`; `test_classes: "—"` → `[]`; `tech_doc_revision: "—"` → `0`; `dev_selftest: "—"` → `"not_run"`; `dev_selftest_at: "—"` → `null`
|
|
574
590
|
|
|
575
|
-
### Step 8b —
|
|
591
|
+
### Step 8b — Living Docs Sync *(umbrella mode only)*
|
|
576
592
|
|
|
577
593
|
*Skip this step in single-service mode.*
|
|
578
594
|
|
|
579
|
-
|
|
595
|
+
Authoritative trace state stays in each service submodule's `.trace/` (committed there).
|
|
596
|
+
This step publishes the merged report to the **canonical Living Docs home** (the specs
|
|
597
|
+
module) and drops a local mirror so the panel is never empty.
|
|
580
598
|
|
|
581
|
-
1.
|
|
599
|
+
1. **Write canonical merged report** to `{living_docs_dir}/` (`mkdir -p` it first):
|
|
600
|
+
- `{living_docs_dir}/trace-report.json` — merge every per-service `trace-report.json`
|
|
601
|
+
into one document, add a `"service"` field per scenario row, recalc summary aggregates.
|
|
602
|
+
- `{living_docs_dir}/{service-name}/{UC-ID}.tsv` — copy each service's TSVs, namespaced
|
|
603
|
+
by service. Overwrite; don't delete TSVs whose service source is gone (prior runs).
|
|
582
604
|
|
|
583
|
-
2. **
|
|
584
|
-
|
|
585
|
-
{
|
|
586
|
-
|
|
587
|
-
Overwrite if exists. Do not delete files in `.trace/` that no longer have a service source — they may be from a previous run.
|
|
588
|
-
|
|
589
|
-
3. **Write aggregated `trace-report.json`** to `{umbrella_root_trace}/trace-report.json`:
|
|
590
|
-
- Merge all per-service `trace-report.json` data into one document
|
|
591
|
-
- Add `"service"` field to each scenario row
|
|
592
|
-
- Recalculate summary aggregates across all services
|
|
605
|
+
2. **Mirror to the panel location** `{panel_mirror}` (`./.trace` at the current workspace
|
|
606
|
+
root) so a dev who opened *this* repo (umbrella **or** a single service submodule) sees
|
|
607
|
+
data immediately: copy `{living_docs_dir}/trace-report.json` → `{panel_mirror}/trace-report.json`
|
|
608
|
+
(and the namespaced TSVs). If `panel_mirror` already resolves to `living_docs_dir`, skip.
|
|
593
609
|
|
|
594
|
-
|
|
610
|
+
3. **Print sync summary:**
|
|
595
611
|
```
|
|
596
|
-
|
|
597
|
-
user-service : {N} TSV files
|
|
598
|
-
order-service : {N} TSV files
|
|
612
|
+
Living Docs → {living_docs_dir}/ (canonical, in specs module)
|
|
613
|
+
user-service : {N} TSV files
|
|
614
|
+
order-service : {N} TSV files
|
|
599
615
|
trace-report.json: merged ({total} scenarios across {S} services)
|
|
600
|
-
|
|
616
|
+
Panel mirror → {panel_mirror}/trace-report.json (current workspace)
|
|
601
617
|
```
|
|
602
618
|
|
|
603
|
-
> **Note
|
|
619
|
+
> **Note — both locations are generated, gitignored mirrors.** Add `.living-docs/` to the
|
|
620
|
+
> **specs module's** `.gitignore` and `.trace/` to the current repo's `.gitignore`. The only
|
|
621
|
+
> committed, authoritative trace state is each service submodule's own `.trace/`. The report
|
|
622
|
+
> is regenerated by `/validate-traces` or `/sync` — never commit it.
|
|
604
623
|
|
|
605
624
|
## Output
|
|
606
625
|
|
|
@@ -642,13 +661,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
642
661
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
643
662
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
644
663
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
645
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
646
|
-
| /
|
|
647
|
-
| /run-
|
|
648
|
-
| /run-
|
|
649
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
650
|
-
| /smoke-test | Create PR and link to ticket |
|
|
651
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
664
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
665
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
666
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
667
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
668
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
669
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
670
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
652
671
|
| /fix-bug | Create PR and link to ticket |
|
|
653
672
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
654
673
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
@@ -701,11 +720,12 @@ Tech-Doc Revision Drift:
|
|
|
701
720
|
|
|
702
721
|
Recommendations:
|
|
703
722
|
- /generate-code {UC-ID} for DRIFT and UNTRACKED scenarios
|
|
704
|
-
- /
|
|
723
|
+
- /dev-gen-test {UC-ID} for GAP (missing tests)
|
|
705
724
|
- /generate-bdd {prd-file} for PRD version drift
|
|
706
725
|
|
|
707
726
|
[Umbrella mode only]
|
|
708
|
-
Living Docs
|
|
709
|
-
|
|
710
|
-
|
|
727
|
+
Living Docs canonical → {living_docs_dir}/ (specs module — shared, gitignored)
|
|
728
|
+
Panel mirror → {panel_mirror}/trace-report.json (current workspace)
|
|
729
|
+
Tip: run /validate-traces (or /sync) after each codegen session to refresh the panel.
|
|
730
|
+
Both are generated mirrors — do not commit (.living-docs/ + .trace/ in .gitignore).
|
|
711
731
|
```
|
|
@@ -23,8 +23,12 @@ Check whether `services` array exists in `project-context.yaml`.
|
|
|
23
23
|
- Use `services[N].trace_dir` if explicitly set
|
|
24
24
|
- Otherwise default to `{services[N].path}/.trace`
|
|
25
25
|
- Set `all_trace_dirs = [ dir1, dir2, ... ]` — one per service
|
|
26
|
-
- Set `umbrella_root_trace = ".trace"` (at umbrella workspace root)
|
|
27
26
|
- Step 1 will read TSVs from ALL dirs in `all_trace_dirs`, tagged by service name
|
|
27
|
+
- **Resolve the Living Docs home (canonical report location):**
|
|
28
|
+
- If `setup.spec_source` is set → `living_docs_dir = {spec_source}/.living-docs`
|
|
29
|
+
*(the shared specs module — mounted inside every service/umbrella workspace, so the panel resolves it no matter which submodule the dev is standing in)*
|
|
30
|
+
- Else (umbrella without a separate spec repo) → `living_docs_dir = .living-docs` at umbrella root
|
|
31
|
+
- **Resolve the panel mirror:** `panel_mirror = ./.trace` at the **current workspace root** (wherever this command runs). The VS Code panel reads `.trace/trace-report.json` from the open workspace — writing the merged report here is what makes the view non-empty when a dev opens a service submodule directly.
|
|
28
32
|
|
|
29
33
|
**If no `services` key (single-service mode):**
|
|
30
34
|
- Set `all_trace_dirs = [ {paths.trace_dir} ]`
|
|
@@ -87,6 +91,7 @@ If code was generated from an older revision → flag `TECHDOC_DRIFT`.
|
|
|
87
91
|
*Skip this step if no TSV files existed (handled by Step 1 no-TSV path).*
|
|
88
92
|
|
|
89
93
|
For each `.tsv` file processed: write updated `spec_ver`, `status`, `last_updated` back to disk.
|
|
94
|
+
Do **not** modify `dev_selftest` or `dev_selftest_at` — those are owned by `/dev-run-test`; this command only reads them for the report.
|
|
90
95
|
|
|
91
96
|
### Step 7 — Compute dashboard aggregates
|
|
92
97
|
|
|
@@ -102,6 +107,11 @@ test_coverage = rows where test_count > 0 / total_scs
|
|
|
102
107
|
drift_count = rows where status == DRIFT
|
|
103
108
|
untracked_count = rows where status == UNTRACKED
|
|
104
109
|
gap_count = rows where status == GAP
|
|
110
|
+
dev_selftest_passing = rows where dev_selftest == pass
|
|
111
|
+
dev_selftest_failing = rows where dev_selftest == fail
|
|
112
|
+
dev_selftest_not_run = rows where dev_selftest in (not_run, —)
|
|
113
|
+
# NOTE: this is the DEV self-check signal (did the dev run their own smoke tests),
|
|
114
|
+
# NOT official QC/dev-team coverage — keep it labeled as such on the dashboard.
|
|
105
115
|
tech_docs_count = count .md files in {paths.tech_docs_dir}/{domain}/
|
|
106
116
|
```
|
|
107
117
|
|
|
@@ -129,6 +139,9 @@ Schema:
|
|
|
129
139
|
"drift_count": 0,
|
|
130
140
|
"gap_count": 0,
|
|
131
141
|
"untracked_count": 0,
|
|
142
|
+
"dev_selftest_passing": 0,
|
|
143
|
+
"dev_selftest_failing": 0,
|
|
144
|
+
"dev_selftest_not_run": 0,
|
|
132
145
|
"tech_docs_count": 0
|
|
133
146
|
},
|
|
134
147
|
"prds": [
|
|
@@ -154,6 +167,8 @@ Schema:
|
|
|
154
167
|
"implemented_by": "<ClassName.method or null>",
|
|
155
168
|
"test_count": 0,
|
|
156
169
|
"test_classes": ["<TestClass1>", "<TestClass2>"],
|
|
170
|
+
"dev_selftest": "pass | fail | not_run",
|
|
171
|
+
"dev_selftest_at": "<YYYY-MM-DD or null>",
|
|
157
172
|
"prd_version": "<prd version when BDD was generated>",
|
|
158
173
|
"bdd_version": "<bdd version when code was generated>",
|
|
159
174
|
"tech_doc_revision": 0,
|
|
@@ -180,7 +195,7 @@ Schema:
|
|
|
180
195
|
"sc_id": "<SC-ID>",
|
|
181
196
|
"sc_title": "<title>",
|
|
182
197
|
"implemented_by": "<method>",
|
|
183
|
-
"fix": "/
|
|
198
|
+
"fix": "/dev-gen-test <UC-ID>"
|
|
184
199
|
}
|
|
185
200
|
],
|
|
186
201
|
"untracked": [
|
|
@@ -218,37 +233,40 @@ Schema:
|
|
|
218
233
|
- `tech_doc_revision`: use integer; `0` if not yet generated
|
|
219
234
|
- `code_coverage_pct` / `test_coverage_pct`: round to nearest integer (0–100)
|
|
220
235
|
- Always write to `{paths.trace_dir}/trace-report.json` regardless of domain filter — if a domain filter was applied, include only those PRDs in `prds[]` but note the domain in the `domain` field
|
|
221
|
-
- **TSV `"—"` mapping**: when reading TSV files, map dash values to JSON types: `implemented_by: "—"` → `null`; `test_count: "—"` → `0`; `test_classes: "—"` → `[]`; `tech_doc_revision: "—"` → `0`
|
|
236
|
+
- **TSV `"—"` mapping**: when reading TSV files, map dash values to JSON types: `implemented_by: "—"` → `null`; `test_count: "—"` → `0`; `test_classes: "—"` → `[]`; `tech_doc_revision: "—"` → `0`; `dev_selftest: "—"` → `"not_run"`; `dev_selftest_at: "—"` → `null`
|
|
222
237
|
|
|
223
|
-
### Step 8b —
|
|
238
|
+
### Step 8b — Living Docs Sync *(umbrella mode only)*
|
|
224
239
|
|
|
225
240
|
*Skip this step in single-service mode.*
|
|
226
241
|
|
|
227
|
-
|
|
242
|
+
Authoritative trace state stays in each service submodule's `.trace/` (committed there).
|
|
243
|
+
This step publishes the merged report to the **canonical Living Docs home** (the specs
|
|
244
|
+
module) and drops a local mirror so the panel is never empty.
|
|
228
245
|
|
|
229
|
-
1.
|
|
246
|
+
1. **Write canonical merged report** to `{living_docs_dir}/` (`mkdir -p` it first):
|
|
247
|
+
- `{living_docs_dir}/trace-report.json` — merge every per-service `trace-report.json`
|
|
248
|
+
into one document, add a `"service"` field per scenario row, recalc summary aggregates.
|
|
249
|
+
- `{living_docs_dir}/{service-name}/{UC-ID}.tsv` — copy each service's TSVs, namespaced
|
|
250
|
+
by service. Overwrite; don't delete TSVs whose service source is gone (prior runs).
|
|
230
251
|
|
|
231
|
-
2. **
|
|
232
|
-
|
|
233
|
-
{
|
|
234
|
-
|
|
235
|
-
Overwrite if exists. Do not delete files in `.trace/` that no longer have a service source — they may be from a previous run.
|
|
236
|
-
|
|
237
|
-
3. **Write aggregated `trace-report.json`** to `{umbrella_root_trace}/trace-report.json`:
|
|
238
|
-
- Merge all per-service `trace-report.json` data into one document
|
|
239
|
-
- Add `"service"` field to each scenario row
|
|
240
|
-
- Recalculate summary aggregates across all services
|
|
252
|
+
2. **Mirror to the panel location** `{panel_mirror}` (`./.trace` at the current workspace
|
|
253
|
+
root) so a dev who opened *this* repo (umbrella **or** a single service submodule) sees
|
|
254
|
+
data immediately: copy `{living_docs_dir}/trace-report.json` → `{panel_mirror}/trace-report.json`
|
|
255
|
+
(and the namespaced TSVs). If `panel_mirror` already resolves to `living_docs_dir`, skip.
|
|
241
256
|
|
|
242
|
-
|
|
257
|
+
3. **Print sync summary:**
|
|
243
258
|
```
|
|
244
|
-
|
|
245
|
-
user-service : {N} TSV files
|
|
246
|
-
order-service : {N} TSV files
|
|
259
|
+
Living Docs → {living_docs_dir}/ (canonical, in specs module)
|
|
260
|
+
user-service : {N} TSV files
|
|
261
|
+
order-service : {N} TSV files
|
|
247
262
|
trace-report.json: merged ({total} scenarios across {S} services)
|
|
248
|
-
|
|
263
|
+
Panel mirror → {panel_mirror}/trace-report.json (current workspace)
|
|
249
264
|
```
|
|
250
265
|
|
|
251
|
-
> **Note
|
|
266
|
+
> **Note — both locations are generated, gitignored mirrors.** Add `.living-docs/` to the
|
|
267
|
+
> **specs module's** `.gitignore` and `.trace/` to the current repo's `.gitignore`. The only
|
|
268
|
+
> committed, authoritative trace state is each service submodule's own `.trace/`. The report
|
|
269
|
+
> is regenerated by `/validate-traces` or `/sync` — never commit it.
|
|
252
270
|
|
|
253
271
|
## Output
|
|
254
272
|
|
|
@@ -289,11 +307,12 @@ Tech-Doc Revision Drift:
|
|
|
289
307
|
|
|
290
308
|
Recommendations:
|
|
291
309
|
- /generate-code {UC-ID} for DRIFT and UNTRACKED scenarios
|
|
292
|
-
- /
|
|
310
|
+
- /dev-gen-test {UC-ID} for GAP (missing tests)
|
|
293
311
|
- /generate-bdd {prd-file} for PRD version drift
|
|
294
312
|
|
|
295
313
|
[Umbrella mode only]
|
|
296
|
-
Living Docs
|
|
297
|
-
|
|
298
|
-
|
|
314
|
+
Living Docs canonical → {living_docs_dir}/ (specs module — shared, gitignored)
|
|
315
|
+
Panel mirror → {panel_mirror}/trace-report.json (current workspace)
|
|
316
|
+
Tip: run /validate-traces (or /sync) after each codegen session to refresh the panel.
|
|
317
|
+
Both are generated mirrors — do not commit (.living-docs/ + .trace/ in .gitignore).
|
|
299
318
|
```
|
package/core/FRAMEWORK_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.10.0
|
package/core/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,13 +178,14 @@ 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` — **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
182
|
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
182
183
|
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
183
184
|
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
184
185
|
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
185
186
|
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
186
187
|
|
|
187
|
-
> **Why under `spec_source`:**
|
|
188
|
+
> **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
|
|
188
189
|
|
|
189
190
|
---
|
|
190
191
|
|
|
@@ -208,7 +209,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
|
|
|
208
209
|
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
209
210
|
|
|
210
211
|
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
211
|
-
- Shell commands (`/run-
|
|
212
|
+
- Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
|
|
212
213
|
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
213
214
|
|
|
214
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).
|
|
@@ -301,7 +302,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
|
301
302
|
|
|
302
303
|
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
303
304
|
|
|
304
|
-
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (
|
|
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).
|
|
305
306
|
|
|
306
307
|
---
|
|
307
308
|
|
|
@@ -605,13 +606,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
605
606
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
606
607
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
607
608
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
608
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
609
|
-
| /
|
|
610
|
-
| /run-
|
|
611
|
-
| /run-
|
|
612
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
613
|
-
| /smoke-test | Create PR and link to ticket |
|
|
614
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
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 |
|
|
615
616
|
| /fix-bug | Create PR and link to ticket |
|
|
616
617
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
617
618
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
@@ -722,7 +723,7 @@ If `lessons_path` does not exist, create it with this header first:
|
|
|
722
723
|
| code-gen | /generate-code output |
|
|
723
724
|
| bdd | /generate-bdd output |
|
|
724
725
|
| tech-docs | /generate-tech-docs output |
|
|
725
|
-
| tests | /
|
|
726
|
+
| tests | /dev-gen-test output |
|
|
726
727
|
| prd | /generate-prd, /refine-prd output |
|
|
727
728
|
| general | every command |
|
|
728
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,13 +175,14 @@ 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` — **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.)*
|
|
178
179
|
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
179
180
|
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
180
181
|
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
181
182
|
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
182
183
|
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
183
184
|
|
|
184
|
-
> **Why under `spec_source`:**
|
|
185
|
+
> **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
|
|
185
186
|
|
|
186
187
|
---
|
|
187
188
|
|
|
@@ -205,7 +206,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
|
|
|
205
206
|
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
206
207
|
|
|
207
208
|
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
208
|
-
- Shell commands (`/run-
|
|
209
|
+
- Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
|
|
209
210
|
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
210
211
|
|
|
211
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).
|
|
@@ -298,7 +299,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
|
298
299
|
|
|
299
300
|
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
300
301
|
|
|
301
|
-
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (
|
|
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).
|
|
302
303
|
|
|
303
304
|
---
|
|
304
305
|
|
|
@@ -539,13 +540,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
539
540
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
540
541
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
541
542
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
542
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
543
|
-
| /
|
|
544
|
-
| /run-
|
|
545
|
-
| /run-
|
|
546
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
547
|
-
| /smoke-test | Create PR and link to ticket |
|
|
548
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
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 |
|
|
549
550
|
| /fix-bug | Create PR and link to ticket |
|
|
550
551
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
551
552
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
# /
|
|
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,13 +181,14 @@ 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`
|
|
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.)*
|
|
178
185
|
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
179
186
|
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
180
187
|
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
181
188
|
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
182
189
|
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
183
190
|
|
|
184
|
-
> **Why under `spec_source`:**
|
|
191
|
+
> **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
|
|
185
192
|
|
|
186
193
|
---
|
|
187
194
|
|
|
@@ -205,7 +212,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
|
|
|
205
212
|
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
206
213
|
|
|
207
214
|
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
208
|
-
- Shell commands (`/run-
|
|
215
|
+
- Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
|
|
209
216
|
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
210
217
|
|
|
211
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).
|
|
@@ -298,7 +305,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
|
298
305
|
|
|
299
306
|
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
300
307
|
|
|
301
|
-
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (
|
|
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).
|
|
302
309
|
|
|
303
310
|
---
|
|
304
311
|
|
|
@@ -809,9 +816,33 @@ After generating all test files, update `{paths.trace_dir}/{UC-ID}.tsv` — for
|
|
|
809
816
|
|--------|-------|
|
|
810
817
|
| `test_count` | number of test methods covering this SC |
|
|
811
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) |
|
|
812
820
|
| `last_updated` | today `YYYY-MM-DD` |
|
|
813
821
|
|
|
814
|
-
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
|
+
|
|
815
846
|
|
|
816
847
|
---
|
|
817
848
|
|
|
@@ -855,13 +886,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
855
886
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
856
887
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
857
888
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
858
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
859
|
-
| /
|
|
860
|
-
| /run-
|
|
861
|
-
| /run-
|
|
862
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
863
|
-
| /smoke-test | Create PR and link to ticket |
|
|
864
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
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 |
|
|
865
896
|
| /fix-bug | Create PR and link to ticket |
|
|
866
897
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
867
898
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
@@ -880,9 +911,11 @@ Next : {suggested command with example arguments}
|
|
|
880
911
|
|
|
881
912
|
|
|
882
913
|
```
|
|
883
|
-
/
|
|
914
|
+
/dev-gen-test Complete — {UC-ID} ({active_module})
|
|
884
915
|
✅ {TestClass1} ({N} tests)
|
|
885
916
|
✅ {TestClass2} ({N} tests)
|
|
886
917
|
Trace: {paths.trace_dir}/{UC-ID}.tsv updated
|
|
887
|
-
Next: /run-
|
|
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.
|
|
888
921
|
```
|