@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.
- package/commands/debug.md +435 -435
- package/commands/debug.tmpl +111 -111
- package/commands/define-product.md +330 -327
- package/commands/define-product.tmpl +50 -47
- package/commands/dev-gen-test.md +364 -364
- package/commands/dev-gen-test.tmpl +63 -63
- package/commands/dev-run-test.md +375 -375
- package/commands/dev-run-test.tmpl +74 -74
- package/commands/dev-smoke-test.md +340 -340
- package/commands/dev-smoke-test.tmpl +60 -60
- package/commands/fix-bug.md +402 -402
- package/commands/fix-bug.tmpl +78 -78
- package/commands/generate-bdd.md +512 -512
- package/commands/generate-bdd.tmpl +211 -211
- package/commands/generate-code.md +480 -482
- package/commands/generate-code.tmpl +179 -181
- package/commands/generate-design-spec.md +495 -495
- package/commands/generate-design-spec.tmpl +219 -219
- package/commands/generate-prd.md +445 -396
- package/commands/generate-prd.tmpl +45 -198
- package/commands/generate-spec-manifest.md +337 -337
- package/commands/generate-spec-manifest.tmpl +57 -57
- package/commands/generate-tech-docs.md +364 -364
- package/commands/generate-tech-docs.tmpl +84 -84
- package/commands/learn.md +346 -346
- package/commands/learn.tmpl +22 -22
- package/commands/map-testids.md +321 -321
- package/commands/map-testids.tmpl +41 -41
- package/commands/propose-scenario.md +334 -334
- package/commands/propose-scenario.tmpl +54 -54
- package/commands/qc-analyze.md +322 -323
- package/commands/qc-analyze.tmpl +42 -43
- package/commands/qc-design-test.md +303 -303
- package/commands/qc-design-test.tmpl +23 -23
- package/commands/qc-plan.md +296 -296
- package/commands/qc-plan.tmpl +16 -16
- package/commands/qc-report.md +301 -301
- package/commands/qc-report.tmpl +21 -21
- package/commands/qc-review.md +297 -297
- package/commands/qc-review.tmpl +17 -17
- package/commands/qc-run-test.md +336 -336
- package/commands/qc-run-test.tmpl +35 -35
- package/commands/refine-prd.md +426 -428
- package/commands/refine-prd.tmpl +61 -61
- package/commands/report-bug.md +350 -350
- package/commands/report-bug.tmpl +70 -70
- package/commands/review-code.md +363 -363
- package/commands/review-code.tmpl +39 -39
- package/commands/review-context.md +577 -579
- package/commands/review-context.tmpl +212 -212
- package/commands/review-tech-docs.md +426 -426
- package/commands/review-tech-docs.tmpl +146 -146
- package/commands/setup-ai-first.md +237 -237
- package/commands/setup-ai-first.tmpl +131 -131
- package/commands/sync.md +145 -145
- package/commands/sync.tmpl +93 -93
- package/commands/update-framework.md +88 -88
- package/commands/update-framework.tmpl +36 -36
- package/commands/validate-traces.md +379 -379
- package/commands/validate-traces.tmpl +99 -99
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +435 -435
- package/core/commands/define-product.md +330 -327
- package/core/commands/dev-gen-test.md +364 -364
- package/core/commands/dev-run-test.md +375 -375
- package/core/commands/dev-smoke-test.md +340 -340
- package/core/commands/fix-bug.md +402 -402
- package/core/commands/generate-bdd.md +512 -512
- package/core/commands/generate-code.md +480 -482
- package/core/commands/generate-design-spec.md +495 -495
- package/core/commands/generate-prd.md +445 -396
- package/core/commands/generate-spec-manifest.md +337 -337
- package/core/commands/generate-tech-docs.md +364 -364
- package/core/commands/learn.md +346 -346
- package/core/commands/map-testids.md +321 -321
- package/core/commands/propose-scenario.md +334 -334
- package/core/commands/qc-analyze.md +322 -323
- package/core/commands/qc-design-test.md +303 -303
- package/core/commands/qc-plan.md +296 -296
- package/core/commands/qc-report.md +301 -301
- package/core/commands/qc-review.md +297 -297
- package/core/commands/qc-run-test.md +336 -336
- package/core/commands/refine-prd.md +426 -428
- package/core/commands/report-bug.md +350 -350
- package/core/commands/review-code.md +363 -363
- package/core/commands/review-context.md +577 -579
- package/core/commands/review-tech-docs.md +426 -426
- package/core/commands/setup-ai-first.md +237 -237
- package/core/commands/sync.md +145 -145
- package/core/commands/update-framework.md +88 -88
- package/core/commands/validate-traces.md +379 -379
- package/core/skills/code/SKILL.md +388 -388
- package/core/skills/debug/SKILL.md +390 -390
- package/core/skills/design-spec/SKILL.md +316 -316
- package/core/skills/discovery/SKILL.md +7 -547
- package/core/skills/prd/SKILL.md +298 -394
- package/core/skills/setup-ai-first/SKILL.md +79 -79
- package/core/skills/spec/SKILL.md +176 -176
- package/core/skills/test/SKILL.md +602 -602
- package/core/steps/capture-lesson.md +44 -44
- package/core/steps/context-loader.md +174 -174
- package/core/steps/gate.md +54 -54
- package/core/steps/report-footer.md +52 -52
- package/core/steps/review-fanout.md +85 -87
- package/core/steps/spawn-agent.md +45 -45
- package/core/steps/trace-mirror.md +21 -21
- package/core/templates/architecture.template.md +37 -37
- package/core/templates/design-spec.template.md +77 -77
- package/core/templates/platform-guide.template.md +47 -47
- package/core/templates/prd.template.md +106 -231
- package/core/templates/product-definition.template.md +101 -88
- package/docs/04-operations/publishing.md +20 -3
- package/package.json +1 -1
- package/skills/code/SKILL.md +388 -388
- package/skills/code/SKILL.tmpl +56 -56
- package/skills/debug/SKILL.md +390 -390
- package/skills/debug/SKILL.tmpl +60 -60
- package/skills/design-spec/SKILL.md +316 -316
- package/skills/design-spec/SKILL.tmpl +36 -36
- package/skills/discovery/SKILL.md +7 -547
- package/skills/discovery/SKILL.tmpl +7 -140
- package/skills/prd/SKILL.md +298 -394
- package/skills/prd/SKILL.tmpl +40 -151
- package/skills/setup-ai-first/SKILL.md +79 -79
- package/skills/setup-ai-first/SKILL.tmpl +27 -27
- package/skills/spec/SKILL.md +176 -176
- package/skills/spec/SKILL.tmpl +18 -18
- package/skills/test/SKILL.md +602 -602
- package/skills/test/SKILL.tmpl +44 -44
- package/steps/capture-lesson.md +44 -44
- package/steps/context-loader.md +174 -174
- package/steps/gate.md +54 -54
- package/steps/report-footer.md +52 -52
- package/steps/review-fanout.md +85 -87
- package/steps/spawn-agent.md +45 -45
- package/steps/trace-mirror.md +21 -21
- package/templates/architecture.template.md +37 -37
- package/templates/design-spec.template.md +77 -77
- package/templates/platform-guide.template.md +47 -47
- package/templates/prd.template.md +106 -231
- package/templates/product-definition.template.md +101 -88
package/commands/sync.tmpl
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# /sync — Sync & Refresh Umbrella Project
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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 có 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
|
-
**
|
|
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
|
-
|
|
14
|
+
Xác minh thư mục hiện tại nằm trong git repo. Nếu không → dừng:
|
|
15
15
|
```
|
|
16
16
|
❌ Not a git repository. Open Claude Code from umbrella root and retry.
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
**B.
|
|
19
|
+
**B. Đọc project config sớm**
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
- `setup.spec_source` → path
|
|
23
|
-
- `services` → map
|
|
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
|
-
|
|
25
|
+
Cần cái này để phân biệt spec vs service submodule ở Step 1.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Nếu `.agent/project-context.yaml` không tồn tại → cảnh báo và set `spec_source = null`, `services = {}`.
|
|
28
28
|
|
|
29
29
|
**C. Submodule status scan**
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Chạy `git submodule status --recursive` và phân loại mỗi entry theo ký tự đầu:
|
|
32
32
|
|
|
33
|
-
| Char |
|
|
33
|
+
| Char | Ý nghĩa | Hành động |
|
|
34
34
|
|------|---------|--------|
|
|
35
|
-
| `-` |
|
|
36
|
-
| ` ` |
|
|
37
|
-
| `+` | Ahead
|
|
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
|
-
|
|
40
|
+
Nếu **bất kỳ** entry nào có `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
|
-
|
|
47
|
+
Nếu **bất kỳ** entry nào có `+` (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
|
-
|
|
52
|
+
Đừng xử lý `+` ở đây — Step 1b quyết định cách xử lý đúng cho từng submodule.
|
|
53
53
|
|
|
54
|
-
|
|
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
|
-
|
|
61
|
-
`git rev-parse --abbrev-ref HEAD` →
|
|
60
|
+
Ghi branch umbrella hiện tại trước (đây là cái `git pull` cập nhật):
|
|
61
|
+
`git rev-parse --abbrev-ref HEAD` → lưu thành `umbrella_branch` và 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
|
-
|
|
77
|
+
Nếu `git pull` exit khác 0 → in lỗi và dừng với `❌`.
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
## Step 1b —
|
|
81
|
+
## Step 1b — Phân loại & Sync từng Submodule
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
**Ý tưởng cốt lõi:** `/sync` không bao giờ áp một branch lên submodule. Nó **kiểm tra checkout hiện tại của từng submodule** và tôn trọng nó. Đây là cách nó biết submodule nào bạn đang làm vs cái nào là dependency thụ động.
|
|
84
84
|
|
|
85
|
-
|
|
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
|
-
|
|
93
|
+
Phân loại vào một trong bốn case và xử lý tương ứng:
|
|
94
94
|
|
|
95
|
-
| Case |
|
|
95
|
+
| Case | State phát hiện | Hành động |
|
|
96
96
|
|------|----------------|--------|
|
|
97
|
-
| **Spec submodule** | `path == spec_source` | Advance
|
|
98
|
-
| **Active (on a branch)** | HEAD
|
|
99
|
-
| **Passive (detached, clean)** | Detached HEAD,
|
|
100
|
-
| **Dirty (uncommitted changes)** | `git status --porcelain` non-empty |
|
|
97
|
+
| **Spec submodule** | `path == spec_source` | Advance tới `spec_branch` (Step 1c bên dưới) |
|
|
98
|
+
| **Active (on a branch)** | HEAD là một branch, không detached | **KHÔNG checkout.** Đây là nơi bạn (hoặc đồng đội) đang code. Chỉ `git -C {path} fetch` và 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
|
-
> **
|
|
102
|
+
> **Vì 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/` và đ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 *(
|
|
106
|
+
## Step 1c — Advance Spec Submodule *(chỉ khi `spec_source` được cấu hình)*
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
Spec submodule là submodule duy nhất ta cố ý advance tới một branch HEAD (PO push spec liên tục).
|
|
109
109
|
|
|
110
|
-
**
|
|
110
|
+
**Phân giải spec branch** (giờ submodule đã init), theo thứ tự ưu tiên:
|
|
111
111
|
|
|
112
|
-
1. **Command argument** —
|
|
113
|
-
2. **`.gitmodules` config** — `git config -f .gitmodules --get submodule.{spec_source}.branch`.
|
|
114
|
-
3. **Remote default** — else
|
|
112
|
+
1. **Command argument** — nếu `$ARGUMENTS` chứa tên branch → dùng nó (override một lần)
|
|
113
|
+
2. **`.gitmodules` config** — `git config -f .gitmodules --get submodule.{spec_source}.branch`. Nếu set → dùng nó (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
|
-
|
|
116
|
+
Lưu thành `spec_branch` + `spec_branch_source` (argument | .gitmodules | remote-default). Nếu nó rơi xuống remote-default mà 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
|
-
|
|
124
|
+
Rồi kiểm tra an toàn: nếu spec submodule có thay đổi chưa commit → cảnh báo và skip (dev nên coi spec là read-only). Ngược lại dùng **explicit checkout** (không phải `--remote` trần) để branch rõ 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
|
-
|
|
134
|
+
In: `Spec submodule {spec_source}: pulled branch '{spec_branch}' (source: {spec_branch_source})`
|
|
135
135
|
|
|
136
|
-
> **
|
|
136
|
+
> **Vì 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 và tạo pointer drift chưa commit. Spec submodule là ngoại lệ: PO push liên tục, nên ta advance nó tới branch HEAD — nhưng làm bằng explicit `checkout {spec_branch}` thay vì `--remote` để nó không bao giờ âm thầm theo sai branch.
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
Nếu `git pull` hoặc `git submodule update` exit khác 0 → in lỗi và dừng với `❌`.
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
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
|
|
147
|
+
## Step 1d — Surface Feedback của Tester/QC *(bug report / scenario proposal / PRD change request)*
|
|
148
148
|
|
|
149
|
-
|
|
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 gì tới trong **lần** pull này, để họ được thông báo qua routine bình thường. Nó phủ cả hai đối tượng:
|
|
150
150
|
|
|
151
|
-
- **Dev/tester
|
|
152
|
-
- **PO
|
|
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
|
-
|
|
155
|
-
- Umbrella
|
|
156
|
-
-
|
|
154
|
+
Chọn repo + range đã pull feedback:
|
|
155
|
+
- Umbrella có `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
|
-
|
|
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
|
-
|
|
164
|
+
Với mỗi entry, đọc title/summary + `State` và report. **Bug report: chỉ surface `State: Open`** là cần chú ý; liệt kê `Fixed`/`Closed` riêng (hoặc bỏ) để PO/PM thấy cái gì 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
|
-
|
|
176
|
+
Nếu không có gì đổi → in `📥 Feedback: none new this sync`.
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
Nếu người đọc là 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
|
-
|
|
185
|
+
Chạy `git status --short` và kiểm tra entry submodule bị modified (dòng bắt đầu bằng ` M` mà path khớp một submodule).
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
Nếu pointer submodule nào đổi (thường là 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
|
-
|
|
193
|
+
Nếu không có 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
|
|
199
|
+
*Skip nếu `services` rỗng.*
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
Với mỗi entry trong `services[]`:
|
|
202
202
|
|
|
203
|
-
**A.
|
|
204
|
-
-
|
|
203
|
+
**A. Nếu `{service.path}/.agent/project-context.yaml` đã tồn tại:**
|
|
204
|
+
- Đọc `conventions.test_command` và `conventions.build_command`
|
|
205
205
|
- Report: `✅ {service.path} — test: {test_command} | build: {build_command}`
|
|
206
206
|
|
|
207
|
-
**B.
|
|
207
|
+
**B. Nếu thiếu — tự tạo:**
|
|
208
208
|
|
|
209
|
-
1.
|
|
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
|
|
211
|
+
| File có 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.
|
|
226
|
+
2. Tạo thư mục `{service.path}/.agent/` nếu chưa có.
|
|
227
227
|
|
|
228
|
-
3.
|
|
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
|
-
-
|
|
248
|
-
-
|
|
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
|
-
|
|
255
|
-
- `.trace/`
|
|
256
|
-
- `.living-docs/`
|
|
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
|
-
|
|
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
|
|
267
|
+
## Step 5 — Refresh Living Docs *(chỉ umbrella mode)*
|
|
268
268
|
|
|
269
|
-
*Skip
|
|
269
|
+
*Skip nếu `services` rỗng.*
|
|
270
270
|
|
|
271
|
-
**
|
|
272
|
-
- `living_docs_dir` = `{spec_source}/.living-docs`
|
|
273
|
-
- `panel_mirror` = `./.trace`
|
|
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 nó 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.
|
|
276
|
-
2.
|
|
277
|
-
-
|
|
278
|
-
3. **Mirror
|
|
275
|
+
1. Với mỗi service trong `services[]`: nếu `{service.path}/.trace/` có 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
|
-
|
|
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
|
-
|
|
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 *(
|
|
292
|
+
## Step 6 — Refresh Spec Manifest *(nếu có spec_source)*
|
|
293
293
|
|
|
294
|
-
*Skip
|
|
294
|
+
*Skip nếu `setup.spec_source` vắng.*
|
|
295
295
|
|
|
296
|
-
|
|
297
|
-
- Re-scan `{spec_source}/specs/**/prd.md`
|
|
298
|
-
- Rebuild `spec-manifest.yaml`
|
|
299
|
-
-
|
|
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
|
|