@educa-corp/sdd-framework 0.6.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/gate-trace.js +25 -2
- package/bin/index.js +32 -5
- package/bin/lint-trace.js +41 -0
- package/bin/self-check.js +430 -3
- package/bin/trace-schema.json +391 -30
- package/core/FRAMEWORK_VERSION +1 -1
- package/{commands/extend-prd.md → core/commands/amend-prd.md} +205 -173
- package/core/commands/dev-run-test.md +47 -9
- package/core/commands/extend-prd.md +39 -12
- package/core/commands/generate-bdd.md +43 -4
- package/core/commands/generate-code.md +33 -0
- package/core/commands/generate-tech-docs.md +34 -2
- package/core/commands/qc-run-test.md +29 -3
- package/core/commands/refine-prd.md +13 -2
- package/core/commands/review-context.md +43 -8
- package/core/commands/sync.md +105 -1
- package/core/commands/validate-traces.md +284 -11
- package/core/rules/workflow.md +34 -0
- package/core/steps/context-loader.md +26 -5
- package/core/templates/feature.template +1 -1
- package/docs/02-concepts/architecture.md +36 -0
- package/docs/04-reference/commands.md +148 -134
- 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/28-sync.md +25 -0
- package/docs/explain/README.md +136 -135
- package/package.json +1 -8
- package/commands/debug.md +0 -529
- package/commands/debug.tmpl +0 -260
- package/commands/define-product.md +0 -438
- package/commands/define-product.tmpl +0 -225
- package/commands/dev-gen-test.md +0 -700
- package/commands/dev-gen-test.tmpl +0 -490
- package/commands/dev-run-test.md +0 -435
- package/commands/dev-run-test.tmpl +0 -225
- package/commands/dev-smoke-test.md +0 -374
- package/commands/dev-smoke-test.tmpl +0 -217
- package/commands/extend-prd.tmpl +0 -273
- package/commands/fix-bug.md +0 -519
- package/commands/fix-bug.tmpl +0 -197
- package/commands/generate-architecture.md +0 -354
- package/commands/generate-architecture.tmpl +0 -197
- package/commands/generate-bdd.md +0 -923
- package/commands/generate-bdd.tmpl +0 -590
- package/commands/generate-code.md +0 -859
- package/commands/generate-code.tmpl +0 -649
- package/commands/generate-design-spec.md +0 -737
- package/commands/generate-design-spec.tmpl +0 -524
- package/commands/generate-prd.md +0 -722
- package/commands/generate-prd.tmpl +0 -226
- package/commands/generate-spec-manifest.md +0 -321
- package/commands/generate-spec-manifest.tmpl +0 -164
- package/commands/generate-tech-docs.md +0 -920
- package/commands/generate-tech-docs.tmpl +0 -273
- package/commands/learn.md +0 -399
- package/commands/learn.tmpl +0 -130
- package/commands/map-testids.md +0 -238
- package/commands/map-testids.tmpl +0 -81
- package/commands/propose-scenario.md +0 -359
- package/commands/propose-scenario.tmpl +0 -202
- package/commands/qc-analyze.md +0 -269
- package/commands/qc-analyze.tmpl +0 -112
- package/commands/qc-design-test.md +0 -226
- package/commands/qc-design-test.tmpl +0 -69
- package/commands/qc-plan.md +0 -206
- package/commands/qc-plan.tmpl +0 -49
- package/commands/qc-report.md +0 -217
- package/commands/qc-report.tmpl +0 -60
- package/commands/qc-review.md +0 -210
- package/commands/qc-review.tmpl +0 -53
- package/commands/qc-run-test.md +0 -326
- package/commands/qc-run-test.tmpl +0 -116
- package/commands/refine-prd.md +0 -653
- package/commands/refine-prd.tmpl +0 -281
- package/commands/report-bug.md +0 -305
- package/commands/report-bug.tmpl +0 -148
- package/commands/review-code.md +0 -415
- package/commands/review-code.tmpl +0 -146
- package/commands/review-context.md +0 -902
- package/commands/review-context.tmpl +0 -530
- package/commands/review-tech-docs.md +0 -561
- package/commands/review-tech-docs.tmpl +0 -404
- package/commands/setup-ai-first.md +0 -602
- package/commands/setup-ai-first.tmpl +0 -450
- package/commands/sync.md +0 -430
- package/commands/sync.tmpl +0 -429
- package/commands/update-framework.md +0 -203
- package/commands/update-framework.tmpl +0 -202
- package/commands/validate-traces.md +0 -1077
- package/commands/validate-traces.tmpl +0 -920
- package/hooks/data-guard.js +0 -232
- package/hooks/settings.json +0 -19
- 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 -99
- 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 -112
- package/steps/context-loader.md +0 -406
- package/steps/gate.md +0 -151
- package/steps/report-footer.md +0 -125
- 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 -70
- package/templates/architecture.template.md +0 -394
- package/templates/ci/trace-gate.yml +0 -146
- package/templates/design-spec.template.md +0 -217
- package/templates/feature.template +0 -123
- package/templates/hooks/pre-push +0 -61
- 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
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
# /review-code — Code Review chỉ-đọc
|
|
2
|
-
|
|
3
|
-
**CẢNH BÁO: READ-ONLY. Chỉ report, KHÔNG sửa.**
|
|
4
|
-
|
|
5
|
-
## Gate
|
|
6
|
-
|
|
7
|
-
*Checkpoint: **không chặn** — read-only. Gate Bước 3 bỏ qua CHECKPOINT (Bước 3a).*
|
|
8
|
-
|
|
9
|
-
{{include:steps/gate.md}}
|
|
10
|
-
|
|
11
|
-
*Lưu ý: Với lệnh này, target ở Bước 1 là một UC-ID, file path, hoặc tên branch hiện tại. Bỏ qua sang nạp context ngay sau khi phân giải target.*
|
|
12
|
-
|
|
13
|
-
## Context
|
|
14
|
-
{{include:steps/context-loader.md}}
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Pre-Review Scan
|
|
19
|
-
|
|
20
|
-
*(Tách khỏi CHECKPOINT của Gate — phần này liệt kê file và scenario thực tế trong scope.)*
|
|
21
|
-
|
|
22
|
-
Quét tìm file implementation và scenario, rồi hiện:
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
Review Scope — {UC-ID}
|
|
26
|
-
──────────────────────────────────────
|
|
27
|
-
UC : {UC-ID}
|
|
28
|
-
Files : {danh sách file gắn tag @trace.implements={UC-ID}}
|
|
29
|
-
Scenarios : {N} scenario trong file .feature
|
|
30
|
-
|
|
31
|
-
Tiếp tục review? (Y/N)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Chờ "Y" rõ ràng trước khi tiếp tục.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Review Dimensions
|
|
39
|
-
|
|
40
|
-
### 1. Traceability
|
|
41
|
-
|
|
42
|
-
*Đây là lăng kính bảo vệ toàn bộ cơ chế drift-detection. `/generate-code` phải ghi **5 tag** lên mỗi entry-point (**6** với FE/App); thiếu bất kỳ tag nào thì `/validate-traces` mù ở file đó — **im lặng**, không lệnh nào khác bắt được.*
|
|
43
|
-
|
|
44
|
-
- [ ] Mỗi entry-point (layer theo CLAUDE.md §2) có `@trace.implements={UC-ID}-SC{N}`?
|
|
45
|
-
- [ ] **Mỗi block `@trace.implements` có đủ tag đi kèm?** → thiếu bất kỳ tag nào = **major** (không phải minor):
|
|
46
|
-
|
|
47
|
-
| Tag | Thiếu thì mù cái gì |
|
|
48
|
-
|---|---|
|
|
49
|
-
| `@trace.prd_version` | `/validate-traces` Step 4 — PRD drift |
|
|
50
|
-
| `@trace.bdd_version` | Step 5c — BDD drift |
|
|
51
|
-
| `@trace.tech_doc_revision` | Step 5 — tech-doc drift *(bỏ được nếu UC không có tech-doc)* |
|
|
52
|
-
| `@trace.design_spec_version` | Step 5d — design-spec drift. **CHỈ FE/App** (`@trace.platform` = `web`/`app`): thiếu ở FE = **major**; có ở `system`/backend = **minor** (tag thừa, không có design-spec để so) |
|
|
53
|
-
| `@trace.source` | mất con trỏ ngược về spec |
|
|
54
|
-
|
|
55
|
-
- [ ] `@trace.source` trỏ tới file `.feature` **có thật**, đúng platform (`bdd/{platform}/{UC-ID}-{slug}.feature`)? → sai path = **major**
|
|
56
|
-
- [ ] **File phủ nhiều UC: mỗi UC có block tag RIÊNG đặt trên method của nó?** → gộp về một header file, hoặc `@trace.source` trỏ **thư mục**, = **major**. Lý do: 4 tag version là scalar theo từng UC (gộp → Step 4/5/5c/5d báo drift oan hoặc mù drift thật); và các lệnh tra tag bằng **khớp chuỗi chính xác** nên tag trỏ folder ra 0 kết quả → UC rơi về `UNTRACKED` dù code đã có.
|
|
57
|
-
- [ ] Mỗi test file có tag `@trace.verifies={UC-ID}-SC{N}`?
|
|
58
|
-
- [ ] **Không có tag mồ côi** — `@trace.implements`/`@trace.verifies` trỏ tới SC **không tồn tại** trong `.feature`? → **critical** (`TRACE_ORPHAN`; xem `/validate-traces` Step 2b)
|
|
59
|
-
- [ ] Không có tag `@trace` ở sai layer?
|
|
60
|
-
- [ ] `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}-{platform}.tsv` cập nhật chưa? (nếu stale → chạy `/validate-traces {UC-ID}` trước, rồi chạy lại review này)
|
|
61
|
-
|
|
62
|
-
### 2. Layer Architecture (từ CLAUDE.md §2)
|
|
63
|
-
- [ ] Mỗi class ở đúng layer?
|
|
64
|
-
- [ ] Phụ thuộc giữa layer đi đúng chiều?
|
|
65
|
-
- [ ] Không layer nào bị bypass?
|
|
66
|
-
|
|
67
|
-
### 3. Coding Standards (từ CLAUDE.md §3)
|
|
68
|
-
- [ ] Tuân theo naming convention?
|
|
69
|
-
- [ ] Response wrapper dùng nhất quán?
|
|
70
|
-
- [ ] Exception được throw (không bị nuốt)?
|
|
71
|
-
- [ ] Không magic number, không dữ liệu nhạy cảm trong log?
|
|
72
|
-
- [ ] Annotation transaction đúng?
|
|
73
|
-
|
|
74
|
-
### 4. Spec Compliance
|
|
75
|
-
- [ ] Mỗi scenario trong .feature có implementation?
|
|
76
|
-
- [ ] Không có endpoint không tài liệu (code không có spec backing)?
|
|
77
|
-
|
|
78
|
-
### 5. Seam & Stub — mồ côi khi ghép luồng
|
|
79
|
-
|
|
80
|
-
*`/generate-code` vừa sinh ra sổ `_seams.tsv` ở bước trước. Đây là lớp lỗi mà **build xanh + test từng-UC xanh** vẫn không bắt được: luồng ghép chạy vào no-op, hoặc hàm thật không ai gọi. `/validate-traces` Step 5b cũng soi — trùng có chủ đích, vì bắt ở đây rẻ hơn (ngay sau codegen, trước khi sinh test).*
|
|
81
|
-
|
|
82
|
-
Đọc sổ `{paths.trace_dir}/{domain}/{prd-slug}/_seams.tsv` (nếu có) + quét code dưới `{code_base_package}`:
|
|
83
|
-
|
|
84
|
-
- [ ] Sổ **0 dòng** `status = READY`? (`READY` = đồng nghĩa cờ 🔴 `SEAM_UNWIRED` / `STUB_UNRESOLVED`) → còn dòng nào = **critical**
|
|
85
|
-
- [ ] Không có class `*Stub*`/`*Mock*` nào **còn là binding đang dùng** trong khi hàng thật đã tồn tại? → `SEAM_UNWIRED`, **critical**
|
|
86
|
-
- [ ] Không có method nào còn `@trace.stub` rỗng trong khi `@trace.stub_owner` **đã gen**? → `STUB_UNRESOLVED`, **critical**
|
|
87
|
-
- [ ] Không có method thật **mồ côi** — logic thật được đẻ **song song** thay vì lấp vào stub cũ (Fill-before-create bị trượt)? → **critical**
|
|
88
|
-
- [ ] Mỗi stub/seam **mới** sinh trong lần này có đủ tag (`@trace.stub` + `@trace.stub_owner` + `@trace.stub_for`, hoặc `@trace.seam_pending` + `@trace.seam_port`) **và** một dòng `PENDING` trong sổ? → thiếu = **major** (nợ không ghi sổ = nợ tàng hình)
|
|
89
|
-
|
|
90
|
-
> `SEAM_PENDING` / `STUB_PENDING` (owner UC chưa gen) là **bình thường** — chỉ nhắc, không tạo finding.
|
|
91
|
-
|
|
92
|
-
## Output
|
|
93
|
-
|
|
94
|
-
{{include:steps/report-footer.md}}
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
/review-code Report — {UC-ID}
|
|
98
|
-
Critical: {X} | Major: {Y} | Minor: {Z}
|
|
99
|
-
|
|
100
|
-
### Critical
|
|
101
|
-
| # | File | Line | Issue | Suggested Fix |
|
|
102
|
-
|
|
103
|
-
### Major
|
|
104
|
-
| # | File | Line | Issue | Suggested Fix |
|
|
105
|
-
|
|
106
|
-
### Minor
|
|
107
|
-
| # | File | Line | Issue | Suggested Fix |
|
|
108
|
-
|
|
109
|
-
Output Artifacts: none (read-only)
|
|
110
|
-
|
|
111
|
-
Verdict: APPROVED ✅ | NEEDS_FIX ❌
|
|
112
|
-
(Bất kỳ finding critical nào ở lăng kính 5 → NEEDS_FIX, KỂ CẢ khi build xanh
|
|
113
|
-
và test từng-UC xanh — đó chính là loại lỗi hai thứ đó không bắt được.)
|
|
114
|
-
|
|
115
|
-
Nếu APPROVED ✅:
|
|
116
|
-
Next: /dev-gen-test {UC-ID}
|
|
117
|
-
|
|
118
|
-
Nếu NEEDS_FIX ❌:
|
|
119
|
-
- Fix nhỏ (1–3 dòng, không đổi logic) → fix inline → chạy lại /review-code {UC-ID}
|
|
120
|
-
- Thiếu tag version / @trace.source sai → bổ sung tại chỗ (giá trị lấy từ header .feature
|
|
121
|
-
+ tech-doc), rồi chạy lại /validate-traces {UC-ID}
|
|
122
|
-
- Tag mồ côi (TRACE_ORPHAN) → sửa sc_id cho đúng SC hiện có, hoặc xoá code/test
|
|
123
|
-
nếu behavior không còn cần
|
|
124
|
-
- SEAM_UNWIRED 🔴 → trỏ binding sang class thật, xoá/thay stub, build lại
|
|
125
|
-
- STUB_UNRESOLVED 🔴 → /generate-code {owner_uc} (lấp logic TẠI CHỖ vào
|
|
126
|
-
method trắng, xoá hàm song song)
|
|
127
|
-
- Vấn đề logic / kiến trúc → /fix-bug {TICKET_ID}
|
|
128
|
-
- Spec mismatch (code ≠ scenario) → /generate-code {feature-file} (gen lại UC bị ảnh hưởng)
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Đề xuất ghi Lessons (tuỳ chọn)
|
|
134
|
-
|
|
135
|
-
Với mỗi finding **Critical/Major** thể hiện một **lỗi AI lặp lại** trong quá trình sinh code
|
|
136
|
-
(một vi phạm kiến trúc/standards mà AI có khả năng làm lại — KHÔNG phải typo một lần hay nguyên nhân bên ngoài), hỏi:
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
Finding "{issue}" trông như một lỗi lặp lại.
|
|
140
|
-
Ghi nó thành project lesson để /generate-code không lặp lại? (Y/N)
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Nếu `Y` → chạy quy trình capture bên dưới với `category=code-gen`, `source=/review-code {UC-ID}`,
|
|
144
|
-
`scope` = domain hoặc file glob bị ảnh hưởng.
|
|
145
|
-
|
|
146
|
-
{{include:steps/capture-lesson.md}}
|