@edupia-tutor/spec-driven-docs 0.14.0 → 0.14.1

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 (141) hide show
  1. package/commands/debug.md +435 -435
  2. package/commands/debug.tmpl +111 -111
  3. package/commands/define-product.md +330 -327
  4. package/commands/define-product.tmpl +50 -47
  5. package/commands/dev-gen-test.md +364 -364
  6. package/commands/dev-gen-test.tmpl +63 -63
  7. package/commands/dev-run-test.md +375 -375
  8. package/commands/dev-run-test.tmpl +74 -74
  9. package/commands/dev-smoke-test.md +340 -340
  10. package/commands/dev-smoke-test.tmpl +60 -60
  11. package/commands/fix-bug.md +402 -402
  12. package/commands/fix-bug.tmpl +78 -78
  13. package/commands/generate-bdd.md +512 -512
  14. package/commands/generate-bdd.tmpl +211 -211
  15. package/commands/generate-code.md +480 -482
  16. package/commands/generate-code.tmpl +179 -181
  17. package/commands/generate-design-spec.md +495 -495
  18. package/commands/generate-design-spec.tmpl +219 -219
  19. package/commands/generate-prd.md +445 -396
  20. package/commands/generate-prd.tmpl +45 -198
  21. package/commands/generate-spec-manifest.md +337 -337
  22. package/commands/generate-spec-manifest.tmpl +57 -57
  23. package/commands/generate-tech-docs.md +364 -364
  24. package/commands/generate-tech-docs.tmpl +84 -84
  25. package/commands/learn.md +346 -346
  26. package/commands/learn.tmpl +22 -22
  27. package/commands/map-testids.md +321 -321
  28. package/commands/map-testids.tmpl +41 -41
  29. package/commands/propose-scenario.md +334 -334
  30. package/commands/propose-scenario.tmpl +54 -54
  31. package/commands/qc-analyze.md +322 -323
  32. package/commands/qc-analyze.tmpl +42 -43
  33. package/commands/qc-design-test.md +303 -303
  34. package/commands/qc-design-test.tmpl +23 -23
  35. package/commands/qc-plan.md +296 -296
  36. package/commands/qc-plan.tmpl +16 -16
  37. package/commands/qc-report.md +301 -301
  38. package/commands/qc-report.tmpl +21 -21
  39. package/commands/qc-review.md +297 -297
  40. package/commands/qc-review.tmpl +17 -17
  41. package/commands/qc-run-test.md +336 -336
  42. package/commands/qc-run-test.tmpl +35 -35
  43. package/commands/refine-prd.md +426 -428
  44. package/commands/refine-prd.tmpl +61 -61
  45. package/commands/report-bug.md +350 -350
  46. package/commands/report-bug.tmpl +70 -70
  47. package/commands/review-code.md +363 -363
  48. package/commands/review-code.tmpl +39 -39
  49. package/commands/review-context.md +577 -579
  50. package/commands/review-context.tmpl +212 -212
  51. package/commands/review-tech-docs.md +426 -426
  52. package/commands/review-tech-docs.tmpl +146 -146
  53. package/commands/setup-ai-first.md +237 -237
  54. package/commands/setup-ai-first.tmpl +131 -131
  55. package/commands/sync.md +145 -145
  56. package/commands/sync.tmpl +93 -93
  57. package/commands/update-framework.md +88 -88
  58. package/commands/update-framework.tmpl +36 -36
  59. package/commands/validate-traces.md +379 -379
  60. package/commands/validate-traces.tmpl +99 -99
  61. package/core/FRAMEWORK_VERSION +1 -1
  62. package/core/commands/debug.md +435 -435
  63. package/core/commands/define-product.md +330 -327
  64. package/core/commands/dev-gen-test.md +364 -364
  65. package/core/commands/dev-run-test.md +375 -375
  66. package/core/commands/dev-smoke-test.md +340 -340
  67. package/core/commands/fix-bug.md +402 -402
  68. package/core/commands/generate-bdd.md +512 -512
  69. package/core/commands/generate-code.md +480 -482
  70. package/core/commands/generate-design-spec.md +495 -495
  71. package/core/commands/generate-prd.md +445 -396
  72. package/core/commands/generate-spec-manifest.md +337 -337
  73. package/core/commands/generate-tech-docs.md +364 -364
  74. package/core/commands/learn.md +346 -346
  75. package/core/commands/map-testids.md +321 -321
  76. package/core/commands/propose-scenario.md +334 -334
  77. package/core/commands/qc-analyze.md +322 -323
  78. package/core/commands/qc-design-test.md +303 -303
  79. package/core/commands/qc-plan.md +296 -296
  80. package/core/commands/qc-report.md +301 -301
  81. package/core/commands/qc-review.md +297 -297
  82. package/core/commands/qc-run-test.md +336 -336
  83. package/core/commands/refine-prd.md +426 -428
  84. package/core/commands/report-bug.md +350 -350
  85. package/core/commands/review-code.md +363 -363
  86. package/core/commands/review-context.md +577 -579
  87. package/core/commands/review-tech-docs.md +426 -426
  88. package/core/commands/setup-ai-first.md +237 -237
  89. package/core/commands/sync.md +145 -145
  90. package/core/commands/update-framework.md +88 -88
  91. package/core/commands/validate-traces.md +379 -379
  92. package/core/skills/code/SKILL.md +388 -388
  93. package/core/skills/debug/SKILL.md +390 -390
  94. package/core/skills/design-spec/SKILL.md +316 -316
  95. package/core/skills/discovery/SKILL.md +7 -547
  96. package/core/skills/prd/SKILL.md +298 -394
  97. package/core/skills/setup-ai-first/SKILL.md +79 -79
  98. package/core/skills/spec/SKILL.md +176 -176
  99. package/core/skills/test/SKILL.md +602 -602
  100. package/core/steps/capture-lesson.md +44 -44
  101. package/core/steps/context-loader.md +174 -174
  102. package/core/steps/gate.md +54 -54
  103. package/core/steps/report-footer.md +52 -52
  104. package/core/steps/review-fanout.md +85 -87
  105. package/core/steps/spawn-agent.md +45 -45
  106. package/core/steps/trace-mirror.md +21 -21
  107. package/core/templates/architecture.template.md +37 -37
  108. package/core/templates/design-spec.template.md +77 -77
  109. package/core/templates/platform-guide.template.md +47 -47
  110. package/core/templates/prd.template.md +106 -231
  111. package/core/templates/product-definition.template.md +101 -88
  112. package/docs/04-operations/publishing.md +20 -3
  113. package/package.json +1 -1
  114. package/skills/code/SKILL.md +388 -388
  115. package/skills/code/SKILL.tmpl +56 -56
  116. package/skills/debug/SKILL.md +390 -390
  117. package/skills/debug/SKILL.tmpl +60 -60
  118. package/skills/design-spec/SKILL.md +316 -316
  119. package/skills/design-spec/SKILL.tmpl +36 -36
  120. package/skills/discovery/SKILL.md +7 -547
  121. package/skills/discovery/SKILL.tmpl +7 -140
  122. package/skills/prd/SKILL.md +298 -394
  123. package/skills/prd/SKILL.tmpl +40 -151
  124. package/skills/setup-ai-first/SKILL.md +79 -79
  125. package/skills/setup-ai-first/SKILL.tmpl +27 -27
  126. package/skills/spec/SKILL.md +176 -176
  127. package/skills/spec/SKILL.tmpl +18 -18
  128. package/skills/test/SKILL.md +602 -602
  129. package/skills/test/SKILL.tmpl +44 -44
  130. package/steps/capture-lesson.md +44 -44
  131. package/steps/context-loader.md +174 -174
  132. package/steps/gate.md +54 -54
  133. package/steps/report-footer.md +52 -52
  134. package/steps/review-fanout.md +85 -87
  135. package/steps/spawn-agent.md +45 -45
  136. package/steps/trace-mirror.md +21 -21
  137. package/templates/architecture.template.md +37 -37
  138. package/templates/design-spec.template.md +77 -77
  139. package/templates/platform-guide.template.md +47 -47
  140. package/templates/prd.template.md +106 -231
  141. package/templates/product-definition.template.md +101 -88
package/steps/gate.md CHANGED
@@ -1,87 +1,87 @@
1
- # Gate — Universal Entry Procedure
1
+ # Gate — Quy trình vào chuẩn cho mọi lệnh
2
2
 
3
- Every command must execute this gate before proceeding with its specific logic.
3
+ Mọi lệnh PHẢI chạy gate này trước khi thực thi phần logic riêng của nó.
4
4
 
5
- ## Step 0 — Sub-Agent Mode Check
5
+ ## Bước 0 — Kiểm tra chế độ Sub-Agent
6
6
 
7
- Before anything else, check if `$ARGUMENTS` is a JSON payload from an orchestrator:
7
+ Trước tiên, kiểm tra xem `$ARGUMENTS` phải payload JSON từ một orchestrator hay không:
8
8
 
9
- 1. Attempt to parse `$ARGUMENTS` as JSON.
10
- 2. If it parses successfully **and** contains `"_agent_mode": true`:
11
- - **Skip Steps 1, 2, and 3 of this Gate entirely.**
12
- - Set target file = `payload.target_file`
13
- - Set loaded context = `payload.context` (do NOT run context-loader.md)
14
- - Set UC scope = `payload.uc_id` (process only this UC)
15
- - Set line range = `payload.uc_section` (read only that PRD section)
16
- - Proceed directly to the command-specific logic.
17
- 3. If `$ARGUMENTS` is not JSON or `_agent_mode` is absent continue to Step 1 (normal mode).
9
+ 1. Thử parse `$ARGUMENTS` dưới dạng JSON.
10
+ 2. Nếu parse thành công **và** chứa `"_agent_mode": true`:
11
+ - **Bỏ qua hoàn toàn Bước 1, 2 3 của Gate này.**
12
+ - Đặt target file = `payload.target_file`
13
+ - Đặt loaded context = `payload.context` (KHÔNG chạy context-loader.md)
14
+ - Đặt phạm vi UC = `payload.uc_id` (chỉ xử UC này)
15
+ - Đặt line range = `payload.uc_section` (chỉ đọc đúng section đó của PRD)
16
+ - Đi thẳng tới phần logic riêng của lệnh.
17
+ 3. Nếu `$ARGUMENTS` không phải JSON hoặc không có `_agent_mode` tiếp tục sang Bước 1 (chế độ thường).
18
18
 
19
- ## Step 0-B — Model Check
19
+ ## Bước 0-B — Kiểm tra Model
20
20
 
21
- *Skip this step if `_agent_mode: true` (sub-agent — orchestrator already validated).*
21
+ *Bỏ qua bước này nếu `_agent_mode: true` (sub-agent — orchestrator đã kiểm tra rồi).*
22
22
 
23
- Complex generation and review commands require strong reasoning.
24
- Using a smaller model risks missed edge cases, incomplete spec analysis, and architecture violations.
23
+ Các lệnh sinh nội dung và review phức tạp đòi hỏi khả năng suy luận mạnh.
24
+ Dùng model nhỏ hơn sẽ rủi ro: bỏ sót edge case, phân tích spec thiếu sót, vi phạm kiến trúc.
25
25
 
26
- Display and wait for response:
26
+ Hiển thị chờ phản hồi:
27
27
 
28
28
  ```
29
29
  ⚙️ MODEL CHECK
30
30
  ──────────────────────────────────────────────────────────────────
31
- Recommended : claude-opus-4 (or latest Opus model)
32
- Why needed : Spec analysis, architecture review, code generation
33
- require deep reasoning. Smaller models miss edge cases.
31
+ Recommended : claude-opus-4 (hoặc model Opus mới nhất)
32
+ Why needed : Phân tích spec, review kiến trúc, sinh code đòi hỏi
33
+ suy luận sâu. Model nhỏ hơn dễ bỏ sót edge case.
34
34
 
35
- To switch in Claude Code:
36
- • Settings → Model → select "claude-opus"
37
- or: /model → choose claude-opus
35
+ Cách đổi trong Claude Code:
36
+ • Settings → Model → chọn "claude-opus"
37
+ hoặc: /model → chọn claude-opus
38
38
 
39
- Running on claude-opus?
40
- Y — yes, on claude-opus → proceed
41
- S — skip check (I accept lower quality risk with current model)
39
+ Đang chạy claude-opus?
40
+ Y — đúng, đang dùng claude-opus → tiếp tục
41
+ S — bỏ qua kiểm tra (tôi chấp nhận rủi ro chất lượng thấp hơn với model hiện tại)
42
42
  ──────────────────────────────────────────────────────────────────
43
43
  ```
44
44
 
45
- - "Y" → proceed to Step 1.
46
- - "S" → proceed to Step 1 (user accepts risk, add ⚠️ to final report).
47
- - "N" or anything else → **STOP.** Output: "Please switch to claude-opus, then re-run this command."
45
+ - "Y" → tiếp tục sang Bước 1.
46
+ - "S" → tiếp tục sang Bước 1 (người dùng chấp nhận rủi ro, thêm ⚠️ vào report cuối).
47
+ - "N" hoặc bất kỳ giá trị nào khác → **DỪNG.** Xuất: "Vui lòng chuyển sang claude-opus rồi chạy lại lệnh này."
48
48
 
49
- ## Step 1 — Resolve Target File
49
+ ## Bước 1 — Xác định Target File
50
50
 
51
- 1. If `$ARGUMENTS` is provided and points to an existing file → use it directly as the target.
52
- 2. If `$ARGUMENTS` is a **bare UC-ID / ticket ID / partial name** (no path) → resolve it to a file by globbing the feature-package layout. The `{prd-slug}` is **not known yet**, so use a `*` wildcard for that segment, and a recursive `**` under `bdd/` so the platform subfolders (`bdd/web/`, `bdd/app/`, `bdd/system/`) are all covered:
53
- - **BDD commands** (target is a `.feature`): `{specs_dir}/{domain}/*/bdd/**/{UC-ID}*.feature` — or `{specs_dir}/*/*/bdd/**/{UC-ID}*.feature` if the domain is also unknown. If a platform/scope is implied by the command (e.g. a system tech-doc needs the `system/` BDD), prefer the match under that platform subfolder.
54
- - **PRD commands** (target is `prd.md`): `{specs_dir}/{domain}/*/prd.md` (match the feature folder whose id corresponds), else `{specs_dir}/*/*/prd.md`.
55
- - **tech-docs commands**: `{specs_dir}/{domain}/*/tech-docs/{UC-ID}*-tech-design*.md`.
56
- - **design-spec commands**: `{specs_dir}/{domain}/*/design-spec/{TICKET-ID}*.md`.
51
+ 1. Nếu `$ARGUMENTS` được cung cấp trỏ tới một file tồn tại dùng trực tiếp làm target.
52
+ 2. Nếu `$ARGUMENTS` một **UC-ID / ticket ID / tên rút gọn** (không path) → phân giải thành file bằng cách glob theo bố cục feature-package. `{prd-slug}` lúc này **chưa biết**, nên dùng wildcard `*` cho segment đó, `**` đệ quy dưới `bdd/` để phủ hết các thư mục con theo platform (`bdd/web/`, `bdd/app/`, `bdd/system/`):
53
+ - **Lệnh BDD** (target `.feature`): `{specs_dir}/{domain}/*/bdd/**/{UC-ID}*.feature` — hoặc `{specs_dir}/*/*/bdd/**/{UC-ID}*.feature` nếu domain cũng chưa biết. Nếu lệnh ngụ ý một platform/scope cụ thể (vd: system tech-doc cần BDD `system/`), ưu tiên kết quả trong thư mục con platform đó.
54
+ - **Lệnh PRD** (target `prd.md`): `{specs_dir}/{domain}/*/prd.md` (khớp feature folder id tương ứng), nếu không thì `{specs_dir}/*/*/prd.md`.
55
+ - **Lệnh tech-docs**: `{specs_dir}/{domain}/*/tech-docs/{UC-ID}*-tech-design*.md`.
56
+ - **Lệnh design-spec**: `{specs_dir}/{domain}/*/design-spec/{TICKET-ID}*.md`.
57
57
 
58
- Once a file matches: set it as the target **and** record `domain` + `prd_slug` from its path (per the extraction rule in `context-loader.md` Step 1 — `prd_slug` = first segment after `{specs_dir}/{domain}/`). Every path the command later reads or writes (sibling BDD/tech-docs/design-spec/trace) uses **that resolved `prd_slug`**, so all artifacts stay in one feature package. If several files match (e.g. multiple platforms), pick per the command's platform/scope or list them and ask.
59
- 3. If `$ARGUMENTS` is empty or no match found:
60
- - List files in the relevant directory for this command (e.g., `specs/*/*/prd.md` for PRD commands, `specs/*/*/bdd/**/*.feature` for BDD commands).
61
- - Present the list to the user and ask: "Which file do you want to work with? (Enter number or filename)"
62
- - Wait for user selection before continuing.
58
+ Khi một file khớp: đặt làm target **và** ghi lại `domain` + `prd_slug` từ path của nó (theo quy tắc trích xuất trong `context-loader.md` Bước 1 — `prd_slug` = segment đầu tiên sau `{specs_dir}/{domain}/`). Mọi path lệnh đọc/ghi về sau (BDD/tech-docs/design-spec/trace cùng cấp) đều dùng **`prd_slug` đã phân giải đó**, nên tất cả artifact nằm chung một feature package. Nếu nhiều file khớp (vd: nhiều platform), chọn theo platform/scope của lệnh hoặc liệt kê ra và hỏi.
59
+ 3. Nếu `$ARGUMENTS` rỗng hoặc không tìm thấy file khớp:
60
+ - Liệt các file trong thư mục liên quan của lệnh này (vd: `specs/*/*/prd.md` cho lệnh PRD, `specs/*/*/bdd/**/*.feature` cho lệnh BDD).
61
+ - Hiển thị danh sách cho người dùng và hỏi: "Bạn muốn làm việc với file nào? (Nhập số thứ tự hoặc tên file)"
62
+ - Chờ người dùng chọn rồi mới tiếp tục.
63
63
 
64
- ## Step 2 — Execute Context Loader
64
+ ## Bước 2 — Chạy Context Loader
65
65
 
66
- Load all project context by following the procedure in `steps/context-loader.md`.
67
- Store all loaded context in memory for use throughout this command session.
66
+ Nạp toàn bộ context của dự án bằng cách làm theo quy trình trong `steps/context-loader.md`.
67
+ Lưu toàn bộ context đã nạp vào bộ nhớ để dùng xuyên suốt phiên làm việc của lệnh.
68
68
 
69
- ## Step 3 — CHECKPOINT
69
+ ## Bước 3 — CHECKPOINT
70
70
 
71
- After completing Steps 1 and 2, display a summary and wait for confirmation:
71
+ Sau khi hoàn thành Bước 1 2, hiển thị bản tóm tắt chờ xác nhận:
72
72
 
73
73
  ```
74
74
  CHECKPOINT
75
75
  -----------
76
76
  Target : {resolved file path}
77
- Project : {project.name from project-context.yaml}
77
+ Project : {project.name từ project-context.yaml}
78
78
  Tech stack : {language} / {framework}
79
- Module : {module if set, else "not configured"}
80
- Domains : {comma-separated domain list}
79
+ Module : {module nếu có, else "not configured"}
80
+ Domains : {danh sách domain, ngăn cách bởi dấu phẩy}
81
81
 
82
- Proceed? (Y/N)
82
+ Tiếp tục? (Y/N)
83
83
  ```
84
84
 
85
- Wait for explicit "Y" or "N" from the user before continuing.
86
- - "Y" → proceed to the command-specific steps below.
87
- - "N" → stop and ask what the user wants to change.
85
+ Chờ người dùng trả lời rõ ràng "Y" hoặc "N" rồi mới tiếp tục.
86
+ - "Y" → tiếp tục sang các bước riêng của lệnh bên dưới.
87
+ - "N" → dừng lại hỏi người dùng muốn thay đổi gì.
@@ -1,35 +1,35 @@
1
- # Report Footer — Standard Command Output Format
1
+ # Report Footer — Định dạng output chuẩn cho mọi lệnh
2
2
 
3
- Every command report must end with this standard footer section.
3
+ Mọi report của lệnh phải kết thúc bằng section footer chuẩn này.
4
4
 
5
5
  ## Status Badge
6
6
 
7
- Choose one based on outcome:
8
- - `✅ Complete` — all steps succeeded, no issues found
9
- - `❌ Failed` — command could not complete due to a blocking error
10
- - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
7
+ Chọn một theo kết quả:
8
+ - `✅ Complete` — mọi bước thành công, không vấn đề
9
+ - `❌ Failed` — lệnh không hoàn thành được do lỗi chặn
10
+ - `⚠️ Warnings` — hoàn thành nhưng vấn đề không chặn, nên review lại
11
11
 
12
12
  ## Output Artifacts
13
13
 
14
- List every file created or modified by this command:
14
+ Liệt mọi file được tạo hoặc sửa bởi lệnh này:
15
15
  ```
16
16
  Output Artifacts:
17
- {created|updated} {file-path} ({brief description})
18
- {created|updated} {file-path} ({brief description})
17
+ {created|updated} {file-path} ({ tả ngắn})
18
+ {created|updated} {file-path} ({ tả ngắn})
19
19
  ```
20
20
 
21
- If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
21
+ Nếu không ghi file nào (vd: lệnh review hoặc phân tích) → ghi `Output Artifacts: none (read-only)`.
22
22
 
23
23
  ## Pipeline Position
24
24
 
25
- Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
26
- so the user always sees where this command sits in the end-to-end flow:
25
+ In một đồ pipeline một dòng, đánh dấu phase của lệnh HIỆN TẠI bằng `◀ bạn ở đây`,
26
+ để người dùng luôn thấy lệnh này nằm đâu trong luồng end-to-end:
27
27
 
28
28
  ```
29
29
  Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
30
30
  ```
31
31
 
32
- Find the current command in this phase legend and mark **its** phase in the map above:
32
+ Tìm lệnh hiện tại trong bảng phase dưới đây đánh dấu **phase của nó** trong sơ đồ trên:
33
33
 
34
34
  | Phase | Commands |
35
35
  |-------|----------|
@@ -43,58 +43,58 @@ Find the current command in this phase legend and mark **its** phase in the map
43
43
  | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
44
44
  | Trace Audit | `/validate-traces` |
45
45
 
46
- For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
46
+ Với **lệnh review**, thêm vòng review 3 bước đánh dấu bước hiện tại, vd:
47
47
  `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
48
48
 
49
- **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
50
- `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline
51
- **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
49
+ **Lệnh xuyên suốt** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
50
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) nằm ngoài pipeline tuyến tính
51
+ **bỏ hẳn dòng Pipeline** cho các lệnh này (đừng cố nhét chúng vào đồ).
52
52
 
53
- ## Next Command Suggestion
53
+ ## Gợi ý lệnh tiếp theo
54
54
 
55
- Suggest the logical next command based on workflow phase:
55
+ Gợi ý lệnh kế tiếp hợp theo phase của workflow:
56
56
 
57
- | Current command | Suggest next |
57
+ | Lệnh hiện tại | Gợi ý lệnh tiếp theo |
58
58
  |-------------------------|-----------------------------------------------|
59
- | /setup-ai-first | `/define-product` to start your first feature |
59
+ | /setup-ai-first | `/define-product` để bắt đầu feature đầu tiên |
60
60
  | /define-product | `/generate-prd {product-definition-file}` |
61
- | /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
62
- | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
63
- | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
64
- | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
65
- | /generate-bdd | `/review-context {feature-file}` to verify coverage |
66
- | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
67
- | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
61
+ | /generate-prd | `/refine-prd {prd-file}` rồi `/review-context {prd-file}` |
62
+ | /refine-prd | Mở Review Board → cập nhật PRD → `/review-context {prd-file}` |
63
+ | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (rồi BDD sau khi sign-off); BE: `/generate-bdd {prd-file}` trực tiếp; sửa PRD nếu NEEDS_FIX |
64
+ | /generate-design-spec | Designer review → xác nhận link Figma → PO + Designer sign-off → `/generate-bdd {prd-file}` |
65
+ | /generate-bdd | `/review-context {feature-file}` để kiểm tra độ phủ |
66
+ | /review-context (BDD) | `/generate-tech-docs {UC-ID}` nếu APPROVED; sinh lại nếu NEEDS_FIX |
67
+ | /qc-analyze | `/qc-plan {UC-ID}` (xử các gap blocker 🔴 trước) |
68
68
  | /qc-plan | `/qc-design-test {UC-ID}` |
69
- | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
70
- | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
71
- | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
72
- | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
73
- | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
69
+ | /qc-design-test | `/qc-review {UC-ID}` (review test-case) |
70
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` nếu APPROVED; sửa TC nếu NEEDS_FIX |
71
+ | /qc-run-test | `/qc-report {UC-ID}` rồi `/qc-review {UC-ID}` (review script) |
72
+ | /qc-review (script) | `/qc-report {UC-ID}` rồi tạo PR nếu APPROVED |
73
+ | /qc-report | `/validate-traces {UC-ID}` để làm mới Living Docs (qc_status) |
74
74
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
75
- | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
76
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
75
+ | /review-tech-docs | `/generate-code {feature-file}` nếu APPROVED; sửa doc nếu NEEDS_FIX |
76
+ | /generate-code | Lần gen đầu → `/review-code {UC-ID}`; gen lại → `/dev-gen-test {UC-ID}` |
77
77
  | /dev-gen-test | `/dev-run-test {UC-ID}` |
78
78
  | /dev-run-test (passing) | `/review-code {UC-ID}` |
79
- | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
80
- | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
81
- | /dev-smoke-test | Create PR and link to ticket |
82
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
83
- | /fix-bug | Create PR and link to ticket |
84
- | /debug | `/fix-bug {ticket-id}` if fix needed |
85
- | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
86
- | /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
87
- | /learn | Continue working — lesson applies on next command |
88
- | /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
89
- | /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
90
-
91
- Format the footer as:
79
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` hoặc `/debug {error}` |
80
+ | /review-code | `/dev-smoke-test {UC-ID}` hoặc tạo PR |
81
+ | /dev-smoke-test | Tạo PR link tới ticket |
82
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; tất cả OK → tạo PR |
83
+ | /fix-bug | Tạo PR link tới ticket |
84
+ | /debug | `/fix-bug {ticket-id}` nếu cần sửa |
85
+ | /report-bug | Gửi cho dev (`/fix-bug {BUG-ID}`); nếu thiếu coverage → `/propose-scenario {UC-ID}` |
86
+ | /propose-scenario | Báo PO/Dev review proposal trong `feedback/bdd-proposals/` |
87
+ | /learn | Tiếp tục làm việc — lesson áp dụng lệnh kế tiếp |
88
+ | /sync | `/validate-traces` để xem độ phủ đầy đủ; xử lý mọi `📥 tester feedback` được nêu |
89
+ | /update-framework | Review `git diff .agent/`, commit; `/sync` để đồng bộ nội dung dự án |
90
+
91
+ Định dạng footer như sau:
92
92
  ```
93
93
  ---
94
94
  Status : {badge}
95
- {Output Artifacts block}
95
+ {khối Output Artifacts}
96
96
  Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
97
- (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
98
- Next : {suggested command with example arguments}
97
+ (lệnh review) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
98
+ Next : {lệnh gợi ý kèm ví dụ tham số}
99
99
  ```
100
- *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
100
+ *(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
@@ -1,67 +1,67 @@
1
- # Exhaustive Review Fan-Out + Completeness Convergence
1
+ # Review Fan-Out toàn diện + Hội tụ về độ đầy đủ
2
2
 
3
- **Why this exists:** A single-pass review never lists every issue at oncethe 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.
3
+ ** sao có cái này:** Một lượt review đơn không bao giờ liệt hết mọi vấn đề cùng lúc — model
4
+ dừng mức "đủ" findings, nên mỗi vòng review sau lại lòi ra vấn đề *mới*
5
+ (đập chuột chũi). Quy trình này ép review **hội tụ trong một lần chạy lệnh**:
6
+ fan out song song theo các chiều review, rồi lặp một critic độ-đầy-đủ cho tới khi một
7
+ vòng không sinh thêm gì mới, *trước khi* ghi file findings.
8
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).
9
+ Lệnh gọi cung cấp hai thứ:
10
+ - **DIMENSIONS** — danh sách các chiều review để fan out
11
+ (`/refine-prd` → 4 lăng kính; `/review-context` → các P-check hoặc B-check).
12
+ - **FINDINGS SCHEMA** — dạng YAML mỗi finding phải theo (định nghĩa trong lệnh).
13
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.
14
+ > **Bỏ qua ở chế độ sub-agent:** Nếu Gate Bước 0 đã set `_agent_mode: true`, toàn bộ
15
+ > quy trình này bị **bỏ qua** — orchestrator đã chạy sẵn một dimension/UC cho mỗi
16
+ > sub-agent. Chạy các check của lệnh trực tiếp trên section đã giới hạn và trả về findings.
17
17
 
18
18
  ---
19
19
 
20
- ## Phase 1 — Parallel dimension scan
20
+ ## Phase 1 — Quét dimension song song
21
21
 
22
- **How many sub-agents:** the agent *count* is not the completeness leverbreadth 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:
22
+ **Bao nhiêu sub-agent:** *số lượng* agent không phải đòn bẩy độ đầy đủ bề rộng được
23
+ cố định bởi taxonomy DIMENSION (thêm agent vào cùng một dimension chỉ tìm lại cùng vấn đề),
24
+ còn *độ sâu* thuộc về vòng lặp critic ở Phase 2. Chọn **độ mịn fan-out**
25
+ theo kích thước target, tái dùng ngưỡng của `steps/spawn-agent.md`:
26
26
 
27
- | Target size | Granularity | Agent count |
27
+ | Kích thước target | Độ mịn | Số agent |
28
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) |
29
+ | ≤ 3 UC **và** ≤ 300 dòng | một agent cho mỗi DIMENSION trên cả file | = số dimension |
30
+ | > 3 UC **hoặc** > 300 dòng | một agent cho mỗi **DIMENSION × phạm vi UC** (các UC + một phạm vi PRD-global), gom batch để vừa giới hạn agent | `dimensions × (UCs + 1)`, cap (xem dưới) |
31
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.
32
+ Độ mịn lớn hơn giữ context của mỗi sub-agent nhỏ quét vét cạn trên một
33
+ UC duy nhất chính điều ngăn bỏ sót trên các PRD lớn.
34
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.)
35
+ > **Các section global (không thuộc UC) — bắt buộc ở chế độ `DIMENSION × UC`.** Mỗi agent per-UC chỉ
36
+ > thấy một UC, nên các section toàn-PRD không thuộc UC nào (scope, success metric,
37
+ > problem statement, terminology, glossary, changelog) sẽ không được quét. Khi nào
38
+ > fan out theo UC, cũng phải thêm một phạm vi **"PRD-global"** (các section không thuộc UC, finding nhận
39
+ > `uc_id: ""`) bên cạnh danh sách UC. Nên số agent tự nhiên `dimensions × (UCs + 1)`.
40
+ > (Không cần chế độ whole-file — đó mỗi agent đã thấy các section global rồi.)
41
41
 
42
- ### Agent cap — batch UCs when the fan-out gets too wide
42
+ ### Agent cap — gom batch các UC khi fan-out quá rộng
43
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:
44
+ `dimensions × (UCs + 1)` thể bùng nổ trên PRD lớn (vd 6 check × (8 UC + 1) = 54
45
+ agent). Giới hạn mỗi wave **`AGENT_CAP = 12`** agent gom batch các phạm vi UC cho vừa:
46
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`.
47
+ 1. Dựng danh sách phạm vi = `[UC1, UC2, …, UCn, PRD-global]` (độ dài `UCs + 1`).
48
+ 2. Tính số-phạm-vi-mỗi-bucket: `groups = max(1, floor(AGENT_CAP / dimensions))`.
49
+ - Nếu `groups ≥ UCs + 1` → không cần batch, chạy một agent cho mỗi `DIMENSION × scope`.
50
+ - Else chia danh sách phạm vi thành `groups` bucket liền kề kích thước xấp xỉ bằng nhau
51
+ (giữ `PRD-global` bucket riêng nếu vừa; nếu không thì gắn vào bucket cuối).
52
+ Mỗi agent khi đó xử lý **một DIMENSION trên một bucket UC**.
53
+ 3. Kích thước wave kết quả = `dimensions × groups ≤ AGENT_CAP`.
54
54
 
55
- A batched agent reviews several UCs at oncestill 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.
55
+ Một agent đã batch review nhiều UC cùng lúc vẫn giới hạn chặt hơn nhiều so với cả
56
+ file, nên độ phủ vẫn cao. `AGENT_CAP` núm chỉnh duy nhất; tăng nếu host cho phép
57
+ concurrency nhiều hơn, giảm để tiết kiệm token. Chế độ whole-file (≤ 3 UC) không bao giờ chạm cap.
58
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 onlydeeper coverage than one session juggling every
62
- dimension at once (avoids lost-in-the-middle).
59
+ Spawn các sub-agent đã chọn bằng Agent tool (gửi trong một message duy nhất để chúng
60
+ chạy đồng thời). Mỗi sub-agent nhận một **context window mới** quét phạm vi của nó
61
+ chỉ qua **một** dimension duy nhất độ phủ sâu hơn một session phải tung hứng mọi
62
+ dimension cùng lúc (tránh lost-in-the-middle).
63
63
 
64
- Sub-agent prompt template (fill the braces):
64
+ Template prompt cho sub-agent (điền vào các ngoặc):
65
65
 
66
66
  ```
67
67
  You are a {DIMENSION_NAME} reviewer. Read the full target file at {target_file}.
@@ -77,20 +77,20 @@ Return a JSON array of findings, each:
77
77
  Return [] if this dimension is clean. Return ONLY the JSON array.
78
78
  ```
79
79
 
80
- Collect every sub-agent's array into one consolidated list `ALL_FINDINGS`.
80
+ Gom mảng findings của mọi sub-agent vào một danh sách hợp nhất `ALL_FINDINGS`.
81
81
 
82
82
  ---
83
83
 
84
- ## Phase 2 — Completeness-critic convergence loop
84
+ ## Phase 2 — Vòng lặp hội tụ critic độ-đầy-đủ
85
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:
86
+ Đây bước chống đập-chuột-chũi. Lặp cho tới khi **hai vòng liên tiếp thêm 0 finding
87
+ mới**, hoặc tới cap cứng **3 vòng**, cái nào đến trước:
88
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:
89
+ 1. Spawn một sub-agent **completeness-critic** bằng Agent tool. Cho nó:
90
+ - toàn bộ target file (`{target_file}`),
91
+ - danh sách `ALL_FINDINGS` hiện tại (để biết những đã được ghi nhận),
92
+ - cùng context gọn đó.
93
+ Prompt nó:
94
94
  ```
95
95
  Here is a document and a list of issues already found. Read the WHOLE document.
96
96
  List ONLY real, additional issues NOT already in the list — gaps, ambiguities,
@@ -99,40 +99,38 @@ findings**, or a hard cap of **3 rounds**, whichever comes first:
99
99
  Do NOT repeat anything already listed. Return the same finding JSON shape, or [] if
100
100
  nothing new.
101
101
  ```
102
- 2. Append any genuinely new findings (not already in `ALL_FINDINGS`) to the list.
103
- 3. If this round returned 0 newincrement the dry-round counter; else reset it to 0.
104
- 4. Stop when dry-round counter reaches 2, or after 3 rounds total.
102
+ 2. Thêm bất kỳ finding thực sự mới (chưa trong `ALL_FINDINGS`) vào danh sách.
103
+ 3. Nếu vòng này trả 0 finding mới tăng bộ đếm dry-round; ngược lại reset về 0.
104
+ 4. Dừng khi bộ đếm dry-round đạt 2, hoặc sau tổng cộng 3 vòng.
105
105
 
106
- Record `convergence_rounds` (how many critic rounds ran) for the report.
106
+ Ghi lại `convergence_rounds` (số vòng critic đã chạy) cho report.
107
107
 
108
108
  ---
109
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 themselvesall 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:
110
+ ## Phase 3 — Dedup, giải quyết xung đột, merge
111
+
112
+ Các sub-agent chạy ** với nhau** (độc lập = độ phủ đa dạng). Chúng không bao giờ
113
+ trao đổi hay điều hoà giữa chúng mọi xử lý trùng/xung đột diễn ra **ở đây trong
114
+ orchestrator**, nơi thấy toàn bộ tập findings.
115
+
116
+ 1. **Khử trùng lặp** `ALL_FINDINGS`: hai finding trùng nếu cùng nhắm tới cùng
117
+ `section` + `uc_id` tả cùng một vấn đề gốc. Giữ cái `suggestion`
118
+ phong phú hơn; nếu khác nhau về severity, giữ severity **cao hơn**.
119
+ 2. **Giải quyết xung đột** — nhóm các finding còn lại theo `section` + `uc_id` kiểm tra
120
+ mâu thuẫn (hai finding `suggestion` không thể cùng áp dụng, hoặc đề xuất sửa ngược nhau cho cùng một chỗ):
121
+ - Nếu hai đề xuất thể **merge** thành một bản sửa mạch lạc → merge thành một finding duy nhất.
122
+ - Nếu chúng **loại trừ lẫn nhau** phát ra **một** finding nêu cả hai phương án
123
+ set `auto_fixable: false` với `status: "needs_discussion"` (PRD) /
124
+ `status: "pending"` (review) để con người chọn không bao giờ âm thầm bỏ một bên.
125
+ - Nếu một finding bị **vô hiệu** bởi finding khác (vd một finding cấu trúc nói một section
126
+ bị thiếu, nhưng một finding khác trích dẫn nội dung từ chính section đó) → bỏ cái không hợp lệ.
127
+ 3. **Sắp xếp** theo severity (critical major minor), rồi theo thứ tự `section` trong file.
128
+ 4. **Gán ID ổn định** `F001, F002, …` theo thứ tự đã sắp đó.
129
+ 5. Map `dimension` của mỗi finding vào field schema của lệnh
130
+ (`lens` cho `/refine-prd`; `check_id` cho `/review-context`).
131
+ 6. Ghi **một** file findings duy nhất theo FINDINGS SCHEMA mà lệnh định nghĩa.
132
+
133
+ Trong report cuối của lệnh, thêm một dòng:
136
134
  ```
137
- Convergence: {convergence_rounds} critic round(s) — findings file is complete; re-running should surface 0 new issues.
135
+ Convergence: {convergence_rounds} vòng critic — file findings đã đầy đủ; chạy lại sẽ lòi ra 0 vấn đề mới.
138
136
  ```