@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
@@ -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,18 +285,18 @@ 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 `{spec_source}/specs/**/prd.md`
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