@anhth2/spec-driven-dev-plugin 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/ARCHITECTURE.md +20 -9
  2. package/commands/debug.md +12 -12
  3. package/commands/define-product.md +11 -11
  4. package/commands/{generate-tests.md → dev-gen-test.md} +47 -15
  5. package/commands/{generate-tests.tmpl → dev-gen-test.tmpl} +18 -4
  6. package/{core/commands/run-tests.md → commands/dev-run-test.md} +61 -13
  7. package/commands/{run-tests.tmpl → dev-run-test.tmpl} +32 -2
  8. package/{core/commands/smoke-test.md → commands/dev-smoke-test.md} +16 -16
  9. package/commands/{smoke-test.tmpl → dev-smoke-test.tmpl} +5 -5
  10. package/commands/fix-bug.md +12 -12
  11. package/commands/generate-bdd.md +38 -13
  12. package/commands/generate-bdd.tmpl +9 -2
  13. package/commands/generate-code.md +85 -15
  14. package/commands/generate-code.tmpl +56 -4
  15. package/commands/generate-design-spec.md +104 -39
  16. package/commands/generate-design-spec.tmpl +93 -28
  17. package/commands/generate-prd.md +11 -11
  18. package/commands/generate-spec-manifest.md +11 -11
  19. package/commands/generate-tech-docs.md +12 -12
  20. package/commands/generate-tech-docs.tmpl +1 -1
  21. package/commands/learn.md +12 -12
  22. package/commands/propose-scenario.md +12 -12
  23. package/commands/propose-scenario.tmpl +1 -1
  24. package/commands/refine-prd.md +165 -16
  25. package/commands/refine-prd.tmpl +16 -5
  26. package/commands/report-bug.md +11 -11
  27. package/commands/review-code.md +13 -13
  28. package/commands/review-code.tmpl +1 -1
  29. package/commands/review-context.md +160 -12
  30. package/commands/review-context.tmpl +11 -1
  31. package/commands/review-tech-docs.md +11 -11
  32. package/commands/setup-ai-first.md +7 -7
  33. package/commands/sync.md +23 -20
  34. package/commands/sync.tmpl +16 -13
  35. package/commands/update-framework.md +7 -7
  36. package/commands/validate-traces.md +56 -37
  37. package/commands/validate-traces.tmpl +45 -26
  38. package/core/FRAMEWORK_VERSION +1 -1
  39. package/core/commands/debug.md +12 -12
  40. package/core/commands/define-product.md +11 -11
  41. package/core/commands/{generate-tests.md → dev-gen-test.md} +47 -15
  42. package/{commands/run-tests.md → core/commands/dev-run-test.md} +61 -13
  43. package/{commands/smoke-test.md → core/commands/dev-smoke-test.md} +16 -16
  44. package/core/commands/fix-bug.md +12 -12
  45. package/core/commands/generate-bdd.md +38 -13
  46. package/core/commands/generate-code.md +85 -15
  47. package/core/commands/generate-design-spec.md +104 -39
  48. package/core/commands/generate-prd.md +11 -11
  49. package/core/commands/generate-spec-manifest.md +11 -11
  50. package/core/commands/generate-tech-docs.md +12 -12
  51. package/core/commands/learn.md +12 -12
  52. package/core/commands/propose-scenario.md +12 -12
  53. package/core/commands/refine-prd.md +165 -16
  54. package/core/commands/report-bug.md +11 -11
  55. package/core/commands/review-code.md +13 -13
  56. package/core/commands/review-context.md +160 -12
  57. package/core/commands/review-tech-docs.md +11 -11
  58. package/core/commands/setup-ai-first.md +7 -7
  59. package/core/commands/sync.md +23 -20
  60. package/core/commands/update-framework.md +7 -7
  61. package/core/commands/validate-traces.md +56 -37
  62. package/core/skills/code/SKILL.md +18 -18
  63. package/core/skills/debug/SKILL.md +26 -26
  64. package/core/skills/design-spec/SKILL.md +11 -11
  65. package/core/skills/discovery/SKILL.md +11 -11
  66. package/core/skills/prd/SKILL.md +14 -14
  67. package/core/skills/setup-ai-first/SKILL.md +7 -7
  68. package/core/skills/spec/SKILL.md +14 -14
  69. package/core/skills/test/SKILL.md +38 -38
  70. package/core/steps/capture-lesson.md +1 -1
  71. package/core/steps/context-loader.md +4 -4
  72. package/core/steps/report-footer.md +7 -7
  73. package/core/steps/review-fanout.md +138 -0
  74. package/core/steps/spawn-agent.md +1 -1
  75. package/core/steps/trace-mirror.md +18 -0
  76. package/core/templates/design-spec.template.md +16 -8
  77. package/package.json +1 -1
  78. package/skills/code/SKILL.md +18 -18
  79. package/skills/debug/SKILL.md +26 -26
  80. package/skills/debug/SKILL.tmpl +1 -1
  81. package/skills/design-spec/SKILL.md +11 -11
  82. package/skills/discovery/SKILL.md +11 -11
  83. package/skills/prd/SKILL.md +14 -14
  84. package/skills/setup-ai-first/SKILL.md +7 -7
  85. package/skills/spec/SKILL.md +14 -14
  86. package/skills/test/SKILL.md +38 -38
  87. package/skills/test/SKILL.tmpl +9 -9
  88. package/steps/capture-lesson.md +1 -1
  89. package/steps/context-loader.md +4 -4
  90. package/steps/report-footer.md +7 -7
  91. package/steps/review-fanout.md +138 -0
  92. package/steps/spawn-agent.md +1 -1
  93. package/steps/trace-mirror.md +18 -0
  94. package/templates/design-spec.template.md +16 -8
@@ -142,13 +142,13 @@ Suggest the logical next command based on workflow phase:
142
142
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
143
143
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
144
144
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
145
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
146
- | /generate-tests | `/run-tests {UC-ID}` |
147
- | /run-tests (passing) | `/review-code {UC-ID}` |
148
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
149
- | /review-code | `/smoke-test {UC-ID}` or create PR |
150
- | /smoke-test | Create PR and link to ticket |
151
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
145
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
146
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
147
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
148
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
149
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
150
+ | /dev-smoke-test | Create PR and link to ticket |
151
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
152
152
  | /fix-bug | Create PR and link to ticket |
153
153
  | /debug | `/fix-bug {ticket-id}` if fix needed |
154
154
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -213,13 +213,13 @@ Suggest the logical next command based on workflow phase:
213
213
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
214
214
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
215
215
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
216
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
217
- | /generate-tests | `/run-tests {UC-ID}` |
218
- | /run-tests (passing) | `/review-code {UC-ID}` |
219
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
220
- | /review-code | `/smoke-test {UC-ID}` or create PR |
221
- | /smoke-test | Create PR and link to ticket |
222
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
216
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
217
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
218
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
219
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
220
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
221
+ | /dev-smoke-test | Create PR and link to ticket |
222
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
223
223
  | /fix-bug | Create PR and link to ticket |
224
224
  | /debug | `/fix-bug {ticket-id}` if fix needed |
225
225
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -350,13 +350,13 @@ Suggest the logical next command based on workflow phase:
350
350
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
351
351
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
352
352
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
353
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
354
- | /generate-tests | `/run-tests {UC-ID}` |
355
- | /run-tests (passing) | `/review-code {UC-ID}` |
356
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
357
- | /review-code | `/smoke-test {UC-ID}` or create PR |
358
- | /smoke-test | Create PR and link to ticket |
359
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
353
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
354
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
355
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
356
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
357
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
358
+ | /dev-smoke-test | Create PR and link to ticket |
359
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
360
360
  | /fix-bug | Create PR and link to ticket |
361
361
  | /debug | `/fix-bug {ticket-id}` if fix needed |
362
362
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -1,14 +1,14 @@
1
1
  ---
2
- description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or smoke-tests live API endpoints on a running service. Trigger when: "/generate-tests", "/run-tests", "/smoke-test", "tạo test", "viết test", "chạy test", "generate tests", "run tests", "test kết quả", "smoke test", "test API", "kiểm tra endpoint đang chạy".
2
+ description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or dev-smoke-tests live API endpoints on a running service. Trigger when: "/dev-gen-test", "/dev-run-test", "/dev-smoke-test", "tạo test", "viết test", "chạy test", "generate tests", "run tests", "test kết quả", "smoke test", "test API", "kiểm tra endpoint đang chạy".
3
3
  ---
4
4
 
5
5
  # Test Skills — Generate, Run & Smoke Test
6
6
 
7
- This skill handles three commands: `/generate-tests`, `/run-tests`, and `/smoke-test`.
7
+ This skill handles three commands: `/dev-gen-test`, `/dev-run-test`, and `/dev-smoke-test`.
8
8
 
9
9
  ---
10
10
 
11
- ## /generate-tests — Generate Unit & Integration Tests
11
+ ## /dev-gen-test — Generate Unit & Integration Tests
12
12
 
13
13
  ### Gate
14
14
 
@@ -212,7 +212,7 @@ src/test/{language}/{package}/
212
212
  ### Output
213
213
 
214
214
  ```
215
- /generate-tests Complete — {UC-ID}:
215
+ /dev-gen-test Complete — {UC-ID}:
216
216
  ✅ service/{Service}Test.{ext} ({M} tests)
217
217
  ✅ facade/{Facade}Test.{ext} ({M} tests)
218
218
  ✅ controller/{Controller}Test.{ext} ({M} tests)
@@ -256,13 +256,13 @@ Suggest the logical next command based on workflow phase:
256
256
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
257
257
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
258
258
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
259
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
260
- | /generate-tests | `/run-tests {UC-ID}` |
261
- | /run-tests (passing) | `/review-code {UC-ID}` |
262
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
263
- | /review-code | `/smoke-test {UC-ID}` or create PR |
264
- | /smoke-test | Create PR and link to ticket |
265
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
259
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
260
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
261
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
262
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
263
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
264
+ | /dev-smoke-test | Create PR and link to ticket |
265
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
266
266
  | /fix-bug | Create PR and link to ticket |
267
267
  | /debug | `/fix-bug {ticket-id}` if fix needed |
268
268
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -282,7 +282,7 @@ Next : {suggested command with example arguments}
282
282
 
283
283
  ---
284
284
 
285
- ## /run-tests — Run Tests & Report Results
285
+ ## /dev-run-test — Run Tests & Report Results
286
286
 
287
287
  ### Gate
288
288
 
@@ -362,7 +362,7 @@ If `services` section is present:
362
362
 
363
363
  **2. Route to service** — if active domain matches a key in `services`:
364
364
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
365
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
365
+ - 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.
366
366
  - Store `active_service` = `services.{domain}.path`
367
367
  - Store `active_service_module` = `services.{domain}.module`
368
368
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -374,7 +374,7 @@ If `services` section is present:
374
374
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
375
375
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
376
376
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
377
- - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
377
+ - 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.)*
378
378
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
379
379
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
380
380
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -405,7 +405,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
405
405
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
406
406
 
407
407
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
408
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
408
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
409
409
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
410
410
 
411
411
  **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).
@@ -498,7 +498,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
498
498
 
499
499
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
500
500
 
501
- 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).
501
+ 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).
502
502
 
503
503
  ---
504
504
 
@@ -603,7 +603,7 @@ Read stack trace and analyze:
603
603
  ### Output
604
604
 
605
605
  ```
606
- /run-tests Report — {service}
606
+ /dev-run-test Report — {service}
607
607
  Run at: {datetime}
608
608
 
609
609
  ## Summary
@@ -657,13 +657,13 @@ Suggest the logical next command based on workflow phase:
657
657
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
658
658
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
659
659
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
660
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
661
- | /generate-tests | `/run-tests {UC-ID}` |
662
- | /run-tests (passing) | `/review-code {UC-ID}` |
663
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
664
- | /review-code | `/smoke-test {UC-ID}` or create PR |
665
- | /smoke-test | Create PR and link to ticket |
666
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
660
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
661
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
662
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
663
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
664
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
665
+ | /dev-smoke-test | Create PR and link to ticket |
666
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
667
667
  | /fix-bug | Create PR and link to ticket |
668
668
  | /debug | `/fix-bug {ticket-id}` if fix needed |
669
669
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -683,10 +683,10 @@ Next : {suggested command with example arguments}
683
683
 
684
684
  ---
685
685
 
686
- ## /smoke-test — Test Live API Endpoints
686
+ ## /dev-smoke-test — Test Live API Endpoints
687
687
 
688
688
  Use when the service is **already running** to verify endpoints work correctly.
689
- Different from `/run-tests` (which runs unit/integration tests without a live server).
689
+ Different from `/dev-run-test` (which runs unit/integration tests without a live server).
690
690
 
691
691
  ### Phase 1 — Find Service URL
692
692
 
@@ -766,7 +766,7 @@ If `services` section is present:
766
766
 
767
767
  **2. Route to service** — if active domain matches a key in `services`:
768
768
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
769
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
769
+ - 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.
770
770
  - Store `active_service` = `services.{domain}.path`
771
771
  - Store `active_service_module` = `services.{domain}.module`
772
772
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -778,7 +778,7 @@ If `services` section is present:
778
778
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
779
779
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
780
780
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
781
- - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
781
+ - 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.)*
782
782
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
783
783
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
784
784
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -809,7 +809,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
809
809
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
810
810
 
811
811
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
812
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
812
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
813
813
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
814
814
 
815
815
  **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).
@@ -902,7 +902,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
902
902
 
903
903
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
904
904
 
905
- 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).
905
+ 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).
906
906
 
907
907
  ---
908
908
 
@@ -1024,7 +1024,7 @@ tail -n 100 {LOG_FILE_PATH}
1024
1024
  ### Output
1025
1025
 
1026
1026
  ```
1027
- /smoke-test Report — {UC-ID}
1027
+ /dev-smoke-test Report — {UC-ID}
1028
1028
  Tested at: {datetime}
1029
1029
  Base URL: http://localhost:{port}
1030
1030
 
@@ -1076,13 +1076,13 @@ Suggest the logical next command based on workflow phase:
1076
1076
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
1077
1077
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
1078
1078
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
1079
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
1080
- | /generate-tests | `/run-tests {UC-ID}` |
1081
- | /run-tests (passing) | `/review-code {UC-ID}` |
1082
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
1083
- | /review-code | `/smoke-test {UC-ID}` or create PR |
1084
- | /smoke-test | Create PR and link to ticket |
1085
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
1079
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
1080
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
1081
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
1082
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
1083
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
1084
+ | /dev-smoke-test | Create PR and link to ticket |
1085
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
1086
1086
  | /fix-bug | Create PR and link to ticket |
1087
1087
  | /debug | `/fix-bug {ticket-id}` if fix needed |
1088
1088
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -1,14 +1,14 @@
1
1
  ---
2
- description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or smoke-tests live API endpoints on a running service. Trigger when: "/generate-tests", "/run-tests", "/smoke-test", "tạo test", "viết test", "chạy test", "generate tests", "run tests", "test kết quả", "smoke test", "test API", "kiểm tra endpoint đang chạy".
2
+ description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or dev-smoke-tests live API endpoints on a running service. Trigger when: "/dev-gen-test", "/dev-run-test", "/dev-smoke-test", "tạo test", "viết test", "chạy test", "generate tests", "run tests", "test kết quả", "smoke test", "test API", "kiểm tra endpoint đang chạy".
3
3
  ---
4
4
 
5
5
  # Test Skills — Generate, Run & Smoke Test
6
6
 
7
- This skill handles three commands: `/generate-tests`, `/run-tests`, and `/smoke-test`.
7
+ This skill handles three commands: `/dev-gen-test`, `/dev-run-test`, and `/dev-smoke-test`.
8
8
 
9
9
  ---
10
10
 
11
- ## /generate-tests — Generate Unit & Integration Tests
11
+ ## /dev-gen-test — Generate Unit & Integration Tests
12
12
 
13
13
  ### Gate
14
14
 
@@ -131,7 +131,7 @@ src/test/{language}/{package}/
131
131
  ### Output
132
132
 
133
133
  ```
134
- /generate-tests Complete — {UC-ID}:
134
+ /dev-gen-test Complete — {UC-ID}:
135
135
  ✅ service/{Service}Test.{ext} ({M} tests)
136
136
  ✅ facade/{Facade}Test.{ext} ({M} tests)
137
137
  ✅ controller/{Controller}Test.{ext} ({M} tests)
@@ -141,7 +141,7 @@ src/test/{language}/{package}/
141
141
 
142
142
  ---
143
143
 
144
- ## /run-tests — Run Tests & Report Results
144
+ ## /dev-run-test — Run Tests & Report Results
145
145
 
146
146
  ### Gate
147
147
 
@@ -190,7 +190,7 @@ Read stack trace and analyze:
190
190
  ### Output
191
191
 
192
192
  ```
193
- /run-tests Report — {service}
193
+ /dev-run-test Report — {service}
194
194
  Run at: {datetime}
195
195
 
196
196
  ## Summary
@@ -210,10 +210,10 @@ Duration: {X}s
210
210
 
211
211
  ---
212
212
 
213
- ## /smoke-test — Test Live API Endpoints
213
+ ## /dev-smoke-test — Test Live API Endpoints
214
214
 
215
215
  Use when the service is **already running** to verify endpoints work correctly.
216
- Different from `/run-tests` (which runs unit/integration tests without a live server).
216
+ Different from `/dev-run-test` (which runs unit/integration tests without a live server).
217
217
 
218
218
  ### Phase 1 — Find Service URL
219
219
 
@@ -279,7 +279,7 @@ tail -n 100 {LOG_FILE_PATH}
279
279
  ### Output
280
280
 
281
281
  ```
282
- /smoke-test Report — {UC-ID}
282
+ /dev-smoke-test Report — {UC-ID}
283
283
  Tested at: {datetime}
284
284
  Base URL: http://localhost:{port}
285
285
 
@@ -54,7 +54,7 @@ If `lessons_path` does not exist, create it with this header first:
54
54
  | code-gen | /generate-code output |
55
55
  | bdd | /generate-bdd output |
56
56
  | tech-docs | /generate-tech-docs output |
57
- | tests | /generate-tests output |
57
+ | tests | /dev-gen-test output |
58
58
  | prd | /generate-prd, /refine-prd output |
59
59
  | general | every command |
60
60
 
@@ -74,7 +74,7 @@ If `services` section is present:
74
74
 
75
75
  **2. Route to service** — if active domain matches a key in `services`:
76
76
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
77
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
77
+ - 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.
78
78
  - Store `active_service` = `services.{domain}.path`
79
79
  - Store `active_service_module` = `services.{domain}.module`
80
80
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -86,7 +86,7 @@ If `services` section is present:
86
86
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
87
87
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
88
88
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
89
- - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
89
+ - 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.)*
90
90
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
91
91
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
92
92
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -117,7 +117,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
117
117
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
118
118
 
119
119
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
120
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
120
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
121
121
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
122
122
 
123
123
  **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).
@@ -210,7 +210,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
210
210
 
211
211
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
212
212
 
213
- 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).
213
+ 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).
214
214
 
215
215
  ---
216
216
 
@@ -36,13 +36,13 @@ Suggest the logical next command based on workflow phase:
36
36
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
37
37
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
38
38
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
39
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
40
- | /generate-tests | `/run-tests {UC-ID}` |
41
- | /run-tests (passing) | `/review-code {UC-ID}` |
42
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
43
- | /review-code | `/smoke-test {UC-ID}` or create PR |
44
- | /smoke-test | Create PR and link to ticket |
45
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
39
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
40
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
41
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
42
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
43
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
44
+ | /dev-smoke-test | Create PR and link to ticket |
45
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
46
46
  | /fix-bug | Create PR and link to ticket |
47
47
  | /debug | `/fix-bug {ticket-id}` if fix needed |
48
48
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -0,0 +1,138 @@
1
+ # Exhaustive Review Fan-Out + Completeness Convergence
2
+
3
+ **Why this exists:** A single-pass review never lists every issue at once — the model
4
+ stops at "enough" findings, so each later review round surfaces *new* problems
5
+ (whack-a-mole). This procedure forces the review to **converge in one command run**:
6
+ fan out across review dimensions in parallel, then loop a completeness critic until a
7
+ round produces nothing new, *before* writing the findings file.
8
+
9
+ The calling command supplies two things:
10
+ - **DIMENSIONS** — the list of review dimensions to fan out over
11
+ (`/refine-prd` → the 4 lenses; `/review-context` → the P-checks or B-checks).
12
+ - **FINDINGS SCHEMA** — the YAML shape each finding must follow (defined in the command).
13
+
14
+ > **Sub-agent mode bypass:** If Gate Step 0 set `_agent_mode: true`, this whole
15
+ > procedure is **skipped** — the orchestrator is already running one dimension/UC per
16
+ > sub-agent. Run the command's checks directly on the scoped section and return findings.
17
+
18
+ ---
19
+
20
+ ## Phase 1 — Parallel dimension scan
21
+
22
+ **How many sub-agents:** the agent *count* is not the completeness lever — breadth is
23
+ fixed by the DIMENSION taxonomy (adding agents to the same dimension just re-finds the
24
+ same issues), and *depth* is owned by the Phase 2 critic loop. Pick the **fan-out
25
+ granularity** by target size, reusing the `steps/spawn-agent.md` thresholds:
26
+
27
+ | Target size | Granularity | Agent count |
28
+ |-------------|-------------|-------------|
29
+ | ≤ 3 UCs **and** ≤ 300 lines | one agent per DIMENSION over the whole file | = number of dimensions |
30
+ | > 3 UCs **or** > 300 lines | one agent per **DIMENSION × UC-scope** (UCs + a PRD-global scope), batched to fit the agent cap | `dimensions × (UCs + 1)`, capped (see below) |
31
+
32
+ The larger granularity keeps each sub-agent's context small and its scan exhaustive on a
33
+ single UC — which is what prevents misses on big PRDs.
34
+
35
+ > **Global (non-UC) sections — required in `DIMENSION × UC` mode.** Per-UC agents only
36
+ > see one UC each, so PRD-wide sections that belong to no UC (scope, success metrics,
37
+ > problem statement, terminology, glossary, changelog) would go unscanned. Whenever you
38
+ > fan out per UC, also include a **"PRD-global"** scope (the non-UC sections, findings get
39
+ > `uc_id: ""`) alongside the UC list. So the natural agent count is `dimensions × (UCs + 1)`.
40
+ > (Not needed in the whole-file mode — there each agent already sees the global sections.)
41
+
42
+ ### Agent cap — batch UCs when the fan-out gets too wide
43
+
44
+ `dimensions × (UCs + 1)` can explode on large PRDs (e.g. 6 checks × (8 UCs + 1) = 54
45
+ agents). Cap the wave at **`AGENT_CAP = 12`** agents and batch UC scopes to fit:
46
+
47
+ 1. Build the scope list = `[UC1, UC2, …, UCn, PRD-global]` (length `UCs + 1`).
48
+ 2. Compute scopes-per-agent-bucket: `groups = max(1, floor(AGENT_CAP / dimensions))`.
49
+ - If `groups ≥ UCs + 1` → no batching needed, run one agent per `DIMENSION × scope`.
50
+ - Else split the scope list into `groups` contiguous buckets of roughly equal size
51
+ (keep `PRD-global` in its own bucket if it fits; otherwise append it to the last
52
+ bucket). Each agent then handles **one DIMENSION over one bucket of UCs**.
53
+ 3. Resulting wave size = `dimensions × groups ≤ AGENT_CAP`.
54
+
55
+ A batched agent reviews several UCs at once — still scoped far tighter than the whole
56
+ file, so coverage stays high. `AGENT_CAP` is the only knob; raise it if the host allows
57
+ more concurrency, lower it to save tokens. Whole-file mode (≤ 3 UCs) never hits the cap.
58
+
59
+ Spawn the chosen sub-agents using the Agent tool (send them in a single message so they
60
+ run concurrently). Each sub-agent gets a **fresh context window** and scans its scope
61
+ through its **one** dimension only — deeper coverage than one session juggling every
62
+ dimension at once (avoids lost-in-the-middle).
63
+
64
+ Sub-agent prompt template (fill the braces):
65
+
66
+ ```
67
+ You are a {DIMENSION_NAME} reviewer. Read the full target file at {target_file}.
68
+ Scope: review ONLY through the {DIMENSION_NAME} lens/check — {DIMENSION_DESCRIPTION}.
69
+ Be exhaustive: scan every section, every UC, every AC/BR/scenario. Do not stop early.
70
+ Project context (terminology, entities, architecture):
71
+ {slim_context — banned terms, canonical entities, layer order, domains}
72
+
73
+ Return a JSON array of findings, each:
74
+ { "dimension": "{DIMENSION_NAME}", "severity": "critical|major|minor",
75
+ "section": "...", "uc_id": "...", "quote": "<verbatim ≤120 chars>",
76
+ "finding": "...", "suggestion": "...", "auto_fixable": true|false }
77
+ Return [] if this dimension is clean. Return ONLY the JSON array.
78
+ ```
79
+
80
+ Collect every sub-agent's array into one consolidated list `ALL_FINDINGS`.
81
+
82
+ ---
83
+
84
+ ## Phase 2 — Completeness-critic convergence loop
85
+
86
+ This is the anti-whack-a-mole step. Repeat until **two consecutive rounds add zero new
87
+ findings**, or a hard cap of **3 rounds**, whichever comes first:
88
+
89
+ 1. Spawn one **completeness-critic** sub-agent with the Agent tool. Give it:
90
+ - the full target file (`{target_file}`),
91
+ - the current `ALL_FINDINGS` list (so it knows what is already captured),
92
+ - the same slim context.
93
+ Prompt it:
94
+ ```
95
+ Here is a document and a list of issues already found. Read the WHOLE document.
96
+ List ONLY real, additional issues NOT already in the list — gaps, ambiguities,
97
+ contradictions, missing edge/negative paths, coverage holes, terminology drift,
98
+ structural omissions, and any issue that a fix to an existing finding would expose.
99
+ Do NOT repeat anything already listed. Return the same finding JSON shape, or [] if
100
+ nothing new.
101
+ ```
102
+ 2. Append any genuinely new findings (not already in `ALL_FINDINGS`) to the list.
103
+ 3. If this round returned 0 new → increment the dry-round counter; else reset it to 0.
104
+ 4. Stop when dry-round counter reaches 2, or after 3 rounds total.
105
+
106
+ Record `convergence_rounds` (how many critic rounds ran) for the report.
107
+
108
+ ---
109
+
110
+ ## Phase 3 — Dedup, resolve conflicts, merge
111
+
112
+ Sub-agents run **blind to each other** (independence = diverse coverage). They never
113
+ talk or reconcile among themselves — all duplicate/conflict resolution happens **here in
114
+ the orchestrator**, where the full set is visible.
115
+
116
+ 1. **Deduplicate** `ALL_FINDINGS`: two findings are duplicates if they target the same
117
+ `section` + `uc_id` and describe the same underlying issue. Keep the one with the
118
+ richer `suggestion`; if they differ on severity, keep the **higher** severity.
119
+ 2. **Resolve conflicts** — group remaining findings by `section` + `uc_id` and check for
120
+ contradictions (two findings whose `suggestion`s cannot both be applied, or that
121
+ propose opposite fixes for the same spot):
122
+ - If the two suggestions can be **merged** into one coherent fix → merge them into a
123
+ single finding.
124
+ - If they are **mutually exclusive** → emit **one** finding that states both options
125
+ and set `auto_fixable: false` with `status: "needs_discussion"` (PRD) /
126
+ `status: "pending"` (review) so a human picks — never silently drop one side.
127
+ - If a finding is **invalidated** by another (e.g. a structural finding says a section
128
+ is missing, but another quotes content from it) → drop the invalid one.
129
+ 3. **Sort** by severity (critical → major → minor), then by `section` order in the file.
130
+ 4. **Assign stable IDs** `F001, F002, …` in that sorted order.
131
+ 5. Map each finding's `dimension` into the command's schema field
132
+ (`lens` for `/refine-prd`; `check_id` for `/review-context`).
133
+ 6. Write the **single** findings file in the FINDINGS SCHEMA the command defines.
134
+
135
+ In the command's final report, add one line:
136
+ ```
137
+ Convergence: {convergence_rounds} critic round(s) — findings file is complete; re-running should surface 0 new issues.
138
+ ```
@@ -80,7 +80,7 @@ Build payload and invoke Agent tool for each UC:
80
80
  }
81
81
  ```
82
82
 
83
- > **Command scope**: Only `/generate-bdd` initiates orchestration mode. `/generate-code` and `/generate-tests` can run as sub-agents (they respect `_agent_mode: true` from Gate Step 0), but they do not spawn further sub-agents — their scope is already a single UC.
83
+ > **Command scope**: Only `/generate-bdd` initiates orchestration mode. `/generate-code` and `/dev-gen-test` can run as sub-agents (they respect `_agent_mode: true` from Gate Step 0), but they do not spawn further sub-agents — their scope is already a single UC.
84
84
 
85
85
  Serialize this JSON and pass as `$ARGUMENTS` when invoking the sub-agent command.
86
86
 
@@ -0,0 +1,18 @@
1
+ # Refresh Living Docs panel mirror *(local, umbrella mode)*
2
+
3
+ *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
4
+ the service `.trace/` IS the panel location, so nothing to mirror.*
5
+
6
+ After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
7
+
8
+ 1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
9
+ 2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
10
+ just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
11
+ (create the dir; overwrite). Use `active_service` for `{service-name}`.
12
+
13
+ This keeps the open workspace's Living Docs panel current **between syncs** — it is a
14
+ **local convenience mirror only**. The *canonical* report in the spec module
15
+ (`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
16
+ `/sync` or `/validate-traces` (those need every service's data, so a single per-UC
17
+ command cannot produce them). For orchestrated commands, do this once in the orchestrator
18
+ after all sub-agents return — not inside each sub-agent.
@@ -14,6 +14,13 @@
14
14
  - ⚠️ TODO → đánh dấu [TODO — chưa implement]
15
15
  - ❌ Chưa có → đánh dấu [NEW — cần confirm với designer]
16
16
 
17
+ FIGMA LINKS (bắt buộc mỗi màn):
18
+ - Mỗi screen PHẢI có link Figma node-level (URL chứa ?node-id=...) — lấy bằng
19
+ right-click frame → "Copy link to selection". Đây là link AI đọc được qua Figma MCP.
20
+ - Link file trần (không có node-id) KHÔNG hợp lệ — AI không định vị được frame.
21
+ - Screen chưa có design → đánh dấu ❌ Missing; spec giữ Status "draft", chặn sign-off
22
+ và /generate-bdd cho tới khi đủ link.
23
+
17
24
  SCREEN STATES (bắt buộc mỗi màn):
18
25
  - Tối thiểu: default, loading, error
19
26
  - Thêm "empty" nếu màn có thể hiển thị trạng thái không có dữ liệu
@@ -34,7 +41,7 @@
34
41
  | **Service** | {active_service} |
35
42
  | **Domain** | {domain} |
36
43
  | **Business PRD** | [{TICKET-ID}](./{TICKET-ID}-slug.md) |
37
- | **Figma** | {figma_url or TBD} |
44
+ | **Figma** | {feature file link} ({linked}/{N} frames linked) |
38
45
  | **Author** | {PO name or "AI-assisted"} |
39
46
  | **Created** | {YYYY-MM-DD} |
40
47
  | **Updated** | {YYYY-MM-DD} |
@@ -43,10 +50,10 @@
43
50
 
44
51
  # 1. Screen Inventory
45
52
 
46
- | # | Screen Name | Entry Point | Figma Frame | Notes |
47
- |---|-------------|-------------|-------------|-------|
48
- | 1 | {Screen 1} | {how user arrives} | [Frame]({figma_url}) | |
49
- | 2 | {Screen 2} | {entry point} | [Frame]({figma_url}) | |
53
+ | # | Screen Name | Entry Point | Figma Frame (node-level link) | Notes |
54
+ |---|-------------|-------------|-------------------------------|-------|
55
+ | 1 | {Screen 1} | {how user arrives} | [Frame]({node-level url}) | |
56
+ | 2 | {Screen 2} | {entry point} | Missing — add node-id link | |
50
57
 
51
58
  ---
52
59
 
@@ -181,9 +188,10 @@
181
188
 
182
189
  ## Figma Summary
183
190
 
184
- | Screen | Figma Frame | Status |
185
- |------------|----------------------|--------------------------------|
186
- | {Screen 1} | [Link]({url}) | ✅ Ready / ⏳ WIP / ❌ Missing |
191
+ | Screen | Figma Frame (node-level) | Link / Fetch Status |
192
+ |------------|--------------------------|--------------------------------|
193
+ | {Screen 1} | [Link]({node-level url}) | ✅ Linked & fetched |
194
+ | {Screen 2} | — | ❌ Missing — no node-id link |
187
195
 
188
196
  ## Design Tokens Referenced
189
197