@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.
Files changed (124) hide show
  1. package/ARCHITECTURE.md +20 -9
  2. package/bin/index.js +1 -2
  3. package/commands/debug.md +13 -12
  4. package/commands/define-product.md +12 -11
  5. package/commands/{generate-tests.md → dev-gen-test.md} +48 -15
  6. package/commands/{generate-tests.tmpl → dev-gen-test.tmpl} +18 -4
  7. package/{core/commands/run-tests.md → commands/dev-run-test.md} +62 -13
  8. package/commands/{run-tests.tmpl → dev-run-test.tmpl} +32 -2
  9. package/{core/commands/smoke-test.md → commands/dev-smoke-test.md} +17 -16
  10. package/commands/{smoke-test.tmpl → dev-smoke-test.tmpl} +5 -5
  11. package/commands/fix-bug.md +13 -12
  12. package/commands/generate-bdd.md +39 -13
  13. package/commands/generate-bdd.tmpl +9 -2
  14. package/commands/generate-code.md +86 -15
  15. package/commands/generate-code.tmpl +56 -4
  16. package/commands/generate-design-spec.md +105 -39
  17. package/commands/generate-design-spec.tmpl +93 -28
  18. package/commands/generate-prd.md +12 -11
  19. package/commands/generate-spec-manifest.md +12 -11
  20. package/commands/generate-tech-docs.md +63 -22
  21. package/commands/generate-tech-docs.tmpl +51 -11
  22. package/commands/learn.md +13 -12
  23. package/commands/propose-scenario.md +13 -12
  24. package/commands/propose-scenario.tmpl +1 -1
  25. package/commands/refine-prd.md +166 -16
  26. package/commands/refine-prd.tmpl +16 -5
  27. package/commands/report-bug.md +12 -11
  28. package/commands/review-code.md +14 -13
  29. package/commands/review-code.tmpl +1 -1
  30. package/commands/review-context.md +161 -12
  31. package/commands/review-context.tmpl +11 -1
  32. package/commands/review-tech-docs.md +13 -11
  33. package/commands/review-tech-docs.tmpl +1 -0
  34. package/commands/setup-ai-first.md +7 -7
  35. package/commands/sync.md +23 -20
  36. package/commands/sync.tmpl +16 -13
  37. package/commands/update-framework.md +7 -7
  38. package/commands/validate-traces.md +57 -37
  39. package/commands/validate-traces.tmpl +45 -26
  40. package/core/FRAMEWORK_VERSION +1 -1
  41. package/core/commands/debug.md +13 -12
  42. package/core/commands/define-product.md +12 -11
  43. package/core/commands/{generate-tests.md → dev-gen-test.md} +48 -15
  44. package/{commands/run-tests.md → core/commands/dev-run-test.md} +62 -13
  45. package/{commands/smoke-test.md → core/commands/dev-smoke-test.md} +17 -16
  46. package/core/commands/fix-bug.md +13 -12
  47. package/core/commands/generate-bdd.md +39 -13
  48. package/core/commands/generate-code.md +86 -15
  49. package/core/commands/generate-design-spec.md +105 -39
  50. package/core/commands/generate-prd.md +12 -11
  51. package/core/commands/generate-spec-manifest.md +12 -11
  52. package/core/commands/generate-tech-docs.md +63 -22
  53. package/core/commands/learn.md +13 -12
  54. package/core/commands/propose-scenario.md +13 -12
  55. package/core/commands/refine-prd.md +166 -16
  56. package/core/commands/report-bug.md +12 -11
  57. package/core/commands/review-code.md +14 -13
  58. package/core/commands/review-context.md +161 -12
  59. package/core/commands/review-tech-docs.md +13 -11
  60. package/core/commands/setup-ai-first.md +7 -7
  61. package/core/commands/sync.md +23 -20
  62. package/core/commands/update-framework.md +7 -7
  63. package/core/commands/validate-traces.md +57 -37
  64. package/core/modules/android-compose/module.yaml +13 -0
  65. package/core/modules/android-compose/stack-profile.yaml +57 -0
  66. package/core/modules/flutter/module.yaml +14 -0
  67. package/core/modules/flutter/stack-profile.yaml +59 -0
  68. package/core/modules/ios-swiftui/module.yaml +13 -0
  69. package/core/modules/ios-swiftui/stack-profile.yaml +55 -0
  70. package/core/modules/nuxt/module.yaml +14 -0
  71. package/core/modules/nuxt/stack-profile.yaml +58 -0
  72. package/core/modules/react-native/module.yaml +14 -0
  73. package/core/modules/react-native/stack-profile.yaml +56 -0
  74. package/core/modules/vue/module.yaml +14 -0
  75. package/core/modules/vue/stack-profile.yaml +65 -0
  76. package/core/skills/code/SKILL.md +19 -18
  77. package/core/skills/debug/SKILL.md +27 -26
  78. package/core/skills/design-spec/SKILL.md +12 -11
  79. package/core/skills/discovery/SKILL.md +12 -11
  80. package/core/skills/prd/SKILL.md +14 -14
  81. package/core/skills/setup-ai-first/SKILL.md +7 -7
  82. package/core/skills/spec/SKILL.md +14 -14
  83. package/core/skills/test/SKILL.md +40 -38
  84. package/core/steps/capture-lesson.md +1 -1
  85. package/core/steps/context-loader.md +5 -4
  86. package/core/steps/report-footer.md +7 -7
  87. package/core/steps/review-fanout.md +138 -0
  88. package/core/steps/spawn-agent.md +1 -1
  89. package/core/steps/trace-mirror.md +18 -0
  90. package/core/templates/design-spec.template.md +16 -8
  91. package/core/templates/product-definition.template.md +3 -3
  92. package/core/templates/project-context.yaml +4 -1
  93. package/modules/android-compose/module.yaml +13 -0
  94. package/modules/android-compose/stack-profile.yaml +57 -0
  95. package/modules/flutter/module.yaml +14 -0
  96. package/modules/flutter/stack-profile.yaml +59 -0
  97. package/modules/ios-swiftui/module.yaml +13 -0
  98. package/modules/ios-swiftui/stack-profile.yaml +55 -0
  99. package/modules/nuxt/module.yaml +14 -0
  100. package/modules/nuxt/stack-profile.yaml +58 -0
  101. package/modules/react-native/module.yaml +14 -0
  102. package/modules/react-native/stack-profile.yaml +56 -0
  103. package/modules/vue/module.yaml +14 -0
  104. package/modules/vue/stack-profile.yaml +65 -0
  105. package/package.json +1 -1
  106. package/skills/code/SKILL.md +19 -18
  107. package/skills/debug/SKILL.md +27 -26
  108. package/skills/debug/SKILL.tmpl +1 -1
  109. package/skills/design-spec/SKILL.md +12 -11
  110. package/skills/discovery/SKILL.md +12 -11
  111. package/skills/prd/SKILL.md +14 -14
  112. package/skills/setup-ai-first/SKILL.md +7 -7
  113. package/skills/spec/SKILL.md +14 -14
  114. package/skills/test/SKILL.md +40 -38
  115. package/skills/test/SKILL.tmpl +9 -9
  116. package/steps/capture-lesson.md +1 -1
  117. package/steps/context-loader.md +5 -4
  118. package/steps/report-footer.md +7 -7
  119. package/steps/review-fanout.md +138 -0
  120. package/steps/spawn-agent.md +1 -1
  121. package/steps/trace-mirror.md +18 -0
  122. package/templates/design-spec.template.md +16 -8
  123. package/templates/product-definition.template.md +3 -3
  124. package/templates/project-context.yaml +4 -1
@@ -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`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
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-tests`, `/generate-tests`) run **from within** `service_root`
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 (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).
302
303
 
303
304
  ---
304
305
 
@@ -398,19 +399,6 @@ Using `active_module` and `platform_type` derived from context loading:
398
399
 
399
400
  ---
400
401
 
401
- ## Figma Check
402
-
403
- Ask:
404
-
405
- ```
406
- Do you have a Figma link for this feature? (paste URL or press Enter to skip)
407
- ```
408
-
409
- - If URL provided → store as `figma_url`.
410
- - If skipped → `figma_url = "TBD"`. Add AI Assumption: "Figma link not provided — all screen descriptions are text-based. Link must be added and verified before Design Spec sign-off."
411
-
412
- ---
413
-
414
402
  ## Screen Discovery
415
403
 
416
404
  From the PRD's Section 4 (User Flow + Wireframe), extract all screen / page / modal names mentioned.
@@ -431,6 +419,54 @@ Wait for confirmation. Store the confirmed list as `screen_list`.
431
419
 
432
420
  ---
433
421
 
422
+ ## Figma Frame Links *(mandatory — one readable node-level link per screen)*
423
+
424
+ A Design Spec is only as good as the design it points to. The AI **cannot read a plain
425
+ file link** (`figma.com/design/{fileKey}/...` with no `node-id`) — it needs a
426
+ **node-level link to each specific frame** so it can fetch that frame's real layout,
427
+ components, and tokens via the Figma MCP. So collect one link **per screen**, not one
428
+ link for the whole feature.
429
+
430
+ **Ask the PO, listing every screen in `screen_list`:**
431
+
432
+ ```
433
+ Paste the Figma frame link for each screen below.
434
+
435
+ In Figma: select the frame → right-click → "Copy link to selection"
436
+ (the URL must contain ?node-id=... — that is the per-frame link the AI can read)
437
+
438
+ 1. {Screen 1} : ____
439
+ 2. {Screen 2} : ____
440
+ ...
441
+
442
+ If a screen has no design yet, type none for that screen.
443
+ ```
444
+
445
+ **For each answer:**
446
+
447
+ 1. **Validate format** — the URL must match `figma.com/design/{fileKey}/...?node-id={nodeId}`.
448
+ - Valid → store as `figma_frames[{screen}] = {url}`, parse out `fileKey` + `nodeId`.
449
+ - A file link with **no `node-id`** → reject it: "This link points to the whole file, not a frame. Re-copy via right-click → Copy link to selection." Re-ask for that screen.
450
+ - `none` → `figma_frames[{screen}] = "TBD"`, mark that screen ❌ Missing.
451
+
452
+ 2. **Fetch the frame via Figma MCP** (only for valid links) — call `get_design_context`
453
+ (and `get_screenshot` when useful) with the parsed `fileKey` + `nodeId` to read the
454
+ real layout, component names, and design tokens. Ground every Screen Spec in this
455
+ fetched data; do **not** invent layout the frame does not show. If a fetch fails
456
+ (permission / not found) → treat that screen as ❌ Missing and note the fetch error.
457
+
458
+ 3. Derive the feature-level `figma_url` = the file link (without `node-id`) shared by the
459
+ frames, for the Metadata row. If frames span multiple files, list each.
460
+
461
+ **Mandatory gate (does not abort — produces a draft):**
462
+ - If **any** screen is ❌ Missing → the spec is generated as a **draft** with those screens
463
+ flagged, but `Status` stays `draft` and **sign-off / `/generate-bdd` is blocked** until
464
+ every screen has a readable, fetched frame link. Record `missing_frames = [screens]`.
465
+ - Add one AI Assumption per missing screen: "No readable Figma frame for {screen} — spec
466
+ for this screen is text-only and must not be signed off until a `node-id` link is added."
467
+
468
+ ---
469
+
434
470
  ## CHECKPOINT
435
471
 
436
472
  ```
@@ -442,9 +478,13 @@ Module : {active_module}
442
478
  Service : {active_service}
443
479
  Domain : {domain}
444
480
  Screens : {N} — {comma-separated screen_list}
445
- Figma : {figma_url}
481
+ Figma : {linked}/{N} screens have readable frame links{; missing: comma-separated missing_frames}
446
482
  Output path : {paths.design_spec_dir}/{domain}/{TICKET-ID}-design-spec-{active_platform}-{slug}.md
447
483
 
484
+ {If missing_frames non-empty}:
485
+ ⚠️ {count} screen(s) without a readable Figma frame link — these will be generated as
486
+ text-only drafts and the spec cannot be signed off until their node-id links are added.
487
+
448
488
  Generate? (Y/N)
449
489
  ```
450
490
 
@@ -469,6 +509,15 @@ Apply these rules consistently when generating all sections:
469
509
  - `app` / `app-ios` / `app-android` → include gestures, safe area, minimum touch targets, navigation pattern, deep links, permissions, offline behavior.
470
510
  - Only generate the section relevant to `active_platform`. Omit the other platform's section entirely.
471
511
 
512
+ **Figma grounding (mandatory):**
513
+ - For every screen with a fetched frame (`figma_frames[screen]` is a valid link), base the
514
+ Layout, Component Inventory, and Screen States on the **fetched Figma data** — real
515
+ component names, real tokens, real frame structure. Do not contradict or invent layout.
516
+ - Use the exact per-screen `figma_frames[screen]` URL in the Screen Inventory, each Screen
517
+ Spec header, and the Figma Summary — never a synthetic `{figma_url}#screen1` fragment.
518
+ - For ❌ Missing screens: generate a text-only draft from the PRD, prefix the Screen Spec
519
+ with `> [DRAFT — no Figma frame; do not sign off]`, and leave the Figma cell as ❌ Missing.
520
+
472
521
  **Screen states (mandatory per screen):**
473
522
  - Every screen must document at minimum: `default`, `loading`, `error`.
474
523
  - Add `empty` when the screen can display zero-data state.
@@ -498,7 +547,7 @@ Write `{paths.design_spec_dir}/{domain}/{TICKET-ID}-design-spec-{active_platform
498
547
  | **Service** | {active_service} |
499
548
  | **Domain** | {domain} |
500
549
  | **Business PRD** | [{TICKET-ID}]({relative-path-to-prd.md}) |
501
- | **Figma** | {figma_url} |
550
+ | **Figma** | {figma_url — feature file link} ({linked}/{N} frames linked) |
502
551
  | **Author** | {PO name or "AI-assisted"} |
503
552
  | **Created** | {YYYY-MM-DD} |
504
553
  | **Updated** | {YYYY-MM-DD} |
@@ -509,8 +558,8 @@ Write `{paths.design_spec_dir}/{domain}/{TICKET-ID}-design-spec-{active_platform
509
558
 
510
559
  | # | Screen Name | Entry Point | Figma Frame | Notes |
511
560
  |---|-------------|-------------|-------------|-------|
512
- | 1 | {Screen 1} | {how user arrives — e.g., tap CTA on Home} | [Frame]({figma_url}#screen1) | |
513
- | 2 | {Screen 2} | {entry point} | [Frame]({figma_url}#screen2) | |
561
+ | 1 | {Screen 1} | {how user arrives — e.g., tap CTA on Home} | [Frame]({figma_frames[Screen 1]}) | |
562
+ | 2 | {Screen 2} | {entry point} | [Frame]({figma_frames[Screen 2]}) / ❌ Missing | |
514
563
 
515
564
  ---
516
565
 
@@ -523,7 +572,7 @@ Write `{paths.design_spec_dir}/{domain}/{TICKET-ID}-design-spec-{active_platform
523
572
 
524
573
  ## Screen 1: {Screen Name}
525
574
 
526
- **Figma**: [{Frame name}]({figma_frame_url})
575
+ **Figma**: [{Frame name}]({figma_frames[Screen 1]}) <!-- ❌ Missing → prefix this screen with `> [DRAFT — no Figma frame; do not sign off]` -->
527
576
 
528
577
  ### Layout
529
578
 
@@ -679,10 +728,10 @@ Exit: {how the user leaves — back stack / tab switch / deeplink out}
679
728
 
680
729
  ## Figma Summary
681
730
 
682
- | Screen | Figma Frame | Designer Status |
683
- |-----------------|-------------------------------|------------------------|
684
- | {Screen 1} | [Link]({figma_frame_url}) | ✅ Ready / ⏳ WIP / ❌ Missing |
685
- | {Screen 2} | [Link]({figma_frame_url}) | Ready / WIP / Missing |
731
+ | Screen | Figma Frame | Link / Fetch Status |
732
+ |-----------------|--------------------------------------|--------------------------------------|
733
+ | {Screen 1} | [Link]({figma_frames[Screen 1]}) | ✅ Linked & fetched |
734
+ | {Screen 2} | | Missing no node-id link provided |
686
735
 
687
736
  ## Design Tokens Referenced
688
737
 
@@ -704,6 +753,7 @@ Exit: {how the user leaves — back stack / tab switch / deeplink out}
704
753
  > PO must review and confirm before sign-off.
705
754
 
706
755
  - {Assumption 1 — [AI DRAFT]}
756
+ - {One per ❌ Missing screen: "No readable Figma frame for {screen} — text-only draft; blocks sign-off until a node-id link is added."}
707
757
 
708
758
  ---
709
759
 
@@ -715,9 +765,10 @@ Exit: {how the user leaves — back stack / tab switch / deeplink out}
715
765
 
716
766
  <!--
717
767
  NEXT STEPS:
718
- 1. Share with Designer verify Figma links, update component inventory.
719
- 2. PO + Designer sign off: change Status "approved".
720
- 3. Run /generate-bdd "{prd-file}" BDD uses AC-UI from this spec for FE scenarios.
768
+ 1. Fill any Missing Figma frame links (node-id links) — re-run to fetch & ground them.
769
+ 2. Share with Designer verify Figma links, update component inventory.
770
+ 3. PO + Designer sign off: change Status → "approved" (only allowed when 0 screens are Missing).
771
+ 4. Run /generate-bdd "{prd-file}" — BDD uses AC-UI from this spec for FE scenarios.
721
772
  -->
722
773
  ````
723
774
 
@@ -732,7 +783,9 @@ Exit: {how the user leaves — back stack / tab switch / deeplink out}
732
783
  - [ ] Only the platform-relevant section generated in Section 4
733
784
  - [ ] AC-UI items are testable (clear pass/fail, not "looks good")
734
785
  - [ ] Business PRD cross-reference link is valid relative path
735
- - [ ] If `figma_url = "TBD"` AI Assumption added in Appendix
786
+ - [ ] Every screen has a node-level Figma frame link (`?node-id=`) — and screens with a link were fetched via Figma MCP and used to ground the spec
787
+ - [ ] Each ❌ Missing screen is flagged in-spec (`> [DRAFT — no Figma frame...]`), listed in Figma Summary, and has an AI Assumption
788
+ - [ ] If any screen is ❌ Missing → Status stays `draft` and the Output below blocks `/generate-bdd`
736
789
 
737
790
  ---
738
791
 
@@ -776,13 +829,13 @@ Suggest the logical next command based on workflow phase:
776
829
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
777
830
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
778
831
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
779
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
780
- | /generate-tests | `/run-tests {UC-ID}` |
781
- | /run-tests (passing) | `/review-code {UC-ID}` |
782
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
783
- | /review-code | `/smoke-test {UC-ID}` or create PR |
784
- | /smoke-test | Create PR and link to ticket |
785
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
832
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
833
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
834
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
835
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
836
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
837
+ | /dev-smoke-test | Create PR and link to ticket |
838
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
786
839
  | /fix-bug | Create PR and link to ticket |
787
840
  | /debug | `/fix-bug {ticket-id}` if fix needed |
788
841
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -800,12 +853,25 @@ Next : {suggested command with example arguments}
800
853
  ```
801
854
 
802
855
 
856
+ {If missing_frames is empty}:
803
857
  ```
804
858
  /generate-design-spec Complete — {TICKET-ID} [{active_platform}]
805
859
  ---
806
- Status : ✅ Complete
860
+ Status : ✅ Complete — all {N} screens linked & fetched from Figma
807
861
  Output Artifacts:
808
862
  created {paths.design_spec_dir}/{domain}/{TICKET-ID}-design-spec-{active_platform}-{slug}.md (v1.0)
809
- Next : Share with Designer → add Figma links → PO + Designer sign-off (Status: approved)
863
+ Next : Share with Designer → PO + Designer sign-off (Status: approved)
810
864
  → /generate-bdd {prd-file} (generates BDD per service; reads AC-UI from Design Spec)
811
865
  ```
866
+
867
+ {If missing_frames is non-empty}:
868
+ ```
869
+ /generate-design-spec Complete (DRAFT) — {TICKET-ID} [{active_platform}]
870
+ ---
871
+ Status : ⚠️ Warnings — {count} screen(s) without a readable Figma frame: {comma-separated missing_frames}
872
+ Output Artifacts:
873
+ created {paths.design_spec_dir}/{domain}/{TICKET-ID}-design-spec-{active_platform}-{slug}.md (v1.0, draft)
874
+ Next : 🔒 Sign-off & /generate-bdd are BLOCKED until every screen has a node-id Figma link.
875
+ 1. In Figma: select each missing frame → right-click → Copy link to selection
876
+ 2. Re-run /generate-design-spec {prd-file} → AI fetches & grounds the new frames
877
+ ```
@@ -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`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
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-tests`, `/generate-tests`) run **from within** `service_root`
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 (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).
302
303
 
303
304
  ---
304
305
 
@@ -631,13 +632,13 @@ Suggest the logical next command based on workflow phase:
631
632
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
632
633
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
633
634
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
634
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
635
- | /generate-tests | `/run-tests {UC-ID}` |
636
- | /run-tests (passing) | `/review-code {UC-ID}` |
637
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
638
- | /review-code | `/smoke-test {UC-ID}` or create PR |
639
- | /smoke-test | Create PR and link to ticket |
640
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
635
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
636
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
637
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
638
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
639
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
640
+ | /dev-smoke-test | Create PR and link to ticket |
641
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
641
642
  | /fix-bug | Create PR and link to ticket |
642
643
  | /debug | `/fix-bug {ticket-id}` if fix needed |
643
644
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -168,7 +168,7 @@ If `services` section is present:
168
168
 
169
169
  **2. Route to service** — if active domain matches a key in `services`:
170
170
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
171
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
171
+ - 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.
172
172
  - Store `active_service` = `services.{domain}.path`
173
173
  - Store `active_service_module` = `services.{domain}.module`
174
174
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -180,13 +180,14 @@ If `services` section is present:
180
180
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
181
181
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
182
182
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
183
+ - 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.)*
183
184
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
184
185
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
185
186
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
186
187
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
187
188
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
188
189
 
189
- > **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
190
+ > **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.
190
191
 
191
192
  ---
192
193
 
@@ -210,7 +211,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
210
211
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
211
212
 
212
213
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
213
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
214
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
214
215
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
215
216
 
216
217
  **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).
@@ -303,7 +304,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
303
304
 
304
305
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
305
306
 
306
- 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).
307
+ 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).
307
308
 
308
309
  ---
309
310
 
@@ -528,13 +529,13 @@ Suggest the logical next command based on workflow phase:
528
529
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
529
530
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
530
531
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
531
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
532
- | /generate-tests | `/run-tests {UC-ID}` |
533
- | /run-tests (passing) | `/review-code {UC-ID}` |
534
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
535
- | /review-code | `/smoke-test {UC-ID}` or create PR |
536
- | /smoke-test | Create PR and link to ticket |
537
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
532
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
533
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
534
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
535
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
536
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
537
+ | /dev-smoke-test | Create PR and link to ticket |
538
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
538
539
  | /fix-bug | Create PR and link to ticket |
539
540
  | /debug | `/fix-bug {ticket-id}` if fix needed |
540
541
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -184,7 +184,7 @@ If `services` section is present:
184
184
 
185
185
  **2. Route to service** — if active domain matches a key in `services`:
186
186
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
187
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
187
+ - 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.
188
188
  - Store `active_service` = `services.{domain}.path`
189
189
  - Store `active_service_module` = `services.{domain}.module`
190
190
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -196,13 +196,14 @@ If `services` section is present:
196
196
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
197
197
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
198
198
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
199
+ - 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.)*
199
200
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
200
201
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
201
202
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
202
203
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
203
204
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
204
205
 
205
- > **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
206
+ > **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.
206
207
 
207
208
  ---
208
209
 
@@ -226,7 +227,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
226
227
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
227
228
 
228
229
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
229
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
230
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
230
231
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
231
232
 
232
233
  **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).
@@ -319,7 +320,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
319
320
 
320
321
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
321
322
 
322
- 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).
323
+ 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).
323
324
 
324
325
  ---
325
326
 
@@ -453,25 +454,49 @@ Write `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`:
453
454
  ---
454
455
 
455
456
  ## §1. Overview
457
+
458
+ {Tóm tắt ngắn: UC này implement gì, scope kỹ thuật chính.}
459
+
456
460
  ## §2. API Endpoints
457
- *Greenfield:* endpoints được infer từ BDD scenarios — thiết kế mới.
458
- *Reverse-document:* tả lại API đã tồn tại từ bảng "Existing API Contract" trong PRD.
459
- Ghi chú gaps nếu contract thực tế khác với BDD expectations.
460
- | Method | Path | Auth/Role | Request | Response |
461
+
462
+ *Greenfield:* endpoints được infer từ BDD scenarios thiết kế mới.
463
+ *Reverse-document:* mô tả lại API đã tồn tại từ bảng "Existing API Contract" trong PRD. Ghi chú gaps nếu contract thực tế khác với BDD expectations.
464
+
465
+ | Method | Path | Auth/Role | Request | Response |
466
+ |--------|------|-----------|---------|----------|
467
+ | {GET/POST/PUT/DELETE} | {/api/v1/...} | {Bearer / role} | `{ field: type }` | `{ field: type }` |
468
+
461
469
  ## §3. Data Model
462
- Key entities and relationships.
470
+
471
+ Key entities and relationships.
472
+
463
473
  ## §4. Service Flow
464
- {Client} → Controller → {Facade/Service} → {Repository}
474
+
475
+ {Client} → Controller → {Facade/Service} → {Repository}
476
+
465
477
  ## §5. Business Rules Implementation
466
- | BR-ID | Rule | Implementation approach |
478
+
479
+ | BR-ID | Rule | Implementation approach |
480
+ |-------|------|-------------------------|
481
+ | {UC-ID}-BR1 | {rule} | {approach} |
482
+
467
483
  ## §6. Error Handling
468
- | Scenario | Exception | HTTP Status |
484
+
485
+ | Scenario | Exception | HTTP Status |
486
+ |----------|-----------|-------------|
487
+ | {scenario} | {ExceptionClass} | {4xx/5xx} |
488
+
469
489
  ## §7. Database Changes
470
- Migration scripts or schema changes.
490
+
491
+ Migration scripts or schema changes.
492
+
471
493
  ## §8. Caching Strategy
472
- What to cache, TTL, invalidation triggers.
494
+
495
+ What to cache, TTL, invalidation triggers.
496
+
473
497
  ## §9. Cross-Service Dependencies
474
- External calls, events produced/consumed.
498
+
499
+ External calls, events produced/consumed.
475
500
 
476
501
  ## Changelog
477
502
 
@@ -480,6 +505,21 @@ Write `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`:
480
505
  | 1 | {YYYY-MM-DD} | Initial generation from {UC-ID}.feature (BDD v{bdd_version}) |
481
506
  ```
482
507
 
508
+ ## Publish — share the contract (umbrella + shared spec repo)
509
+
510
+ If `paths.tech_docs_dir` resolved **under `setup.spec_source`** (e.g. `{spec_source}/specs/tech-docs`), the tech-doc was just written **inside the spec submodule**. It is the cross-team **API contract** — FE/App read it via their own `/sync`. Publish it so they can (2-layer commit):
511
+
512
+ ```bash
513
+ cd {spec_source}
514
+ git add specs/tech-docs/{domain}/{UC-ID}-tech-design.md
515
+ git commit -m "docs({UC-ID}): tech design / API contract"
516
+ git push origin {spec_branch} # the branch FE/App track in .gitmodules
517
+ cd -
518
+ git add {spec_source} && git commit -m "chore: bump spec pointer ({UC-ID} tech design)"
519
+ ```
520
+
521
+ If `tech_docs_dir` is **local** — i.e. no `setup.spec_source` (single-repo, or a pure multi-service BE repo with no shared spec module) — skip this; no cross-repo publish needed. Whenever `spec_source` is set, tech-docs route to the spec submodule and this publish step applies.
522
+
483
523
  ## Output
484
524
 
485
525
  # Report Footer — Standard Command Output Format
@@ -520,13 +560,13 @@ Suggest the logical next command based on workflow phase:
520
560
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
521
561
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
522
562
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
523
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
524
- | /generate-tests | `/run-tests {UC-ID}` |
525
- | /run-tests (passing) | `/review-code {UC-ID}` |
526
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
527
- | /review-code | `/smoke-test {UC-ID}` or create PR |
528
- | /smoke-test | Create PR and link to ticket |
529
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
563
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
564
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
565
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
566
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
567
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
568
+ | /dev-smoke-test | Create PR and link to ticket |
569
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
530
570
  | /fix-bug | Create PR and link to ticket |
531
571
  | /debug | `/fix-bug {ticket-id}` if fix needed |
532
572
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -549,5 +589,6 @@ Next : {suggested command with example arguments}
549
589
  File: {paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md
550
590
  Next: /review-tech-docs {paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md
551
591
  ← SA/Lead review required before code generation
592
+ → if tech-docs live in the shared spec repo: commit + push to the spec submodule (see Publish above) so FE/App `/sync` can read the contract
552
593
  → after approved: /generate-code {paths.specs_dir}/{domain}/{UC-ID}-{slug}.feature
553
594
  ```