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

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 (162) hide show
  1. package/bin/index.js +12 -1
  2. package/commands/debug.md +436 -436
  3. package/commands/debug.tmpl +111 -111
  4. package/commands/define-product.md +350 -345
  5. package/commands/define-product.tmpl +69 -64
  6. package/commands/dev-gen-test.md +365 -365
  7. package/commands/dev-gen-test.tmpl +63 -63
  8. package/commands/dev-run-test.md +376 -376
  9. package/commands/dev-run-test.tmpl +74 -74
  10. package/commands/dev-smoke-test.md +341 -341
  11. package/commands/dev-smoke-test.tmpl +60 -60
  12. package/commands/fix-bug.md +403 -403
  13. package/commands/fix-bug.tmpl +78 -78
  14. package/commands/generate-bdd.md +513 -513
  15. package/commands/generate-bdd.tmpl +211 -211
  16. package/commands/generate-code.md +481 -483
  17. package/commands/generate-code.tmpl +179 -181
  18. package/commands/generate-design-spec.md +497 -497
  19. package/commands/generate-design-spec.tmpl +220 -220
  20. package/commands/generate-prd.md +452 -400
  21. package/commands/generate-prd.tmpl +50 -200
  22. package/commands/generate-spec-manifest.md +340 -340
  23. package/commands/generate-spec-manifest.tmpl +59 -59
  24. package/commands/generate-tech-docs.md +365 -365
  25. package/commands/generate-tech-docs.tmpl +84 -84
  26. package/commands/learn.md +347 -347
  27. package/commands/learn.tmpl +22 -22
  28. package/commands/map-testids.md +322 -322
  29. package/commands/map-testids.tmpl +41 -41
  30. package/commands/propose-scenario.md +335 -335
  31. package/commands/propose-scenario.tmpl +54 -54
  32. package/commands/qc-analyze.md +323 -324
  33. package/commands/qc-analyze.tmpl +42 -43
  34. package/commands/qc-design-test.md +304 -304
  35. package/commands/qc-design-test.tmpl +23 -23
  36. package/commands/qc-plan.md +297 -297
  37. package/commands/qc-plan.tmpl +16 -16
  38. package/commands/qc-report.md +302 -302
  39. package/commands/qc-report.tmpl +21 -21
  40. package/commands/qc-review.md +298 -298
  41. package/commands/qc-review.tmpl +17 -17
  42. package/commands/qc-run-test.md +337 -337
  43. package/commands/qc-run-test.tmpl +35 -35
  44. package/commands/refine-prd.md +428 -430
  45. package/commands/refine-prd.tmpl +62 -62
  46. package/commands/report-bug.md +351 -351
  47. package/commands/report-bug.tmpl +70 -70
  48. package/commands/review-code.md +364 -364
  49. package/commands/review-code.tmpl +39 -39
  50. package/commands/review-context.md +578 -580
  51. package/commands/review-context.tmpl +212 -212
  52. package/commands/review-tech-docs.md +427 -427
  53. package/commands/review-tech-docs.tmpl +146 -146
  54. package/commands/setup-ai-first.md +239 -239
  55. package/commands/setup-ai-first.tmpl +133 -133
  56. package/commands/sync.md +145 -145
  57. package/commands/sync.tmpl +93 -93
  58. package/commands/update-framework.md +88 -88
  59. package/commands/update-framework.tmpl +36 -36
  60. package/commands/validate-traces.md +381 -381
  61. package/commands/validate-traces.tmpl +100 -100
  62. package/core/FRAMEWORK_VERSION +1 -1
  63. package/core/commands/debug.md +436 -436
  64. package/core/commands/define-product.md +350 -345
  65. package/core/commands/dev-gen-test.md +365 -365
  66. package/core/commands/dev-run-test.md +376 -376
  67. package/core/commands/dev-smoke-test.md +341 -341
  68. package/core/commands/fix-bug.md +403 -403
  69. package/core/commands/generate-bdd.md +513 -513
  70. package/core/commands/generate-code.md +481 -483
  71. package/core/commands/generate-design-spec.md +497 -497
  72. package/core/commands/generate-prd.md +452 -400
  73. package/core/commands/generate-spec-manifest.md +340 -340
  74. package/core/commands/generate-tech-docs.md +365 -365
  75. package/core/commands/learn.md +347 -347
  76. package/core/commands/map-testids.md +322 -322
  77. package/core/commands/propose-scenario.md +335 -335
  78. package/core/commands/qc-analyze.md +323 -324
  79. package/core/commands/qc-design-test.md +304 -304
  80. package/core/commands/qc-plan.md +297 -297
  81. package/core/commands/qc-report.md +302 -302
  82. package/core/commands/qc-review.md +298 -298
  83. package/core/commands/qc-run-test.md +337 -337
  84. package/core/commands/refine-prd.md +428 -430
  85. package/core/commands/report-bug.md +351 -351
  86. package/core/commands/review-code.md +364 -364
  87. package/core/commands/review-context.md +578 -580
  88. package/core/commands/review-tech-docs.md +427 -427
  89. package/core/commands/setup-ai-first.md +239 -239
  90. package/core/commands/sync.md +145 -145
  91. package/core/commands/update-framework.md +88 -88
  92. package/core/commands/validate-traces.md +381 -381
  93. package/core/skills/code/SKILL.md +389 -389
  94. package/core/skills/debug/SKILL.md +391 -391
  95. package/core/skills/design-spec/SKILL.md +318 -318
  96. package/core/skills/discovery/SKILL.md +7 -547
  97. package/core/skills/prd/SKILL.md +298 -394
  98. package/core/skills/setup-ai-first/SKILL.md +80 -80
  99. package/core/skills/spec/SKILL.md +178 -178
  100. package/core/skills/test/SKILL.md +604 -604
  101. package/core/steps/capture-lesson.md +44 -44
  102. package/core/steps/context-loader.md +175 -175
  103. package/core/steps/gate.md +54 -54
  104. package/core/steps/report-footer.md +52 -52
  105. package/core/steps/review-fanout.md +85 -87
  106. package/core/steps/spawn-agent.md +45 -45
  107. package/core/steps/trace-mirror.md +21 -21
  108. package/core/templates/architecture.template.md +37 -37
  109. package/core/templates/design-spec.template.md +77 -77
  110. package/core/templates/platform-guide.template.md +47 -47
  111. package/core/templates/prd.template.md +107 -232
  112. package/core/templates/product-definition.template.md +101 -88
  113. package/core/templates/project-context.yaml +2 -2
  114. package/docs/01-getting-started/core-concepts.md +1 -1
  115. package/docs/01-getting-started/quickstart.md +7 -7
  116. package/docs/02-guides/developer/bdd-and-trace.md +1 -1
  117. package/docs/02-guides/developer/scenarios.md +5 -5
  118. package/docs/02-guides/product-owner/handoff-checklist.md +1 -1
  119. package/docs/02-guides/product-owner/scenarios.md +23 -23
  120. package/docs/02-guides/tester/bug-reporting.md +2 -2
  121. package/docs/02-guides/tester/reading-specs.md +2 -2
  122. package/docs/02-guides/tester/scenarios.md +1 -1
  123. package/docs/02-guides/tester/spec-manifest.md +3 -3
  124. package/docs/02-guides/tester/workflow.md +1 -1
  125. package/docs/03-concepts/architecture.md +3 -3
  126. package/docs/03-concepts/pipeline.md +3 -3
  127. package/docs/04-operations/publishing.md +20 -3
  128. package/docs/04-operations/sync-and-update.md +5 -5
  129. package/docs/05-reference/command-cheatsheet.md +2 -2
  130. package/docs/05-reference/commands.md +8 -8
  131. package/package.json +1 -1
  132. package/scripts/migrate-specs.js +5 -3
  133. package/scripts/rename-prd-files.js +174 -0
  134. package/skills/code/SKILL.md +389 -389
  135. package/skills/code/SKILL.tmpl +56 -56
  136. package/skills/debug/SKILL.md +391 -391
  137. package/skills/debug/SKILL.tmpl +60 -60
  138. package/skills/design-spec/SKILL.md +318 -318
  139. package/skills/design-spec/SKILL.tmpl +37 -37
  140. package/skills/discovery/SKILL.md +7 -547
  141. package/skills/discovery/SKILL.tmpl +7 -140
  142. package/skills/prd/SKILL.md +298 -394
  143. package/skills/prd/SKILL.tmpl +40 -151
  144. package/skills/setup-ai-first/SKILL.md +80 -80
  145. package/skills/setup-ai-first/SKILL.tmpl +28 -28
  146. package/skills/spec/SKILL.md +178 -178
  147. package/skills/spec/SKILL.tmpl +20 -20
  148. package/skills/test/SKILL.md +604 -604
  149. package/skills/test/SKILL.tmpl +44 -44
  150. package/steps/capture-lesson.md +44 -44
  151. package/steps/context-loader.md +175 -175
  152. package/steps/gate.md +54 -54
  153. package/steps/report-footer.md +52 -52
  154. package/steps/review-fanout.md +85 -87
  155. package/steps/spawn-agent.md +45 -45
  156. package/steps/trace-mirror.md +21 -21
  157. package/templates/architecture.template.md +37 -37
  158. package/templates/design-spec.template.md +77 -77
  159. package/templates/platform-guide.template.md +47 -47
  160. package/templates/prd.template.md +107 -232
  161. package/templates/product-definition.template.md +101 -88
  162. package/templates/project-context.yaml +2 -2
@@ -1,9 +1,9 @@
1
1
  # /sync — Sync & Refresh Umbrella Project
2
2
 
3
- One command for both **first-time setup** and **daily update** of an umbrella repo with git submodules.
4
- Safe to run repeatedlydetects what needs to be done automatically.
3
+ Một lệnh cho cả **setup lần đầu** lẫn **cập nhật hằng ngày** một umbrella repo git submodule.
4
+ An toàn chạy lặp lại tự phát hiện cần làm gì.
5
5
 
6
- **Optional argument:** `/sync [spec-branch]` — branch of the spec submodule to pull (e.g. `/sync develop`). If omitted, the branch is resolved automatically (see Step 0-D).
6
+ **Argument tuỳ chọn:** `/sync [spec-branch]` — branch của spec submodule để pull (vd `/sync develop`). Nếu bỏ, branch được phân giải tự động (xem Step 0-D).
7
7
 
8
8
  ---
9
9
 
@@ -11,54 +11,54 @@ Safe to run repeatedly — detects what needs to be done automatically.
11
11
 
12
12
  **A. Git repo check**
13
13
 
14
- Verify current directory is inside a git repo. If notstop:
14
+ Xác minh thư mục hiện tại nằm trong git repo. Nếu khôngdừng:
15
15
  ```
16
16
  ❌ Not a git repository. Open Claude Code from umbrella root and retry.
17
17
  ```
18
18
 
19
- **B. Read project config early**
19
+ **B. Đọc project config sớm**
20
20
 
21
- Read `.agent/project-context.yaml` before running any git commands. Extract:
22
- - `setup.spec_source` → path of the spec submodule (e.g., `"my-project-specs"`)
23
- - `services` → map of domain → `{path, module, ...}` for each service submodule
21
+ Đọc `.agent/project-context.yaml` trước khi chạy lệnh git nào. Trích:
22
+ - `setup.spec_source` → path của spec submodule (vd `"my-project-specs"`)
23
+ - `services` → map domain → `{path, module, ...}` cho mỗi service submodule
24
24
 
25
- This is needed to differentiate spec vs service submodules in Step 1.
25
+ Cần cái này để phân biệt spec vs service submodule Step 1.
26
26
 
27
- If `.agent/project-context.yaml` does not existwarn and set `spec_source = null`, `services = {}`.
27
+ Nếu `.agent/project-context.yaml` không tồn tạicảnh báo set `spec_source = null`, `services = {}`.
28
28
 
29
29
  **C. Submodule status scan**
30
30
 
31
- Run `git submodule status --recursive` and classify each entry by its first character:
31
+ Chạy `git submodule status --recursive` phân loại mỗi entry theo tự đầu:
32
32
 
33
- | Char | Meaning | Action |
33
+ | Char | Ý nghĩa | Hành động |
34
34
  |------|---------|--------|
35
- | `-` | Not initialized | → **Setup mode** |
36
- | ` ` | Matches recorded pointer | → OK |
37
- | `+` | Ahead of recorded pointer (local advance uncommitted) | → warn per submodule |
35
+ | `-` | Chưa init | → **Setup mode** |
36
+ | ` ` | Khớp pointer đã ghi | → OK |
37
+ | `+` | Ahead của pointer đã ghi (local advance chưa commit) | → cảnh báo từng submodule |
38
38
  | `U` | Merge conflict | → **STOP** |
39
39
 
40
- If **any** entry has `U`:
40
+ Nếu **bất kỳ** entry nào `U`:
41
41
  ```
42
42
  ❌ Merge conflict in submodule: {path}
43
43
  Resolve manually before running /sync:
44
44
  cd {path} && git status
45
45
  ```
46
46
 
47
- If **any** entry has `+` (checked-out commit differs from the recorded pointer):
47
+ Nếu **bất kỳ** entry nào `+` (commit đang checkout khác pointer đã ghi):
48
48
  ```
49
49
  ℹ️ {path} is ahead of the umbrella's recorded pointer.
50
50
  /sync classifies it in Step 1b — if you're on a branch there, it stays untouched.
51
51
  ```
52
- Do not act on `+` here — Step 1b decides the right handling per submodule.
52
+ Đừng xử `+` đây — Step 1b quyết định cách xử đúng cho từng submodule.
53
53
 
54
- Print detected mode: `Mode: Setup (first-time init)` or `Mode: Update (sync latest)`.
54
+ In mode phát hiện: `Mode: Setup (first-time init)` hoặc `Mode: Update (sync latest)`.
55
55
 
56
56
  ---
57
57
 
58
58
  ## Step 1 — Umbrella Pull
59
59
 
60
- Note the current umbrella branch first (this is what `git pull` updates):
61
- `git rev-parse --abbrev-ref HEAD` → store as `umbrella_branch` and display it.
60
+ Ghi branch umbrella hiện tại trước (đây cái `git pull` cập nhật):
61
+ `git rev-parse --abbrev-ref HEAD` → lưu thành `umbrella_branch` hiển thị.
62
62
 
63
63
  ```bash
64
64
  # 1. Pull latest umbrella (includes updated submodule pointer records)
@@ -74,15 +74,15 @@ git submodule sync --recursive
74
74
  git submodule update --init {paths that were '-' in Step 0-C}
75
75
  ```
76
76
 
77
- If `git pull` exits non-zeroprint the error and stop with `❌`.
77
+ Nếu `git pull` exit khác 0 in lỗi dừng với `❌`.
78
78
 
79
79
  ---
80
80
 
81
- ## Step 1b — Classify & Sync Each Submodule
81
+ ## Step 1b — Phân loại & Sync từng Submodule
82
82
 
83
- **The key idea:** `/sync` never imposes a branch on a submodule. It **inspects each submodule's current checkout** and respects it. This is how it knows which submodule you are working in vs which are passive dependencies.
83
+ **Ý tưởng cốt lõi:** `/sync` không bao giờ áp một branch lên submodule. **kiểm tra checkout hiện tại của từng submodule** tôn trọng nó. Đây cách biết submodule nào bạn đang làm vs cái nào dependency thụ động.
84
84
 
85
- For each submodule (use `git submodule foreach` or iterate the paths), read its state:
85
+ Với mỗi submodule (dùng `git submodule foreach` hoặc lặp các path), đọc state:
86
86
 
87
87
  ```bash
88
88
  # Inside each submodule:
@@ -90,30 +90,30 @@ git symbolic-ref --short -q HEAD # → branch name, or empty/non-zero if DETAC
90
90
  git status --porcelain # → non-empty means uncommitted local changes
91
91
  ```
92
92
 
93
- Classify into one of four cases and act accordingly:
93
+ Phân loại vào một trong bốn case xử lý tương ứng:
94
94
 
95
- | Case | Detected state | Action |
95
+ | Case | State phát hiện | Hành động |
96
96
  |------|----------------|--------|
97
- | **Spec submodule** | `path == spec_source` | Advance to `spec_branch` (Step 1c below) |
98
- | **Active (on a branch)** | HEAD is a branch, not detached | **Do NOT checkout.** This is where you (or a teammate) are coding. Just `git -C {path} fetch` and report branch + ahead/behind. Leave the working tree exactly as-is. |
99
- | **Passive (detached, clean)** | Detached HEAD, no local changes | Safe to align to the umbrella's recorded pointer: `git submodule update {path}` |
100
- | **Dirty (uncommitted changes)** | `git status --porcelain` non-empty | **Never touch.** Warn: `⚠️ {path} has uncommitted changes — skipped. Commit or stash before syncing this submodule.` |
97
+ | **Spec submodule** | `path == spec_source` | Advance tới `spec_branch` (Step 1c bên dưới) |
98
+ | **Active (on a branch)** | HEAD một branch, không detached | **KHÔNG checkout.** Đây nơi bạn (hoặc đồng đội) đang code. Chỉ `git -C {path} fetch` report branch + ahead/behind. Để working tree y nguyên. |
99
+ | **Passive (detached, clean)** | Detached HEAD, không có thay đổi local | An toàn align về pointer đã ghi của umbrella: `git submodule update {path}` |
100
+ | **Dirty (uncommitted changes)** | `git status --porcelain` non-empty | **Đừng đụng.** Cảnh báo: `⚠️ {path} has uncommitted changes — skipped. Commit or stash before syncing this submodule.` |
101
101
 
102
- > **Why this matters:** A blanket `git submodule update` checks every submodule out to a **detached HEAD** at the recorded pointer. If you have `feature/FEAT-01` checked out inside `user-service/` and are mid-work, that would silently move you off your branch. Classifying first protects your active work.
102
+ > ** sao quan trọng:** Một `git submodule update` toàn bộ checkout mọi submodule về **detached HEAD** pointer đã ghi. Nếu bạn đang checkout `feature/FEAT-01` trong `user-service/` đang làm dở, cái đó sẽ âm thầm chuyển bạn khỏi branch. Phân loại trước bảo vệ công việc đang làm của bạn.
103
103
 
104
104
  ---
105
105
 
106
- ## Step 1c — Advance Spec Submodule *(only if `spec_source` is configured)*
106
+ ## Step 1c — Advance Spec Submodule *(chỉ khi `spec_source` được cấu hình)*
107
107
 
108
- The spec submodule is the one submodule we deliberately advance to a branch HEAD (PO pushes specs continuously).
108
+ Spec submodule submodule duy nhất ta cố ý advance tới một branch HEAD (PO push spec liên tục).
109
109
 
110
- **Resolve the spec branch** (now that the submodule is initialized), in priority order:
110
+ **Phân giải spec branch** (giờ submodule đã init), theo thứ tự ưu tiên:
111
111
 
112
- 1. **Command argument** — if `$ARGUMENTS` contains a branch name use it (one-off override)
113
- 2. **`.gitmodules` config** — `git config -f .gitmodules --get submodule.{spec_source}.branch`. If set → use it (team's committed default)
114
- 3. **Remote default** — else the spec repo's default branch: `git -C {spec_source} rev-parse --abbrev-ref origin/HEAD` (strip the `origin/` prefix)
112
+ 1. **Command argument** — nếu `$ARGUMENTS` chứa tên branch → dùng (override một lần)
113
+ 2. **`.gitmodules` config** — `git config -f .gitmodules --get submodule.{spec_source}.branch`. Nếu set → dùng (default committed của team)
114
+ 3. **Remote default** — else branch default của spec repo: `git -C {spec_source} rev-parse --abbrev-ref origin/HEAD` (bỏ prefix `origin/`)
115
115
 
116
- Store as `spec_branch` + `spec_branch_source` (argument | .gitmodules | remote-default). If it fell through to remote-default with nothing pinned, add this hint to the output:
116
+ Lưu thành `spec_branch` + `spec_branch_source` (argument | .gitmodules | remote-default). Nếu rơi xuống remote-default không có gì pin, thêm hint này vào output:
117
117
  ```
118
118
  ℹ️ Spec submodule branch not pinned in .gitmodules — using remote default '{spec_branch}'.
119
119
  To pin it for the whole team:
@@ -121,7 +121,7 @@ Store as `spec_branch` + `spec_branch_source` (argument | .gitmodules | remote-d
121
121
  git add .gitmodules && git commit -m "chore: pin spec submodule branch"
122
122
  ```
123
123
 
124
- Then check it is safe: if the spec submodule has uncommitted changeswarn and skip (devs should treat specs as read-only). Otherwise use an **explicit checkout** (not bare `--remote`) so the branch is unambiguous:
124
+ Rồi kiểm tra an toàn: nếu spec submodule thay đổi chưa commit cảnh báo skip (dev nên coi spec read-only). Ngược lại dùng **explicit checkout** (không phải `--remote` trần) để branch ràng:
125
125
 
126
126
  ```bash
127
127
  cd {spec_source}
@@ -131,37 +131,37 @@ git pull origin {spec_branch}
131
131
  cd - # back to umbrella root
132
132
  ```
133
133
 
134
- Print: `Spec submodule {spec_source}: pulled branch '{spec_branch}' (source: {spec_branch_source})`
134
+ In: `Spec submodule {spec_source}: pulled branch '{spec_branch}' (source: {spec_branch_source})`
135
135
 
136
- > **Why not `--remote` for service submodules?** Service submodules are version-locked by the umbrella's recorded pointerthis is intentional so all devs work from the same commit. `--remote` would bypass this lock and create uncommitted pointer drift. The spec submodule is the exception: PO pushes continuously, so we advance it to a branch HEAD — but we do it with an explicit `checkout {spec_branch}` rather than `--remote` so it never silently follows the wrong branch.
136
+ > ** sao không `--remote` cho service submodule?** Service submodule bị version-lock bởi pointer đã ghi của umbrella cố ý để mọi dev làm từ cùng commit. `--remote` sẽ bỏ qua lock này tạo pointer drift chưa commit. Spec submodule ngoại lệ: PO push liên tục, nên ta advance tới branch HEAD — nhưng làm bằng explicit `checkout {spec_branch}` thay `--remote` để không bao giờ âm thầm theo sai branch.
137
137
 
138
- If `git pull` or `git submodule update` exits non-zeroprint the error and stop with `❌`.
138
+ Nếu `git pull` hoặc `git submodule update` exit khác 0 in lỗi dừng với `❌`.
139
139
 
140
- Collect from output:
141
- - Which submodules changed SHA
142
- - Which were already up to date
143
- - The spec submodule's `{old_sha}..{new_sha}` (needed by Step 1d)
140
+ Thu từ output:
141
+ - Submodule nào đổi SHA
142
+ - Cái nào đã up to date
143
+ - `{old_sha}..{new_sha}` của spec submodule (cần cho Step 1d)
144
144
 
145
145
  ---
146
146
 
147
- ## Step 1d — Surface Tester/QC Feedback *(bug reports / scenario proposals / PRD change requests)*
147
+ ## Step 1d — Surface Feedback của Tester/QC *(bug report / scenario proposal / PRD change request)*
148
148
 
149
- Tester & QC `/report-bug`, `/propose-scenario` (incl. Case B PRD change requests) commit feedback into the spec repo. This step tells PO/Dev what arrived in **this** pull, so they are notified through their normal routine. It covers both audiences:
149
+ `/report-bug`, `/propose-scenario` của tester & QC (gồm cả PRD change request Case B) commit feedback vào spec repo. Step này cho PO/Dev biết cái tới trong **lần** pull này, để họ được thông báo qua routine bình thường. phủ cả hai đối tượng:
150
150
 
151
- - **Dev/tester in umbrella** → feedback came in via the spec submodule advance (Step 1c)
152
- - **PO working directly in the spec repo** → feedback came in via the umbrella/current-repo `git pull` (Step 1)
151
+ - **Dev/tester trong umbrella** → feedback tới qua spec submodule advance (Step 1c)
152
+ - **PO làm trực tiếp trong spec repo** → feedback tới qua `git pull` của umbrella/current-repo (Step 1)
153
153
 
154
- Pick the repo + range that pulled the feedback:
155
- - Umbrella with `spec_source` → `REPO={spec_source}`, range = spec submodule `{old_sha}..{new_sha}`
156
- - Otherwise (running inside the spec repo itself) → `REPO=.`, range = the `git pull` `{old_sha}..{new_sha}` from Step 1
154
+ Chọn repo + range đã pull feedback:
155
+ - Umbrella `spec_source` → `REPO={spec_source}`, range = spec submodule `{old_sha}..{new_sha}`
156
+ - Ngược lại (chạy trong chính spec repo) → `REPO=.`, range = `{old_sha}..{new_sha}` của `git pull` từ Step 1
157
157
 
158
- If `feedback/` does not exist in REPO → skip silently.
158
+ Nếu `feedback/` không tồn tại trong REPO → skip âm thầm.
159
159
 
160
160
  ```bash
161
161
  git -C {REPO} diff --name-status {old_sha}..{new_sha} -- feedback/bug-reports/ feedback/bdd-proposals/ feedback/prd-change-requests/
162
162
  ```
163
163
 
164
- For each entry, read its title/summary + `State` and report. **Bug reports: surface only `State: Open`** as needing attention; list `Fixed`/`Closed` separately (or omit) so the PO/PM sees what's still pending:
164
+ Với mỗi entry, đọc title/summary + `State` report. **Bug report: chỉ surface `State: Open`** cần chú ý; liệt kê `Fixed`/`Closed` riêng (hoặc bỏ) để PO/PM thấy cái còn pending:
165
165
  ```
166
166
  📥 New feedback (pulled this sync):
167
167
  Bug reports (open):
@@ -173,42 +173,42 @@ For each entry, read its title/summary + `State` and report. **Bug reports: surf
173
173
  FT-001-bulk-export.md → new requirement, needs an AC (waiting: PO)
174
174
  ```
175
175
 
176
- If none changedprint `📥 Feedback: none new this sync`.
176
+ Nếu không gì đổi in `📥 Feedback: none new this sync`.
177
177
 
178
- If the reader is a PO/Dev, add a one-line nudge:
178
+ Nếu người đọc PO/Dev, thêm một dòng nudge:
179
179
  `→ Review feedback/ then act: /fix-bug {BUG-ID} · promote proposal via /generate-bdd · or add an AC to the PRD.`
180
180
 
181
181
  ---
182
182
 
183
183
  ## Step 2 — Post-sync State Check
184
184
 
185
- Run `git status --short` and check for modified submodule entries (lines starting with ` M` where the path matches a submodule).
185
+ Chạy `git status --short` kiểm tra entry submodule bị modified (dòng bắt đầu bằng ` M` path khớp một submodule).
186
186
 
187
- If any submodule pointer changed (typically the spec submodule after `--remote`):
187
+ Nếu pointer submodule nào đổi (thường spec submodule sau `--remote`):
188
188
  ```
189
189
  ⚠️ Submodule pointer(s) updated — commit to lock new version into umbrella:
190
190
  git add {spec_source} && git commit -m "chore: sync {spec_source} to latest"
191
191
  ```
192
192
 
193
- If no changes → `✅ Umbrella state clean — no commit needed`.
193
+ Nếu không thay đổi → `✅ Umbrella state clean — no commit needed`.
194
194
 
195
195
  ---
196
196
 
197
197
  ## Step 3 — Bootstrap Service Configs
198
198
 
199
- *Skip if `services` is empty.*
199
+ *Skip nếu `services` rỗng.*
200
200
 
201
- For each entry in `services[]`:
201
+ Với mỗi entry trong `services[]`:
202
202
 
203
- **A. If `{service.path}/.agent/project-context.yaml` already exists:**
204
- - Read `conventions.test_command` and `conventions.build_command`
203
+ **A. Nếu `{service.path}/.agent/project-context.yaml` đã tồn tại:**
204
+ - Đọc `conventions.test_command` `conventions.build_command`
205
205
  - Report: `✅ {service.path} — test: {test_command} | build: {build_command}`
206
206
 
207
- **B. If missingauto-create it:**
207
+ **B. Nếu thiếutự tạo:**
208
208
 
209
- 1. Determine `module` from umbrella `services[].module` (authoritative). If not set, auto-detect from files in `{service.path}/`:
209
+ 1. Xác định `module` từ umbrella `services[].module` (authoritative). Nếu không set, auto-detect từ file trong `{service.path}/`:
210
210
 
211
- | File present | Detected module | test_command | build_command |
211
+ | File mặt | Module phát hiện | test_command | build_command |
212
212
  |---|---|---|---|
213
213
  | `pom.xml` | `java-spring` | `mvn test` | `mvn compile` |
214
214
  | `build.gradle` or `build.gradle.kts` | `java-spring` | `./gradlew test` | `./gradlew build` |
@@ -223,9 +223,9 @@ For each entry in `services[]`:
223
223
  | `requirements.txt` or `pyproject.toml` | `context-engineering` | `pytest tests/ -v` | `pip install -r requirements.txt` |
224
224
  | *(none matched)* | `unknown` | `{{TEST_COMMAND}}` | `{{BUILD_COMMAND}}` |
225
225
 
226
- 2. Create `{service.path}/.agent/` directory if it does not exist.
226
+ 2. Tạo thư mục `{service.path}/.agent/` nếu chưa có.
227
227
 
228
- 3. Write `{service.path}/.agent/project-context.yaml`:
228
+ 3. Ghi `{service.path}/.agent/project-context.yaml`:
229
229
 
230
230
  ```yaml
231
231
  # Auto-generated by /sync — review and update as needed
@@ -244,18 +244,18 @@ For each entry in `services[]`:
244
244
  ```
245
245
 
246
246
  4. Report:
247
- - If auto-detected: `✅ Created {service.path}/.agent/project-context.yaml (module: {module}, test: {test_command})`
248
- - If unknown/placeholder: `⚠️ Created {service.path}/.agent/project-context.yaml — fill in {{TEST_COMMAND}} and {{BUILD_COMMAND}}`
247
+ - Nếu auto-detect: `✅ Created {service.path}/.agent/project-context.yaml (module: {module}, test: {test_command})`
248
+ - Nếu unknown/placeholder: `⚠️ Created {service.path}/.agent/project-context.yaml — fill in {{TEST_COMMAND}} and {{BUILD_COMMAND}}`
249
249
 
250
250
  ---
251
251
 
252
252
  ## Step 4 — Check `.gitignore`
253
253
 
254
- Check the generated Living Docs mirrors are gitignored:
255
- - `.trace/` in the current repo's `.gitignore` (or `.git/info/exclude`)
256
- - `.living-docs/` in the **specs module's** `.gitignore` (when `setup.spec_source` is set)
254
+ Kiểm tra các Living Docs mirror được sinh ra có gitignore không:
255
+ - `.trace/` trong `.gitignore` của repo hiện tại (hoặc `.git/info/exclude`)
256
+ - `.living-docs/` trong `.gitignore` của **specs module** (khi `setup.spec_source` được set)
257
257
 
258
- If either is missing:
258
+ Nếu thiếu cái nào:
259
259
  ```
260
260
  ⚠️ Living Docs mirrors not gitignored — they are generated, never commit them:
261
261
  echo ".trace/" >> .gitignore
@@ -264,20 +264,20 @@ If either is missing:
264
264
 
265
265
  ---
266
266
 
267
- ## Step 5 — Refresh Living Docs *(umbrella mode only)*
267
+ ## Step 5 — Refresh Living Docs *(chỉ umbrella mode)*
268
268
 
269
- *Skip if `services` is empty.*
269
+ *Skip nếu `services` rỗng.*
270
270
 
271
- **Resolve the Living Docs home (same rule as `/validate-traces`):**
272
- - `living_docs_dir` = `{spec_source}/.living-docs` if `setup.spec_source` is set, else `.living-docs` at umbrella root. *(The specs module is mounted inside every service workspace, so the panel resolves it even when a dev opens a single service submodule.)*
273
- - `panel_mirror` = `./.trace` at the current workspace root.
271
+ **Phân giải Living Docs home (cùng quy tắc như `/validate-traces`):**
272
+ - `living_docs_dir` = `{spec_source}/.living-docs` nếu `setup.spec_source` được set, else `.living-docs` umbrella root. *(Specs module được mount trong mọi service workspace, nên panel phân giải kể cả khi dev mở một service submodule đơn.)*
273
+ - `panel_mirror` = `./.trace` gốc workspace hiện tại.
274
274
 
275
- 1. For each service in `services[]`: if `{service.path}/.trace/` has `.tsv` files → copy them to `{living_docs_dir}/{service-name}/` (create dir if needed).
276
- 2. Write merged `{living_docs_dir}/trace-report.json`:
277
- - Aggregate each service's `.trace/` TSVs, add `"service"` field per row, recalc summary totals.
278
- 3. **Mirror to the panel location:** copy `{living_docs_dir}/trace-report.json` (+ namespaced TSVs) → `{panel_mirror}/` so the panel in the currently-open repo is non-empty. Skip if `panel_mirror` already equals `living_docs_dir`.
275
+ 1. Với mỗi service trong `services[]`: nếu `{service.path}/.trace/` file `.tsv` → copy chúng vào `{living_docs_dir}/{service-name}/` (tạo dir nếu cần).
276
+ 2. Ghi merged `{living_docs_dir}/trace-report.json`:
277
+ - Tổng hợp TSV `.trace/` của mỗi service, thêm field `"service"` mỗi row, tính lại summary totals.
278
+ 3. **Mirror tới panel location:** copy `{living_docs_dir}/trace-report.json` (+ TSV namespaced) → `{panel_mirror}/` để panel trong repo đang mở không rỗng. Skip nếu `panel_mirror` đã bằng `living_docs_dir`.
279
279
 
280
- Print sync result:
280
+ In kết quả sync:
281
281
  ```
282
282
  Living Docs → {living_docs_dir}/ synced (canonical, specs module)
283
283
  {service-name}: {N} TSVs
@@ -285,55 +285,55 @@ Living Docs → {living_docs_dir}/ synced (canonical, specs module)
285
285
  Panel mirror → {panel_mirror}/ (current workspace)
286
286
  ```
287
287
 
288
- If no `.trace/` dirs found → `Living Docs: no trace data yet — run /generate-bdd then /generate-code first.`
288
+ Nếu không tìm thấy dir `.trace/` → `Living Docs: no trace data yet — run /generate-bdd then /generate-code first.`
289
289
 
290
290
  ---
291
291
 
292
- ## Step 6 — Refresh Spec Manifest *(if spec_source present)*
292
+ ## Step 6 — Refresh Spec Manifest *(nếu spec_source)*
293
293
 
294
- *Skip if `setup.spec_source` is absent.*
294
+ *Skip nếu `setup.spec_source` vắng.*
295
295
 
296
- If `spec-manifest.yaml` exists OR `setup.spec_source` is configured:
297
- - Re-scan `{spec_source}/specs/**/prd.md` files
298
- - Rebuild `spec-manifest.yaml` mapping TICKET-ID → PRD/BDD/tech-doc paths
299
- - Print: `spec-manifest.yaml refreshed — {N} features indexed`
296
+ Nếu `spec-manifest.yaml` tồn tại HOẶC `setup.spec_source` được cấu hình:
297
+ - Re-scan các file PRD `{spec_source}/specs/*/*/*.md` (file `.md` ở gốc mỗi feature folder = PRD; tech-docs/design-spec `.md` nằm sâu hơn nên không bị quét nhầm)
298
+ - Rebuild `spec-manifest.yaml` map TICKET-ID → path PRD/BDD/tech-doc
299
+ - In: `spec-manifest.yaml refreshed — {N} features indexed`
300
300
 
301
301
  ---
302
302
 
303
303
  ## Output
304
304
 
305
- # Report Footer — Standard Command Output Format
305
+ # Report Footer — Định dạng output chuẩn cho mọi lệnh
306
306
 
307
- Every command report must end with this standard footer section.
307
+ Mọi report của lệnh phải kết thúc bằng section footer chuẩn này.
308
308
 
309
309
  ## Status Badge
310
310
 
311
- Choose one based on outcome:
312
- - `✅ Complete` — all steps succeeded, no issues found
313
- - `❌ Failed` — command could not complete due to a blocking error
314
- - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
311
+ Chọn một theo kết quả:
312
+ - `✅ Complete` — mọi bước thành công, không vấn đề
313
+ - `❌ Failed` — lệnh không hoàn thành được do lỗi chặn
314
+ - `⚠️ Warnings` — hoàn thành nhưng vấn đề không chặn, nên review lại
315
315
 
316
316
  ## Output Artifacts
317
317
 
318
- List every file created or modified by this command:
318
+ Liệt mọi file được tạo hoặc sửa bởi lệnh này:
319
319
  ```
320
320
  Output Artifacts:
321
- {created|updated} {file-path} ({brief description})
322
- {created|updated} {file-path} ({brief description})
321
+ {created|updated} {file-path} ({ tả ngắn})
322
+ {created|updated} {file-path} ({ tả ngắn})
323
323
  ```
324
324
 
325
- If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
325
+ Nếu không ghi file nào (vd: lệnh review hoặc phân tích) → ghi `Output Artifacts: none (read-only)`.
326
326
 
327
327
  ## Pipeline Position
328
328
 
329
- Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
330
- so the user always sees where this command sits in the end-to-end flow:
329
+ 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`,
330
+ để người dùng luôn thấy lệnh này nằm đâu trong luồng end-to-end:
331
331
 
332
332
  ```
333
333
  Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
334
334
  ```
335
335
 
336
- Find the current command in this phase legend and mark **its** phase in the map above:
336
+ 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:
337
337
 
338
338
  | Phase | Commands |
339
339
  |-------|----------|
@@ -347,61 +347,61 @@ Find the current command in this phase legend and mark **its** phase in the map
347
347
  | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
348
348
  | Trace Audit | `/validate-traces` |
349
349
 
350
- For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
350
+ Với **lệnh review**, thêm vòng review 3 bước đánh dấu bước hiện tại, vd:
351
351
  `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
352
352
 
353
- **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
354
- `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline
355
- **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
353
+ **Lệnh xuyên suốt** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
354
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) nằm ngoài pipeline tuyến tính
355
+ **bỏ hẳn dòng Pipeline** cho các lệnh này (đừng cố nhét chúng vào đồ).
356
356
 
357
- ## Next Command Suggestion
357
+ ## Gợi ý lệnh tiếp theo
358
358
 
359
- Suggest the logical next command based on workflow phase:
359
+ Gợi ý lệnh kế tiếp hợp theo phase của workflow:
360
360
 
361
- | Current command | Suggest next |
361
+ | Lệnh hiện tại | Gợi ý lệnh tiếp theo |
362
362
  |-------------------------|-----------------------------------------------|
363
- | /setup-ai-first | `/define-product` to start your first feature |
363
+ | /setup-ai-first | `/define-product` để bắt đầu feature đầu tiên |
364
364
  | /define-product | `/generate-prd {product-definition-file}` |
365
- | /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
366
- | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
367
- | /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 |
368
- | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
369
- | /generate-bdd | `/review-context {feature-file}` to verify coverage |
370
- | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
371
- | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
365
+ | /generate-prd | `/refine-prd {prd-file}` rồi `/review-context {prd-file}` |
366
+ | /refine-prd | Mở Review Board → cập nhật PRD → `/review-context {prd-file}` |
367
+ | /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 |
368
+ | /generate-design-spec | Designer review → xác nhận link Figma → PO + Designer sign-off → `/generate-bdd {prd-file}` |
369
+ | /generate-bdd | `/review-context {feature-file}` để kiểm tra độ phủ |
370
+ | /review-context (BDD) | `/generate-tech-docs {UC-ID}` nếu APPROVED; sinh lại nếu NEEDS_FIX |
371
+ | /qc-analyze | `/qc-plan {UC-ID}` (xử các gap blocker 🔴 trước) |
372
372
  | /qc-plan | `/qc-design-test {UC-ID}` |
373
- | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
374
- | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
375
- | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
376
- | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
377
- | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
373
+ | /qc-design-test | `/qc-review {UC-ID}` (review test-case) |
374
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` nếu APPROVED; sửa TC nếu NEEDS_FIX |
375
+ | /qc-run-test | `/qc-report {UC-ID}` rồi `/qc-review {UC-ID}` (review script) |
376
+ | /qc-review (script) | `/qc-report {UC-ID}` rồi tạo PR nếu APPROVED |
377
+ | /qc-report | `/validate-traces {UC-ID}` để làm mới Living Docs (qc_status) |
378
378
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
379
- | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
380
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
379
+ | /review-tech-docs | `/generate-code {feature-file}` nếu APPROVED; sửa doc nếu NEEDS_FIX |
380
+ | /generate-code | Lần gen đầu → `/review-code {UC-ID}`; gen lại → `/dev-gen-test {UC-ID}` |
381
381
  | /dev-gen-test | `/dev-run-test {UC-ID}` |
382
382
  | /dev-run-test (passing) | `/review-code {UC-ID}` |
383
- | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
384
- | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
385
- | /dev-smoke-test | Create PR and link to ticket |
386
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
387
- | /fix-bug | Create PR and link to ticket |
388
- | /debug | `/fix-bug {ticket-id}` if fix needed |
389
- | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
390
- | /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
391
- | /learn | Continue working — lesson applies on next command |
392
- | /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
393
- | /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
394
-
395
- Format the footer as:
383
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` hoặc `/debug {error}` |
384
+ | /review-code | `/dev-smoke-test {UC-ID}` hoặc tạo PR |
385
+ | /dev-smoke-test | Tạo PR link tới ticket |
386
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; tất cả OK → tạo PR |
387
+ | /fix-bug | Tạo PR link tới ticket |
388
+ | /debug | `/fix-bug {ticket-id}` nếu cần sửa |
389
+ | /report-bug | Gửi cho dev (`/fix-bug {BUG-ID}`); nếu thiếu coverage → `/propose-scenario {UC-ID}` |
390
+ | /propose-scenario | Báo PO/Dev review proposal trong `feedback/bdd-proposals/` |
391
+ | /learn | Tiếp tục làm việc — lesson áp dụng lệnh kế tiếp |
392
+ | /sync | `/validate-traces` để xem độ phủ đầy đủ; xử lý mọi `📥 tester feedback` được nêu |
393
+ | /update-framework | Review `git diff .agent/`, commit; `/sync` để đồng bộ nội dung dự án |
394
+
395
+ Định dạng footer như sau:
396
396
  ```
397
397
  ---
398
398
  Status : {badge}
399
- {Output Artifacts block}
399
+ {khối Output Artifacts}
400
400
  Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
401
- (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
402
- Next : {suggested command with example arguments}
401
+ (lệnh review) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
402
+ Next : {lệnh gợi ý kèm ví dụ tham số}
403
403
  ```
404
- *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
404
+ *(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
405
405
 
406
406
 
407
407
  ```