@educa-corp/sdd-framework 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/build.js +113 -19
- package/bin/gate-trace.js +487 -0
- package/bin/index.js +445 -146
- package/bin/lint-trace.js +643 -0
- package/bin/self-check.js +804 -2
- package/bin/trace-schema.json +621 -10
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/README.md +20 -0
- package/core/commands/amend-prd.md +518 -0
- package/core/commands/debug.md +123 -511
- package/core/commands/define-product.md +86 -510
- package/core/commands/dev-gen-test.md +86 -510
- package/core/commands/dev-run-test.md +133 -519
- package/core/commands/dev-smoke-test.md +86 -510
- package/core/commands/extend-prd.md +128 -522
- package/core/commands/fix-bug.md +118 -509
- package/core/commands/generate-architecture.md +94 -515
- package/core/commands/generate-bdd.md +128 -513
- package/core/commands/generate-code.md +119 -510
- package/core/commands/generate-design-spec.md +86 -510
- package/core/commands/generate-prd.md +89 -510
- package/core/commands/generate-spec-manifest.md +86 -510
- package/core/commands/generate-tech-docs.md +120 -512
- package/core/commands/learn.md +172 -496
- package/core/commands/map-testids.md +86 -510
- package/core/commands/propose-scenario.md +86 -510
- package/core/commands/qc-analyze.md +86 -510
- package/core/commands/qc-design-test.md +86 -510
- package/core/commands/qc-plan.md +86 -510
- package/core/commands/qc-report.md +86 -510
- package/core/commands/qc-review.md +86 -510
- package/core/commands/qc-run-test.md +115 -513
- package/core/commands/refine-prd.md +112 -522
- package/core/commands/report-bug.md +86 -510
- package/core/commands/review-code.md +123 -511
- package/core/commands/review-context.md +136 -522
- package/core/commands/review-tech-docs.md +90 -511
- package/core/commands/setup-ai-first.md +166 -138
- package/core/commands/sync.md +155 -107
- package/core/commands/update-framework.md +16 -103
- package/core/commands/validate-traces.md +426 -511
- package/core/hooks/data-guard.js +174 -83
- package/core/hooks/settings.json +2 -1
- package/core/rules/workflow.md +64 -4
- package/core/steps/capture-lesson.md +34 -1
- package/core/steps/context-loader.md +50 -8
- package/core/steps/gate.md +92 -35
- package/core/steps/report-footer.md +23 -0
- package/core/templates/README.md +24 -1
- package/core/templates/ci/trace-gate.yml +146 -0
- package/core/templates/feature.template +1 -1
- package/core/templates/hooks/pre-push +61 -0
- package/docs/02-concepts/architecture.md +61 -6
- package/docs/02-concepts/traceability.md +57 -0
- package/docs/03-guides/architect.md +63 -0
- package/docs/04-reference/commands.md +148 -134
- package/docs/04-reference/model-selection.md +32 -19
- package/docs/04-reference/trace-schema.md +39 -0
- package/docs/explain/02b-extend-prd.md +1 -1
- package/docs/explain/02c-amend-prd.md +152 -0
- package/docs/explain/21-validate-traces.md +2 -1
- package/docs/explain/27-learn.md +5 -3
- package/docs/explain/28-sync.md +25 -0
- package/docs/explain/README.md +136 -135
- package/package.json +5 -9
- package/commands/debug.md +0 -917
- package/commands/debug.tmpl +0 -257
- package/commands/define-product.md +0 -862
- package/commands/define-product.tmpl +0 -225
- package/commands/dev-gen-test.md +0 -1124
- package/commands/dev-gen-test.tmpl +0 -490
- package/commands/dev-run-test.md +0 -859
- package/commands/dev-run-test.tmpl +0 -225
- package/commands/dev-smoke-test.md +0 -798
- package/commands/dev-smoke-test.tmpl +0 -217
- package/commands/extend-prd.md +0 -907
- package/commands/extend-prd.tmpl +0 -270
- package/commands/fix-bug.md +0 -910
- package/commands/fix-bug.tmpl +0 -197
- package/commands/generate-architecture.md +0 -775
- package/commands/generate-architecture.tmpl +0 -194
- package/commands/generate-bdd.md +0 -1347
- package/commands/generate-bdd.tmpl +0 -590
- package/commands/generate-code.md +0 -1283
- package/commands/generate-code.tmpl +0 -649
- package/commands/generate-design-spec.md +0 -1161
- package/commands/generate-design-spec.tmpl +0 -524
- package/commands/generate-prd.md +0 -1143
- package/commands/generate-prd.tmpl +0 -223
- package/commands/generate-spec-manifest.md +0 -745
- package/commands/generate-spec-manifest.tmpl +0 -164
- package/commands/generate-tech-docs.md +0 -1344
- package/commands/generate-tech-docs.tmpl +0 -273
- package/commands/learn.md +0 -723
- package/commands/learn.tmpl +0 -63
- package/commands/map-testids.md +0 -662
- package/commands/map-testids.tmpl +0 -81
- package/commands/propose-scenario.md +0 -783
- package/commands/propose-scenario.tmpl +0 -202
- package/commands/qc-analyze.md +0 -693
- package/commands/qc-analyze.tmpl +0 -112
- package/commands/qc-design-test.md +0 -650
- package/commands/qc-design-test.tmpl +0 -69
- package/commands/qc-plan.md +0 -630
- package/commands/qc-plan.tmpl +0 -49
- package/commands/qc-report.md +0 -641
- package/commands/qc-report.tmpl +0 -60
- package/commands/qc-review.md +0 -634
- package/commands/qc-review.tmpl +0 -53
- package/commands/qc-run-test.md +0 -750
- package/commands/qc-run-test.tmpl +0 -116
- package/commands/refine-prd.md +0 -1074
- package/commands/refine-prd.tmpl +0 -278
- package/commands/report-bug.md +0 -729
- package/commands/report-bug.tmpl +0 -148
- package/commands/review-code.md +0 -803
- package/commands/review-code.tmpl +0 -143
- package/commands/review-context.md +0 -1323
- package/commands/review-context.tmpl +0 -527
- package/commands/review-tech-docs.md +0 -982
- package/commands/review-tech-docs.tmpl +0 -401
- package/commands/setup-ai-first.md +0 -574
- package/commands/setup-ai-first.tmpl +0 -378
- package/commands/sync.md +0 -486
- package/commands/sync.tmpl +0 -384
- package/commands/update-framework.md +0 -290
- package/commands/update-framework.tmpl +0 -188
- package/commands/validate-traces.md +0 -1435
- package/commands/validate-traces.tmpl +0 -854
- package/hooks/data-guard.js +0 -141
- package/hooks/settings.json +0 -18
- package/modules/android-compose/module.yaml +0 -13
- package/modules/android-compose/stack-profile.yaml +0 -57
- package/modules/angular/architecture-snippets/component-patterns.md +0 -187
- package/modules/angular/module.yaml +0 -6
- package/modules/angular/stack-profile.yaml +0 -38
- package/modules/context-engineering/architecture-snippets/context-design.md +0 -119
- package/modules/context-engineering/module.yaml +0 -9
- package/modules/context-engineering/stack-profile.yaml +0 -61
- package/modules/dotnet/architecture-snippets/clean-arch.md +0 -160
- package/modules/dotnet/module.yaml +0 -6
- package/modules/dotnet/stack-profile.yaml +0 -50
- package/modules/flutter/module.yaml +0 -14
- package/modules/flutter/stack-profile.yaml +0 -59
- package/modules/golang/architecture-snippets/domain-layout.md +0 -283
- package/modules/golang/module.yaml +0 -6
- package/modules/golang/stack-profile.yaml +0 -40
- package/modules/ios-swiftui/module.yaml +0 -13
- package/modules/ios-swiftui/stack-profile.yaml +0 -55
- package/modules/java-spring/architecture-snippets/layered-arch.md +0 -201
- package/modules/java-spring/module.yaml +0 -15
- package/modules/java-spring/stack-profile.yaml +0 -28
- package/modules/nextjs/architecture-snippets/app-router-patterns.md +0 -269
- package/modules/nextjs/module.yaml +0 -14
- package/modules/nextjs/stack-profile.yaml +0 -74
- package/modules/nuxt/module.yaml +0 -14
- package/modules/nuxt/stack-profile.yaml +0 -58
- package/modules/phaser-game/architecture-snippets/phaser-scene-patterns.md +0 -646
- package/modules/phaser-game/module.yaml +0 -15
- package/modules/phaser-game/stack-profile.yaml +0 -90
- package/modules/php-laravel/architecture-snippets/service-repository.md +0 -302
- package/modules/php-laravel/module.yaml +0 -15
- package/modules/php-laravel/stack-profile.yaml +0 -56
- package/modules/qc-playwright/stack-profile.yaml +0 -66
- package/modules/react/architecture-snippets/hooks-query-patterns.md +0 -254
- package/modules/react/module.yaml +0 -14
- package/modules/react/stack-profile.yaml +0 -63
- package/modules/react-native/module.yaml +0 -14
- package/modules/react-native/stack-profile.yaml +0 -56
- package/modules/vue/module.yaml +0 -14
- package/modules/vue/stack-profile.yaml +0 -65
- package/rules/data-protection.md +0 -80
- package/rules/workflow.md +0 -73
- package/scripts/init.sh +0 -49
- package/scripts/upgrade.sh +0 -94
- package/skills/code/SKILL.md +0 -19
- package/skills/code/SKILL.tmpl +0 -19
- package/skills/debug/SKILL.md +0 -19
- package/skills/debug/SKILL.tmpl +0 -19
- package/skills/design-spec/SKILL.md +0 -11
- package/skills/design-spec/SKILL.tmpl +0 -11
- package/skills/discovery/SKILL.md +0 -14
- package/skills/discovery/SKILL.tmpl +0 -14
- package/skills/prd/SKILL.md +0 -19
- package/skills/prd/SKILL.tmpl +0 -19
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +0 -63
- package/skills/qc/qa-analyst/acceptance-criteria.md +0 -60
- package/skills/qc/qa-analyst/business-rules.md +0 -59
- package/skills/qc/qa-analyst/data-flow.md +0 -64
- package/skills/qc/qa-analyst/spec-breakdown.md +0 -61
- package/skills/qc/qa-designer/e2e/journey.md +0 -41
- package/skills/qc/qa-designer/exploratory/charter.md +0 -68
- package/skills/qc/qa-designer/exploratory/explore-to-functional.md +0 -43
- package/skills/qc/qa-designer/functional/api.md +0 -45
- package/skills/qc/qa-designer/functional/gui-feature.md +0 -46
- package/skills/qc/qa-designer/functional/gui-screen.md +0 -52
- package/skills/qc/qa-designer/integration/api.md +0 -42
- package/skills/qc/qa-designer/integration/db.md +0 -39
- package/skills/qc/qa-designer/integration/gui.md +0 -40
- package/skills/qc/qa-designer/integration/kafka.md +0 -40
- package/skills/qc/qa-designer/non-functional.md +0 -40
- package/skills/qc/qa-planner/test-plan.md +0 -120
- package/skills/qc/qa-reviewer/script/e2e.md +0 -87
- package/skills/qc/qa-reviewer/script/exploratory.md +0 -45
- package/skills/qc/qa-reviewer/script/functional.md +0 -101
- package/skills/qc/qa-reviewer/script/integration.md +0 -91
- package/skills/qc/qa-reviewer/script/non-functional.md +0 -126
- package/skills/qc/qa-reviewer/test-case/e2e.md +0 -73
- package/skills/qc/qa-reviewer/test-case/exploratory.md +0 -43
- package/skills/qc/qa-reviewer/test-case/functional.md +0 -76
- package/skills/qc/qa-reviewer/test-case/integration.md +0 -69
- package/skills/qc/qa-reviewer/test-case/non-functional.md +0 -73
- package/skills/qc/qa-runner/e2e.md +0 -49
- package/skills/qc/qa-runner/exploratory/session.md +0 -36
- package/skills/qc/qa-runner/functional/api.md +0 -35
- package/skills/qc/qa-runner/functional/gui-feature.md +0 -51
- package/skills/qc/qa-runner/functional/gui-screen.md +0 -55
- package/skills/qc/qa-runner/integration.md +0 -47
- package/skills/qc/qa-runner/non-functional.md +0 -49
- package/skills/qc/qa-runner/report/report.md +0 -37
- package/skills/setup-ai-first/SKILL.md +0 -19
- package/skills/setup-ai-first/SKILL.tmpl +0 -19
- package/skills/spec/SKILL.md +0 -19
- package/skills/spec/SKILL.tmpl +0 -19
- package/skills/test/SKILL.md +0 -18
- package/skills/test/SKILL.tmpl +0 -18
- package/steps/business-language.md +0 -56
- package/steps/capture-lesson.md +0 -79
- package/steps/context-loader.md +0 -385
- package/steps/gate.md +0 -94
- package/steps/report-footer.md +0 -102
- package/steps/review-fanout.md +0 -159
- package/steps/spawn-agent.md +0 -129
- package/steps/trace-mirror.md +0 -53
- package/templates/README.md +0 -47
- package/templates/architecture.template.md +0 -394
- package/templates/design-spec.template.md +0 -217
- package/templates/feature.template +0 -123
- package/templates/platform-guide.template.md +0 -145
- package/templates/prd.template.md +0 -283
- package/templates/product-definition.template.md +0 -188
- package/templates/project-context.yaml +0 -212
- package/templates/tech-design.template.md +0 -490
package/commands/sync.tmpl
DELETED
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
# /sync — Sync & Refresh Umbrella Project
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Step 0 — Pre-flight Checks
|
|
11
|
-
|
|
12
|
-
**A. Git repo check**
|
|
13
|
-
|
|
14
|
-
Xác minh thư mục hiện tại nằm trong git repo. Nếu không → dừng:
|
|
15
|
-
```
|
|
16
|
-
❌ Not a git repository. Open Claude Code from umbrella root and retry.
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**B. Đọc project config sớm**
|
|
20
|
-
|
|
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
|
-
|
|
25
|
-
Cần cái này để phân biệt spec vs service submodule ở Step 1.
|
|
26
|
-
|
|
27
|
-
Nếu `.agent/project-context.yaml` không tồn tại → cảnh báo và set `spec_source = null`, `services = {}`.
|
|
28
|
-
|
|
29
|
-
**C. Submodule status scan**
|
|
30
|
-
|
|
31
|
-
Chạy `git submodule status --recursive` và phân loại mỗi entry theo ký tự đầu:
|
|
32
|
-
|
|
33
|
-
| Char | Ý nghĩa | Hành động |
|
|
34
|
-
|------|---------|--------|
|
|
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
|
-
| `U` | Merge conflict | → **STOP** |
|
|
39
|
-
|
|
40
|
-
Nếu **bất kỳ** entry nào có `U`:
|
|
41
|
-
```
|
|
42
|
-
❌ Merge conflict in submodule: {path}
|
|
43
|
-
Resolve manually before running /sync:
|
|
44
|
-
cd {path} && git status
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Nếu **bất kỳ** entry nào có `+` (commit đang checkout khác pointer đã ghi):
|
|
48
|
-
```
|
|
49
|
-
ℹ️ {path} is ahead of the umbrella's recorded pointer.
|
|
50
|
-
/sync classifies it in Step 1b — if you're on a branch there, it stays untouched.
|
|
51
|
-
```
|
|
52
|
-
Đừng xử lý `+` ở đây — Step 1b quyết định cách xử lý đúng cho từng submodule.
|
|
53
|
-
|
|
54
|
-
In mode phát hiện: `Mode: Setup (first-time init)` hoặc `Mode: Update (sync latest)`.
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Step 1 — Umbrella Pull
|
|
59
|
-
|
|
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
|
-
|
|
63
|
-
```bash
|
|
64
|
-
# 1. Pull latest umbrella (includes updated submodule pointer records)
|
|
65
|
-
git pull
|
|
66
|
-
|
|
67
|
-
# 2. Sync .gitmodules config into local git config
|
|
68
|
-
# (needed when new submodules were added since last clone)
|
|
69
|
-
git submodule sync --recursive
|
|
70
|
-
|
|
71
|
-
# 3. Initialize any NOT-yet-cloned submodules ONLY (the '-' entries from Step 0-C).
|
|
72
|
-
# Do NOT run a blanket `git submodule update --recursive` — that would detach
|
|
73
|
-
# a submodule you are actively working in. Per-submodule handling is Step 1b.
|
|
74
|
-
git submodule update --init {paths that were '-' in Step 0-C}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Nếu `git pull` exit khác 0 → in lỗi và dừng với `❌`.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Step 1b — Phân loại & Sync từng Submodule
|
|
82
|
-
|
|
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
|
-
|
|
85
|
-
Với mỗi submodule (dùng `git submodule foreach` hoặc lặp các path), đọc state:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
# Inside each submodule:
|
|
89
|
-
git symbolic-ref --short -q HEAD # → branch name, or empty/non-zero if DETACHED
|
|
90
|
-
git status --porcelain # → non-empty means uncommitted local changes
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Phân loại vào một trong bốn case và xử lý tương ứng:
|
|
94
|
-
|
|
95
|
-
| Case | State phát hiện | Hành động |
|
|
96
|
-
|------|----------------|--------|
|
|
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
|
-
|
|
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
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Step 1c — Advance Spec Submodule *(chỉ khi `spec_source` được cấu hình)*
|
|
107
|
-
|
|
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
|
-
|
|
110
|
-
**Phân giải spec branch** (giờ submodule đã init), theo thứ tự ưu tiên:
|
|
111
|
-
|
|
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
|
-
|
|
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
|
-
```
|
|
118
|
-
ℹ️ Spec submodule branch not pinned in .gitmodules — using remote default '{spec_branch}'.
|
|
119
|
-
To pin it for the whole team:
|
|
120
|
-
git config -f .gitmodules submodule.{spec_source}.branch {spec_branch}
|
|
121
|
-
git add .gitmodules && git commit -m "chore: pin spec submodule branch"
|
|
122
|
-
```
|
|
123
|
-
|
|
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
|
-
|
|
126
|
-
```bash
|
|
127
|
-
cd {spec_source}
|
|
128
|
-
git fetch origin
|
|
129
|
-
git checkout {spec_branch} # branch resolved in Step 0-D
|
|
130
|
-
git pull origin {spec_branch}
|
|
131
|
-
cd - # back to umbrella root
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
In: `Spec submodule {spec_source}: pulled branch '{spec_branch}' (source: {spec_branch_source})`
|
|
135
|
-
|
|
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
|
-
|
|
138
|
-
Nếu `git pull` hoặc `git submodule update` exit khác 0 → in lỗi và dừng với `❌`.
|
|
139
|
-
|
|
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
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Step 1d — Surface Feedback của Tester/QC *(bug report / scenario proposal / PRD change request)*
|
|
148
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
158
|
-
Nếu `feedback/` không tồn tại trong REPO → skip âm thầm.
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
git -C {REPO} diff --name-status {old_sha}..{new_sha} -- feedback/bug-reports/ feedback/bdd-proposals/ feedback/prd-change-requests/
|
|
162
|
-
```
|
|
163
|
-
|
|
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
|
-
```
|
|
166
|
-
📥 New feedback (pulled this sync):
|
|
167
|
-
Bug reports (open):
|
|
168
|
-
BUG-20260608-01 FT-001 — account locks after 6 fails (spec says 5) [layer: Code · waiting: dev]
|
|
169
|
-
Bug reports (fixed, awaiting QC re-verify): BUG-20260605-02
|
|
170
|
-
Scenario proposals:
|
|
171
|
-
FT-001-trailing-spaces.md → maps to AC2 (pending review)
|
|
172
|
-
PRD change requests:
|
|
173
|
-
FT-001-bulk-export.md → new requirement, needs an AC (waiting: PO)
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Nếu không có gì đổi → in `📥 Feedback: none new this sync`.
|
|
177
|
-
|
|
178
|
-
Nếu người đọc là PO/Dev, thêm một dòng nudge:
|
|
179
|
-
`→ Review feedback/ then act: /fix-bug {BUG-ID} · promote proposal via /generate-bdd · or add an AC to the PRD.`
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Step 2 — Post-sync State Check
|
|
184
|
-
|
|
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
|
-
|
|
187
|
-
Nếu pointer submodule nào đổi (thường là spec submodule sau `--remote`):
|
|
188
|
-
```
|
|
189
|
-
⚠️ Submodule pointer(s) updated — commit to lock new version into umbrella:
|
|
190
|
-
git add {spec_source} && git commit -m "chore: sync {spec_source} to latest"
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
Nếu không có thay đổi → `✅ Umbrella state clean — no commit needed`.
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## Step 3 — Bootstrap Service Configs
|
|
198
|
-
|
|
199
|
-
*Skip nếu `services` rỗng.*
|
|
200
|
-
|
|
201
|
-
**Trước tiên — làm phẳng `services` thành danh sách submodule.** Một giá trị trong `services` có thể lồng tới ba tầng (xem `context-loader.md` Bước 1.5), nên duyệt nông sẽ **bỏ sót** submodule:
|
|
202
|
-
|
|
203
|
-
| Dạng | Cách lấy submodule |
|
|
204
|
-
|---|---|
|
|
205
|
-
| `services.{domain}.path` (2a) | một entry |
|
|
206
|
-
| `services.{domain}.{platform}.path` (2b) | một entry mỗi platform |
|
|
207
|
-
| `…by_prd_slug.{slug}.path` (2c) | một entry mỗi `slug` — ở cấp domain hoặc cấp platform |
|
|
208
|
-
|
|
209
|
-
Kết quả là tập các cặp `{path, module}` **duy nhất theo `path`** (nhiều domain/platform/slug có thể trỏ chung một submodule — chỉ xử lý một lần). Mọi bước dưới đây chạy trên danh sách đã làm phẳng này.
|
|
210
|
-
|
|
211
|
-
Với mỗi entry trong danh sách đó:
|
|
212
|
-
|
|
213
|
-
**A. Nếu `{service.path}/.agent/project-context.yaml` đã tồn tại:**
|
|
214
|
-
- Đọc `conventions.test_command` và `conventions.build_command`
|
|
215
|
-
- Report: `✅ {service.path} — test: {test_command} | build: {build_command}`
|
|
216
|
-
|
|
217
|
-
**B. Nếu thiếu — tự tạo:**
|
|
218
|
-
|
|
219
|
-
1. Xác định `module` từ umbrella `services[].module` (authoritative). Nếu không set, auto-detect từ file trong `{service.path}/`:
|
|
220
|
-
|
|
221
|
-
| File có mặt | Module phát hiện | test_command | build_command |
|
|
222
|
-
|---|---|---|---|
|
|
223
|
-
| `pom.xml` | `java-spring` | `mvn test` | `mvn compile` |
|
|
224
|
-
| `build.gradle` or `build.gradle.kts` | `java-spring` | `./gradlew test` | `./gradlew build` |
|
|
225
|
-
| `go.mod` | `golang` | `go test ./...` | `go build ./...` |
|
|
226
|
-
| `*.csproj` or `*.sln` | `dotnet` | `dotnet test` | `dotnet build` |
|
|
227
|
-
| `composer.json` | `php-laravel` | `php artisan test` | `composer install` |
|
|
228
|
-
| `pubspec.yaml` | `flutter` | `flutter test` | `flutter build apk` |
|
|
229
|
-
| `angular.json` | `angular` | `npx ng test --watch=false` | `npm run build` |
|
|
230
|
-
| `next.config.*` | `nextjs` | `npx vitest run` | `npm run build` |
|
|
231
|
-
| `package.json` + `nest-cli.json` | `nestjs` | `npm test` | `npm run build` |
|
|
232
|
-
| `package.json` (fallback) | `react` | `npx vitest run` | `npm run build` |
|
|
233
|
-
| `requirements.txt` or `pyproject.toml` | `context-engineering` | `pytest tests/ -v` | `pip install -r requirements.txt` |
|
|
234
|
-
| *(none matched)* | `unknown` | `{{TEST_COMMAND}}` | `{{BUILD_COMMAND}}` |
|
|
235
|
-
|
|
236
|
-
2. Tạo thư mục `{service.path}/.agent/` nếu chưa có.
|
|
237
|
-
|
|
238
|
-
3. Ghi `{service.path}/.agent/project-context.yaml`:
|
|
239
|
-
|
|
240
|
-
```yaml
|
|
241
|
-
# Auto-generated by /sync — review and update as needed
|
|
242
|
-
tech_stack:
|
|
243
|
-
language: "{detected or from module}"
|
|
244
|
-
framework: "{detected or from module}"
|
|
245
|
-
module: "{module}"
|
|
246
|
-
|
|
247
|
-
conventions:
|
|
248
|
-
test_command: "{test_command}"
|
|
249
|
-
build_command: "{build_command}"
|
|
250
|
-
|
|
251
|
-
paths:
|
|
252
|
-
trace_dir: ".trace"
|
|
253
|
-
lessons_file: ".agent/project-lessons.md" # per-service guardrails (see /learn)
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
4. Report:
|
|
257
|
-
- Nếu auto-detect: `✅ Created {service.path}/.agent/project-context.yaml (module: {module}, test: {test_command})`
|
|
258
|
-
- Nếu unknown/placeholder: `⚠️ Created {service.path}/.agent/project-context.yaml — fill in {{TEST_COMMAND}} and {{BUILD_COMMAND}}`
|
|
259
|
-
|
|
260
|
-
---
|
|
261
|
-
|
|
262
|
-
## Step 4 — Check `.gitignore`
|
|
263
|
-
|
|
264
|
-
*Bước này kiểm **hai chiều ngược nhau**, và nhầm chiều là mất dữ liệu — đọc bảng trước:*
|
|
265
|
-
|
|
266
|
-
| Đường dẫn | Vai trò | Kỳ vọng |
|
|
267
|
-
|---|---|---|
|
|
268
|
-
| `{paths.trace_dir}` (`.trace/` hoặc `{spec_source}/.trace/`) | **AUTHORITATIVE** — TSV + `trace-history.jsonl`, không regenerate được | **PHẢI commit** — gitignore nó là **lỗi nghiêm trọng** |
|
|
269
|
-
| `.trace-mirror/` | bản sao tiện cho panel VS Code | phải gitignore |
|
|
270
|
-
| `.living-docs/` | report sinh ra | phải gitignore |
|
|
271
|
-
|
|
272
|
-
**4a. Cảnh báo mềm — mirror chưa gitignore.**
|
|
273
|
-
Kiểm `.trace-mirror/` trong `.gitignore` của repo hiện tại (hoặc `.git/info/exclude`), và `.living-docs/` trong `.gitignore` của **specs module** (khi `setup.spec_source` được set). Thiếu cái nào:
|
|
274
|
-
```
|
|
275
|
-
⚠️ Mirror chưa gitignore — chúng được sinh ra, đừng bao giờ commit:
|
|
276
|
-
echo ".trace-mirror/" >> .gitignore
|
|
277
|
-
echo ".living-docs/" >> {spec_source}/.gitignore # specs module (nếu có spec_source)
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
**4b. 🔴 Báo động — sổ gốc ĐANG bị bỏ qua.**
|
|
281
|
-
Phân giải `{paths.trace_dir}`; nếu nó nằm trong một git repo, chạy `git -C {repo} check-ignore -q {trace_dir}`. **Trúng** (exit 0) → in ngay, mức chặn:
|
|
282
|
-
```
|
|
283
|
-
🔴 NGUY HIỂM — sổ gốc trace ĐANG bị git bỏ qua: {paths.trace_dir}
|
|
284
|
-
Toàn bộ trạng thái theo dõi (spec_ver · gen_ver · implemented_by · test_count ·
|
|
285
|
-
dev_selftest · qc_status) VÀ trace-history.jsonl KHÔNG được lưu vào git.
|
|
286
|
-
Người khác clone repo về sẽ không thấy gì, và lịch sử thì KHÔNG dựng lại được.
|
|
287
|
-
|
|
288
|
-
Sửa:
|
|
289
|
-
1. Gỡ dòng khớp `.trace` khỏi .gitignore của {repo}
|
|
290
|
-
2. git -C {repo} add -f {trace_dir} && git -C {repo} commit -m "restore trace state"
|
|
291
|
-
Nguyên nhân thường gặp: bản trước v0.4.3 gọi panel mirror là `.trace` (trùng tên sổ gốc),
|
|
292
|
-
nên gợi ý "gitignore .trace/" của chính lệnh này có thể đã nhắm trúng sổ gốc.
|
|
293
|
-
```
|
|
294
|
-
> **Vì sao cần báo động này:** trước v0.4.3, mirror và sổ gốc **cùng tên `.trace`**. Khi dev mở thẳng spec repo làm workspace thì hai path bằng nhau — và Step 4 (bản cũ) gợi ý gitignore theo **tên**, không theo vai trò. Làm theo là mất sổ gốc, **im lặng**: máy vẫn chạy, dashboard vẫn có số; chỉ người thứ hai clone về mới phát hiện. Bản v0.4.3 đổi tên mirror thành `.trace-mirror` để cái bẫy biến mất, nhưng **dự án đã dính từ trước thì vẫn dính** — 4b là để tìm ra chúng.
|
|
295
|
-
|
|
296
|
-
---
|
|
297
|
-
|
|
298
|
-
## Step 5 — Refresh Living Docs *(chỉ umbrella mode)*
|
|
299
|
-
|
|
300
|
-
*Skip nếu `services` rỗng.*
|
|
301
|
-
|
|
302
|
-
**Phân giải Living Docs home (cùng quy tắc như `/validate-traces`):**
|
|
303
|
-
- `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.)*
|
|
304
|
-
- `panel_mirror` = `./.trace-mirror` ở gốc workspace hiện tại. *(Cố ý KHÁC tên `.trace` — xem Step 4.)*
|
|
305
|
-
|
|
306
|
-
1. Với mỗi service trong danh sách **đã làm phẳng** ở Step 3 (gồm cả các submodule nằm dưới `by_prd_slug` — bỏ sót chúng là mất trace của các repo chia theo feature): 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).
|
|
307
|
-
2. Ghi merged `{living_docs_dir}/trace-report.json`:
|
|
308
|
-
- Tổng hợp TSV `.trace/` của mỗi service, thêm field `"service"` **và `"platform"`** (suy từ tên file `{UC-ID}-{platform}.tsv`) cho mỗi row, tính lại summary totals. **Không dedupe theo `sc_id` giữa các platform** — `web·SC1` và `system·SC1` là 2 row khác nhau; nhờ field `platform` dashboard hiển thị tách bạch coverage từng platform.
|
|
309
|
-
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`, hoặc nếu `{paths.trace_dir}` đã nằm trong workspace hiện tại (panel đọc thẳng ở đó). **KHÔNG** copy `trace-history.jsonl` — nó là dữ liệu tích luỹ, không phải thứ sinh lại được.
|
|
310
|
-
|
|
311
|
-
In kết quả sync:
|
|
312
|
-
```
|
|
313
|
-
Living Docs → {living_docs_dir}/ synced (canonical, specs module)
|
|
314
|
-
{service-name}: {N} TSVs
|
|
315
|
-
trace-report.json: {total} scenarios across {S} services
|
|
316
|
-
Panel mirror → {panel_mirror}/ (current workspace)
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
Nếu không tìm thấy dir `.trace/` → `Living Docs: no trace data yet — run /generate-bdd then /generate-code first.`
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
## Step 6 — Refresh Spec Manifest *(nếu có spec_source)*
|
|
324
|
-
|
|
325
|
-
*Skip nếu `setup.spec_source` vắng.*
|
|
326
|
-
|
|
327
|
-
Nếu `spec-manifest.yaml` tồn tại HOẶC `setup.spec_source` được cấu hình:
|
|
328
|
-
- 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)
|
|
329
|
-
- Rebuild `spec-manifest.yaml` map TICKET-ID → path PRD/BDD/tech-doc
|
|
330
|
-
- In: `spec-manifest.yaml refreshed — {N} features indexed`
|
|
331
|
-
|
|
332
|
-
---
|
|
333
|
-
|
|
334
|
-
## Output
|
|
335
|
-
|
|
336
|
-
{{include:steps/report-footer.md}}
|
|
337
|
-
|
|
338
|
-
```
|
|
339
|
-
/sync — {Setup | Update}
|
|
340
|
-
|
|
341
|
-
Git
|
|
342
|
-
✅ git pull — umbrella on branch '{umbrella_branch}'
|
|
343
|
-
✅ submodule sync — .gitmodules config refreshed
|
|
344
|
-
|
|
345
|
-
Submodules (each handled by its current state)
|
|
346
|
-
✅ {spec_source} [spec] — pulled branch '{spec_branch}' ({spec_branch_source}) → {new-sha}
|
|
347
|
-
✋ user-service [active] — on 'feature/FEAT-01' — left untouched, fetched (↓2 behind origin)
|
|
348
|
-
✅ order-service [passive] — aligned to umbrella pointer {sha}
|
|
349
|
-
⚠️ payment-service [dirty] — uncommitted changes, skipped (commit/stash first)
|
|
350
|
-
|
|
351
|
-
Umbrella state
|
|
352
|
-
⚠️ Pointer changed: git add {spec_source} && git commit -m "chore: sync specs"
|
|
353
|
-
(or: ✅ Clean — no commit needed)
|
|
354
|
-
|
|
355
|
-
Tester feedback (pulled this sync)
|
|
356
|
-
📥 1 bug report: BUG-20260608-01 FT-001 [Code]
|
|
357
|
-
1 proposal: FT-001-trailing-spaces → AC2 (pending review)
|
|
358
|
-
(or: 📥 none new this sync)
|
|
359
|
-
→ /fix-bug {BUG-ID} · promote proposal into BDD · or update PRD
|
|
360
|
-
|
|
361
|
-
Service Configs
|
|
362
|
-
✅ user-service — test: mvn test | build: mvn compile
|
|
363
|
-
✅ order-service — test: mvn test | build: mvn compile
|
|
364
|
-
⚠️ payment-service — .agent/project-context.yaml missing
|
|
365
|
-
→ create it so /dev-run-test works correctly
|
|
366
|
-
|
|
367
|
-
.gitignore
|
|
368
|
-
✅ .trace-mirror/ + .living-docs/ gitignored (mirror — sinh lại được)
|
|
369
|
-
✅ {paths.trace_dir}/ KHÔNG bị gitignore (sổ gốc — phải commit)
|
|
370
|
-
(hoặc: ⚠️ Thêm .trace-mirror/ vào .gitignore)
|
|
371
|
-
(hoặc: 🔴 NGUY HIỂM — sổ gốc {paths.trace_dir} đang bị gitignore, xem Step 4b)
|
|
372
|
-
|
|
373
|
-
Living Docs
|
|
374
|
-
✅ {panel_mirror}/ synced — {N} TSVs across {S} services
|
|
375
|
-
(chạy /validate-traces để có report coverage đầy đủ)
|
|
376
|
-
|
|
377
|
-
Spec Manifest
|
|
378
|
-
✅ spec-manifest.yaml — {N} features indexed
|
|
379
|
-
|
|
380
|
-
---
|
|
381
|
-
Status : ✅ Complete | ⚠️ Warnings
|
|
382
|
-
Output Artifacts: updated .trace-mirror/ (panel mirror), spec-manifest.yaml
|
|
383
|
-
Next : /validate-traces (full coverage check) | /generate-code {UC-ID} (start coding)
|
|
384
|
-
```
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
# /update-framework — Cập nhật SDD Framework Framework
|
|
2
|
-
|
|
3
|
-
Nâng cấp **framework tooling** (`.agent/commands/`, `steps/`, `modules/`, `hooks/`, `rules/`, `templates/`, `skills/`) lên version mới nhất publish trên npm.
|
|
4
|
-
|
|
5
|
-
> **Không giống `/sync`.**
|
|
6
|
-
> - `/sync` → pull **nội dung dự án** (code/specs submodule) + làm mới Living Docs. Chạy hằng ngày.
|
|
7
|
-
> - `/update-framework` → nâng cấp **chính các file command của framework**. Chạy thỉnh thoảng, khi có version framework mới.
|
|
8
|
-
|
|
9
|
-
Lệnh này wrap `npx @educa-corp/sdd-framework@latest --init`. Cần network + npm access.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Step 0 — Phát hiện trạng thái hiện tại
|
|
14
|
-
|
|
15
|
-
1. Đọc `.agent/FRAMEWORK_VERSION` → version đang cài.
|
|
16
|
-
- Nếu thiếu → dự án này không được cài qua `--init`. Dừng:
|
|
17
|
-
```
|
|
18
|
-
❌ .agent/FRAMEWORK_VERSION not found.
|
|
19
|
-
This project was not set up with the framework installer.
|
|
20
|
-
Run: npx @educa-corp/sdd-framework --init
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
2. Đọc `.agent/project-context.yaml` → trích `setup.mode` (`umbrella` / vắng = single) và `services`.
|
|
24
|
-
|
|
25
|
-
3. Liệt kê `.agent/modules/` → ghi tên các module đã cài (phải truyền lại khi nâng cấp để chúng cũng update).
|
|
26
|
-
|
|
27
|
-
In:
|
|
28
|
-
```
|
|
29
|
-
Current framework : v{current}
|
|
30
|
-
Mode : {umbrella | single-service}
|
|
31
|
-
Installed modules : {list or "none"}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Step 1 — Kiểm tra version mới nhất
|
|
37
|
-
|
|
38
|
-
Chạy:
|
|
39
|
-
```bash
|
|
40
|
-
npm view @educa-corp/sdd-framework version
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
So `current` vs `latest`:
|
|
44
|
-
|
|
45
|
-
| Kết quả | Hành động |
|
|
46
|
-
|--------|--------|
|
|
47
|
-
| Network/registry không tới được | Cảnh báo `⚠️ Could not reach npm registry — check connection.` và dừng |
|
|
48
|
-
| `current == latest` | In `✅ Already up to date (v{current}). Nothing to do.` và dừng |
|
|
49
|
-
| `latest > current` | In `Update available: v{current} → v{latest}` và tiếp tục |
|
|
50
|
-
|
|
51
|
-
Hỏi: `Proceed with upgrade? (Y/N)` — chờ `Y`.
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Step 2 — Umbrella Awareness *(chỉ umbrella mode)*
|
|
56
|
-
|
|
57
|
-
Nếu `setup.mode == umbrella`, in note này trước khi nâng cấp:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
ℹ️ Umbrella mode — framework tooling lives ONLY at this umbrella root.
|
|
61
|
-
Service submodules contain just .agent/project-context.yaml (config), not
|
|
62
|
-
command files — they read commands from the umbrella root. No per-service
|
|
63
|
-
framework update is needed here.
|
|
64
|
-
|
|
65
|
-
Exception: if a teammate opens Claude Code directly INSIDE a service repo
|
|
66
|
-
(outside the umbrella), that repo has its own .agent/ — its owning team runs
|
|
67
|
-
/update-framework there independently.
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Step 3 — Pre-flight Git Check
|
|
73
|
-
|
|
74
|
-
Chạy `git status --short .agent/ .claude/commands/`.
|
|
75
|
-
|
|
76
|
-
Nếu có thay đổi chưa commit trong các path đó:
|
|
77
|
-
```
|
|
78
|
-
⚠️ Uncommitted changes in .agent/ or .claude/commands/.
|
|
79
|
-
The upgrade overwrites framework files. Commit or stash first so you can
|
|
80
|
-
cleanly review the upgrade diff:
|
|
81
|
-
git add .agent/ .claude/commands/ && git commit -m "wip" (or git stash)
|
|
82
|
-
```
|
|
83
|
-
Hỏi có tiếp tục không `(Y/N)`. Mặc định dừng.
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## Step 4 — Chạy nâng cấp
|
|
88
|
-
|
|
89
|
-
Dựng module flag từ Step 0 (một `--module {name}` cho mỗi module đã cài), rồi chạy:
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
npx -y @educa-corp/sdd-framework@latest --init {--module X ...}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Cái này **ghi đè** (làm mới về version mới):
|
|
96
|
-
- `.agent/commands/`, `.agent/steps/`, `.agent/hooks/`, `.agent/rules/`, `.agent/templates/`, `.agent/skills/`, `.agent/modules/{installed}/`
|
|
97
|
-
- `.agent/FRAMEWORK_VERSION`
|
|
98
|
-
- `.claude/commands/` shortcuts
|
|
99
|
-
|
|
100
|
-
Cái này **KHÔNG đụng tới** (nội dung của bạn an toàn):
|
|
101
|
-
- `.agent/project-context.yaml`
|
|
102
|
-
- `CLAUDE.md`
|
|
103
|
-
- `specs/domain-knowledge/` (business-dictionary, core-entities)
|
|
104
|
-
- `.trace/`
|
|
105
|
-
|
|
106
|
-
Nếu lệnh npx exit khác 0 → in lỗi và dừng với `❌`.
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Step 5 — Review Changes
|
|
111
|
-
|
|
112
|
-
Chạy:
|
|
113
|
-
```bash
|
|
114
|
-
git diff --stat .agent/ .claude/commands/
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Tóm tắt cho người dùng:
|
|
118
|
-
- **New commands** — file `.md` giờ có mà trước không
|
|
119
|
-
- **Updated commands** — file có nội dung thay đổi
|
|
120
|
-
- **Removed commands** — file bị xoá trong version mới
|
|
121
|
-
|
|
122
|
-
Nếu có command mới xuất hiện (vd một slash command mới), nêu rõ để user biết nó giờ đã có.
|
|
123
|
-
|
|
124
|
-
**Kiểm file bị ghi đè.** `--init` copy `core/` → `.agent/` **vô điều kiện** — mọi thứ project đã sửa trong `.agent/` (trừ `project-context.yaml`) bị ghi đè. Từ v0.4.2 lệnh cài tự cứu chúng. Kiểm:
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
ls -d .agent/.overwritten-*/ 2>/dev/null
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Nếu có → nêu **nổi bật** trong report (đây là thứ dễ trôi nhất trong một diff nâng cấp lớn):
|
|
131
|
-
```
|
|
132
|
-
⚠️ {n} file bạn sửa trong .agent/ đã bị bản nâng cấp ghi đè.
|
|
133
|
-
Bản cũ: .agent/.overwritten-{version}-{date}/
|
|
134
|
-
Xem diff: diff -r .agent/.overwritten-{version}-{date}/ .agent/
|
|
135
|
-
Sửa trực tiếp trong .agent/ KHÔNG bền — nó là mirror sinh ra. Muốn giữ thay đổi:
|
|
136
|
-
chuyển vào repo framework rồi phát hành, hoặc đặt ở CLAUDE.md /
|
|
137
|
-
.agent/project-context.yaml / .agent/project-lessons.md (ba chỗ không bị ghi đè).
|
|
138
|
-
Xử lý xong thì xoá thư mục backup.
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Nếu **không** có thư mục nào → không in gì. *(Ranh giới vùng-sửa-được đầy đủ: `.agent/README.md`.)*
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
## Step 5.5 — Kiểm bố cục spec cần migrate
|
|
146
|
-
|
|
147
|
-
*Chỉ quét, KHÔNG tự chuyển file — di chuyển spec là việc người dùng chốt.*
|
|
148
|
-
|
|
149
|
-
Một số version thay đổi **bố cục** spec, không chỉ nội dung command. Quét nhanh hai dạng cũ và in hướng dẫn nếu gặp:
|
|
150
|
-
|
|
151
|
-
| Phát hiện | Nghĩa | Lệnh migrate (dry-run trước) |
|
|
152
|
-
|---|---|---|
|
|
153
|
-
| Có file `.feature` **trực tiếp** dưới `{paths.specs_dir}/*/*/bdd/` (không trong subfolder platform) | Bố cục phẳng trước v0.4.1. `web`/`system` cùng UC va tên nhau; `/validate-traces` không thấy file; System BDD Synthesis luôn rơi về Backend-only. | `npx @educa-corp/sdd-framework --migrate-bdd-platform` → xem plan → thêm `--apply` |
|
|
154
|
-
| Có `{paths.specs_dir}/prd/` hoặc `{paths.specs_dir}/bdd/` ở cấp gốc | Bố cục artifact-type-first (rất cũ) | `npx @educa-corp/sdd-framework --migrate-specs` → `--apply` |
|
|
155
|
-
| Có `{paths.trace_dir}/*.tsv` phẳng (không có `{domain}/{prd-slug}/`) | Trace layout cũ | `--migrate-specs` (xử luôn) |
|
|
156
|
-
|
|
157
|
-
Nếu sạch cả ba → không in gì.
|
|
158
|
-
|
|
159
|
-
Sau migrate, nhắc chạy `/validate-traces` để reconcile sổ trace với bố cục mới.
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## Output
|
|
164
|
-
|
|
165
|
-
# Report Footer — Định dạng output chuẩn cho mọi lệnh
|
|
166
|
-
|
|
167
|
-
Mọi report của lệnh phải kết thúc bằng section footer chuẩn này.
|
|
168
|
-
|
|
169
|
-
## Status Badge
|
|
170
|
-
|
|
171
|
-
Chọn một theo kết quả:
|
|
172
|
-
- `✅ Complete` — mọi bước thành công, không có vấn đề
|
|
173
|
-
- `❌ Failed` — lệnh không hoàn thành được do lỗi chặn
|
|
174
|
-
- `⚠️ Warnings` — hoàn thành nhưng có vấn đề không chặn, nên review lại
|
|
175
|
-
|
|
176
|
-
## Output Artifacts
|
|
177
|
-
|
|
178
|
-
Liệt kê mọi file được tạo hoặc sửa bởi lệnh này:
|
|
179
|
-
```
|
|
180
|
-
Output Artifacts:
|
|
181
|
-
{created|updated} {file-path} ({mô tả ngắn})
|
|
182
|
-
{created|updated} {file-path} ({mô tả ngắn})
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
Nếu không ghi file nào (vd: lệnh review hoặc phân tích) → ghi `Output Artifacts: none (read-only)`.
|
|
186
|
-
|
|
187
|
-
## Pipeline Position
|
|
188
|
-
|
|
189
|
-
In một sơ đồ pipeline một dòng, đánh dấu phase của lệnh HIỆN TẠI bằng `◀ bạn ở đây`,
|
|
190
|
-
để người dùng luôn thấy lệnh này nằm ở đâu trong luồng end-to-end:
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
Tìm lệnh hiện tại trong bảng phase dưới đây và đánh dấu **phase của nó** trong sơ đồ trên:
|
|
197
|
-
|
|
198
|
-
| Phase | Commands |
|
|
199
|
-
|-------|----------|
|
|
200
|
-
| Discovery | `/define-product` |
|
|
201
|
-
| PRD | `/generate-prd` · `/extend-prd` · `/refine-prd` · `/review-context` (PRD) |
|
|
202
|
-
| Design Spec | `/generate-design-spec` |
|
|
203
|
-
| BDD | `/generate-bdd` · `/review-context` (BDD) |
|
|
204
|
-
| Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
|
|
205
|
-
| Code | `/generate-code` · `/review-code` |
|
|
206
|
-
| Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
|
|
207
|
-
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
208
|
-
| Trace Audit | `/validate-traces` |
|
|
209
|
-
|
|
210
|
-
Với **lệnh review**, thêm vòng review 3 bước và đánh dấu bước hiện tại, vd:
|
|
211
|
-
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
212
|
-
|
|
213
|
-
**Lệnh xuyên suốt** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
|
|
214
|
-
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) nằm ngoài pipeline tuyến tính —
|
|
215
|
-
**bỏ hẳn dòng Pipeline** cho các lệnh này (đừng cố nhét chúng vào sơ đồ).
|
|
216
|
-
|
|
217
|
-
## Gợi ý lệnh tiếp theo
|
|
218
|
-
|
|
219
|
-
Gợi ý lệnh kế tiếp hợp lý theo phase của workflow:
|
|
220
|
-
|
|
221
|
-
| Lệnh hiện tại | Gợi ý lệnh tiếp theo |
|
|
222
|
-
|-------------------------|-----------------------------------------------|
|
|
223
|
-
| /setup-ai-first | `/define-product` để bắt đầu feature đầu tiên |
|
|
224
|
-
| /define-product | `/generate-prd {product-definition-file}` |
|
|
225
|
-
| /generate-prd | `/refine-prd {prd-file}` rồi `/review-context {prd-file}` |
|
|
226
|
-
| /extend-prd | `/refine-prd {prd-file}` (soi phần vừa thêm) rồi `/review-context {prd-file}` → PO duyệt → `/generate-bdd` **chỉ cho UC MỚI**; UC cũ dùng `/validate-traces --realign-prd-version {UC-ID}` |
|
|
227
|
-
| /refine-prd | Mở Review Board → cập nhật PRD → `/review-context {prd-file}` |
|
|
228
|
-
| /review-context (PRD) | Khi 0 critical → PO đặt `Status: approved`, rồi FE/App: `/generate-design-spec {prd-file}` (→ design sign-off → BDD); BE: `/generate-bdd {prd-file}`. Còn critical/NEEDS_FIX → sửa PRD (giữ draft) |
|
|
229
|
-
| /generate-design-spec | Designer review → xác nhận link Figma → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
230
|
-
| /generate-bdd | `/review-context {feature-file}` để kiểm tra độ phủ |
|
|
231
|
-
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` nếu APPROVED; sinh lại nếu NEEDS_FIX |
|
|
232
|
-
| /qc-analyze | `/qc-plan {UC-ID}` (xử lý các gap blocker 🔴 trước) |
|
|
233
|
-
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
234
|
-
| /qc-design-test | `/qc-review {UC-ID}` (review test-case) |
|
|
235
|
-
| /qc-review (test-case) | `/qc-run-test {UC-ID}` nếu APPROVED; sửa TC nếu NEEDS_FIX |
|
|
236
|
-
| /qc-run-test | `/qc-report {UC-ID}` rồi `/qc-review {UC-ID}` (review script) |
|
|
237
|
-
| /qc-review (script) | `/qc-report {UC-ID}` rồi tạo PR nếu APPROVED |
|
|
238
|
-
| /qc-report | `/validate-traces {UC-ID}` để làm mới Living Docs (qc_status) |
|
|
239
|
-
| /map-testids | `/qc-design-test {UC-ID}` (QC dựng Page Object từ contract §4.5.6 vừa ghi) |
|
|
240
|
-
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
241
|
-
| /review-tech-docs | `/generate-code {feature-file}` nếu APPROVED; sửa doc nếu NEEDS_FIX |
|
|
242
|
-
| /generate-code | Lần gen đầu → `/review-code {UC-ID}`; gen lại → `/dev-gen-test {UC-ID}` |
|
|
243
|
-
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
244
|
-
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
245
|
-
| /dev-run-test (failing) | `/fix-bug {ticket-id}` hoặc `/debug {error}` |
|
|
246
|
-
| /review-code | `/dev-smoke-test {UC-ID}` hoặc tạo PR |
|
|
247
|
-
| /dev-smoke-test | Tạo PR và link tới ticket |
|
|
248
|
-
| /validate-traces | **Cờ 🔴 trước (chặn PR):** SEAM_UNWIRED → nối binding sang class thật, xoá/thay stub · STUB_UNRESOLVED → `/generate-code {owner_uc}` (lấp logic tại chỗ + xoá hàm song song) · ORPHANED/TRACE_ORPHAN → quyết định thủ công (xoá code+test, đưa scenario trở lại `.feature`, hoặc sửa `sc_id` của tag). **Rồi:** DRIFT/UNTRACKED → `/generate-code {UC-ID}` · BDD_DRIFT → `/generate-code {feature-file}` · tech-doc lỗi thời vs BDD → `/generate-tech-docs` → `/review-tech-docs` · PRD drift → `/generate-bdd {prd-file}` · GAP → `/dev-gen-test {UC-ID}`. **Chỉ tạo PR khi mọi cờ 🔴 = 0** |
|
|
249
|
-
| /fix-bug | `/dev-run-test {UC-ID}` (dev_selftest vừa reset về not_run) → tạo PR; nếu fix một `{BUG-ID}` → QC chạy `/qc-run-test {UC-ID}` để verify + đóng bug |
|
|
250
|
-
| /debug | `/fix-bug {ticket-id}` nếu cần sửa |
|
|
251
|
-
| /report-bug | Gửi cho dev (`/fix-bug {BUG-ID}`); nếu thiếu coverage → `/propose-scenario {UC-ID}` |
|
|
252
|
-
| /propose-scenario | **Case A** (thiếu scenario cho AC có sẵn) → báo PO/Dev review trong `feedback/bdd-proposals/`; `/generate-bdd` tự chèn khi `Status: accepted`. **Case B** (requirement mới) → `feedback/prd-change-requests/` — PO phải đưa vào PRD trước, KHÔNG tự vào BDD được; `/validate-traces` nhắc lại kèm số ngày chờ chừng nào `Status: Open` |
|
|
253
|
-
| /learn | Tiếp tục làm việc — lesson áp dụng ở lệnh kế tiếp |
|
|
254
|
-
| /sync | `/validate-traces` để xem độ phủ đầy đủ; xử lý mọi `📥 tester feedback` được nêu |
|
|
255
|
-
| /update-framework | Review `git diff .agent/`, commit; `/sync` để đồng bộ nội dung dự án |
|
|
256
|
-
|
|
257
|
-
Định dạng footer như sau:
|
|
258
|
-
```
|
|
259
|
-
---
|
|
260
|
-
Status : {badge}
|
|
261
|
-
{khối Output Artifacts}
|
|
262
|
-
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
263
|
-
(lệnh review) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
|
|
264
|
-
Next : {lệnh gợi ý kèm ví dụ tham số}
|
|
265
|
-
```
|
|
266
|
-
*(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
```
|
|
270
|
-
/update-framework — v{current} → v{latest}
|
|
271
|
-
|
|
272
|
-
✅ Framework upgraded
|
|
273
|
-
Updated : {N} command files, {M} step files
|
|
274
|
-
New : {list any new commands, e.g. /some-new-command}
|
|
275
|
-
Removed : {list any removed commands, or "none"}
|
|
276
|
-
|
|
277
|
-
Your content was preserved:
|
|
278
|
-
project-context.yaml, CLAUDE.md, domain-knowledge/, .trace/ — untouched
|
|
279
|
-
|
|
280
|
-
Review & commit:
|
|
281
|
-
git diff .agent/
|
|
282
|
-
git add .agent/ .claude/commands/
|
|
283
|
-
git commit -m "chore: upgrade spec-driven-docs v{current} → v{latest}"
|
|
284
|
-
{umbrella mode: this is the umbrella root — service submodules need no framework update}
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
Status : ✅ Complete | ⚠️ Warnings
|
|
288
|
-
Output Artifacts: refreshed .agent/ framework files, .claude/commands/ shortcuts
|
|
289
|
-
Next : review git diff, then commit | /sync to refresh project content
|
|
290
|
-
```
|