@edupia-tutor/spec-driven-docs 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +12 -1
- package/commands/debug.md +436 -436
- package/commands/debug.tmpl +111 -111
- package/commands/define-product.md +350 -345
- package/commands/define-product.tmpl +69 -64
- package/commands/dev-gen-test.md +365 -365
- package/commands/dev-gen-test.tmpl +63 -63
- package/commands/dev-run-test.md +376 -376
- package/commands/dev-run-test.tmpl +74 -74
- package/commands/dev-smoke-test.md +341 -341
- package/commands/dev-smoke-test.tmpl +60 -60
- package/commands/fix-bug.md +403 -403
- package/commands/fix-bug.tmpl +78 -78
- package/commands/generate-bdd.md +513 -513
- package/commands/generate-bdd.tmpl +211 -211
- package/commands/generate-code.md +481 -483
- package/commands/generate-code.tmpl +179 -181
- package/commands/generate-design-spec.md +497 -497
- package/commands/generate-design-spec.tmpl +220 -220
- package/commands/generate-prd.md +452 -400
- package/commands/generate-prd.tmpl +50 -200
- package/commands/generate-spec-manifest.md +340 -340
- package/commands/generate-spec-manifest.tmpl +59 -59
- package/commands/generate-tech-docs.md +365 -365
- package/commands/generate-tech-docs.tmpl +84 -84
- package/commands/learn.md +347 -347
- package/commands/learn.tmpl +22 -22
- package/commands/map-testids.md +322 -322
- package/commands/map-testids.tmpl +41 -41
- package/commands/propose-scenario.md +335 -335
- package/commands/propose-scenario.tmpl +54 -54
- package/commands/qc-analyze.md +323 -324
- package/commands/qc-analyze.tmpl +42 -43
- package/commands/qc-design-test.md +304 -304
- package/commands/qc-design-test.tmpl +23 -23
- package/commands/qc-plan.md +297 -297
- package/commands/qc-plan.tmpl +16 -16
- package/commands/qc-report.md +302 -302
- package/commands/qc-report.tmpl +21 -21
- package/commands/qc-review.md +298 -298
- package/commands/qc-review.tmpl +17 -17
- package/commands/qc-run-test.md +337 -337
- package/commands/qc-run-test.tmpl +35 -35
- package/commands/refine-prd.md +428 -430
- package/commands/refine-prd.tmpl +62 -62
- package/commands/report-bug.md +351 -351
- package/commands/report-bug.tmpl +70 -70
- package/commands/review-code.md +364 -364
- package/commands/review-code.tmpl +39 -39
- package/commands/review-context.md +578 -580
- package/commands/review-context.tmpl +212 -212
- package/commands/review-tech-docs.md +427 -427
- package/commands/review-tech-docs.tmpl +146 -146
- package/commands/setup-ai-first.md +239 -239
- package/commands/setup-ai-first.tmpl +133 -133
- 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 +381 -381
- package/commands/validate-traces.tmpl +100 -100
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +436 -436
- package/core/commands/define-product.md +350 -345
- package/core/commands/dev-gen-test.md +365 -365
- package/core/commands/dev-run-test.md +376 -376
- package/core/commands/dev-smoke-test.md +341 -341
- package/core/commands/fix-bug.md +403 -403
- package/core/commands/generate-bdd.md +513 -513
- package/core/commands/generate-code.md +481 -483
- package/core/commands/generate-design-spec.md +497 -497
- package/core/commands/generate-prd.md +452 -400
- package/core/commands/generate-spec-manifest.md +340 -340
- package/core/commands/generate-tech-docs.md +365 -365
- package/core/commands/learn.md +347 -347
- package/core/commands/map-testids.md +322 -322
- package/core/commands/propose-scenario.md +335 -335
- package/core/commands/qc-analyze.md +323 -324
- package/core/commands/qc-design-test.md +304 -304
- package/core/commands/qc-plan.md +297 -297
- package/core/commands/qc-report.md +302 -302
- package/core/commands/qc-review.md +298 -298
- package/core/commands/qc-run-test.md +337 -337
- package/core/commands/refine-prd.md +428 -430
- package/core/commands/report-bug.md +351 -351
- package/core/commands/review-code.md +364 -364
- package/core/commands/review-context.md +578 -580
- package/core/commands/review-tech-docs.md +427 -427
- package/core/commands/setup-ai-first.md +239 -239
- package/core/commands/sync.md +145 -145
- package/core/commands/update-framework.md +88 -88
- package/core/commands/validate-traces.md +381 -381
- package/core/skills/code/SKILL.md +389 -389
- package/core/skills/debug/SKILL.md +391 -391
- package/core/skills/design-spec/SKILL.md +318 -318
- package/core/skills/discovery/SKILL.md +7 -547
- package/core/skills/prd/SKILL.md +298 -394
- package/core/skills/setup-ai-first/SKILL.md +80 -80
- package/core/skills/spec/SKILL.md +178 -178
- package/core/skills/test/SKILL.md +604 -604
- package/core/steps/capture-lesson.md +44 -44
- package/core/steps/context-loader.md +175 -175
- 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 +107 -232
- package/core/templates/product-definition.template.md +101 -88
- package/core/templates/project-context.yaml +2 -2
- package/docs/01-getting-started/core-concepts.md +1 -1
- package/docs/01-getting-started/quickstart.md +7 -7
- package/docs/02-guides/developer/bdd-and-trace.md +1 -1
- package/docs/02-guides/developer/scenarios.md +5 -5
- package/docs/02-guides/product-owner/handoff-checklist.md +1 -1
- package/docs/02-guides/product-owner/scenarios.md +23 -23
- package/docs/02-guides/tester/bug-reporting.md +2 -2
- package/docs/02-guides/tester/reading-specs.md +2 -2
- package/docs/02-guides/tester/scenarios.md +1 -1
- package/docs/02-guides/tester/spec-manifest.md +3 -3
- package/docs/02-guides/tester/workflow.md +1 -1
- package/docs/03-concepts/architecture.md +3 -3
- package/docs/03-concepts/pipeline.md +3 -3
- package/docs/04-operations/publishing.md +20 -3
- package/docs/04-operations/sync-and-update.md +5 -5
- package/docs/05-reference/command-cheatsheet.md +2 -2
- package/docs/05-reference/commands.md +8 -8
- package/package.json +1 -1
- package/scripts/migrate-specs.js +5 -3
- package/scripts/rename-prd-files.js +174 -0
- package/skills/code/SKILL.md +389 -389
- package/skills/code/SKILL.tmpl +56 -56
- package/skills/debug/SKILL.md +391 -391
- package/skills/debug/SKILL.tmpl +60 -60
- package/skills/design-spec/SKILL.md +318 -318
- package/skills/design-spec/SKILL.tmpl +37 -37
- 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 +80 -80
- package/skills/setup-ai-first/SKILL.tmpl +28 -28
- package/skills/spec/SKILL.md +178 -178
- package/skills/spec/SKILL.tmpl +20 -20
- package/skills/test/SKILL.md +604 -604
- package/skills/test/SKILL.tmpl +44 -44
- package/steps/capture-lesson.md +44 -44
- package/steps/context-loader.md +175 -175
- 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 +107 -232
- package/templates/product-definition.template.md +101 -88
- package/templates/project-context.yaml +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# /dev-gen-test —
|
|
1
|
+
# /dev-gen-test — Sinh Dev Self-Check Tests
|
|
2
2
|
|
|
3
|
-
> **Scope — dev self-check (smoke),
|
|
4
|
-
>
|
|
5
|
-
>
|
|
6
|
-
>
|
|
7
|
-
>
|
|
3
|
+
> **Scope — dev self-check (smoke), không phải bộ test chính thức.** Các test này để
|
|
4
|
+
> dev nhanh chóng kiểm chứng code mình sinh ra so với các BDD scenario. Đây là một
|
|
5
|
+
> self-check của dev, **không** phải bộ test authoritative của QC/dev-team (cái đó có
|
|
6
|
+
> flow riêng, implement ở nơi khác). Kết quả hiện lên dashboard Living Docs như một tín hiệu
|
|
7
|
+
> **dev self-test** để QC thấy dev đã tự chạy check của mình.
|
|
8
8
|
|
|
9
9
|
## Gate
|
|
10
10
|
{{include:steps/gate.md}}
|
|
11
11
|
|
|
12
|
-
*
|
|
12
|
+
*Lưu ý: Với lệnh này, target ở Bước 1 là một UC-ID hoặc path file `.feature`. Tìm file feature tại `{paths.specs_dir}/{domain}/*/bdd/**/{UC-ID}-*.feature` (glob khớp xuyên các PRD — filename gồm hậu tố slug) và các file implementation gắn tag `@trace.implements={UC-ID}`.*
|
|
13
13
|
|
|
14
14
|
## Context
|
|
15
15
|
{{include:steps/context-loader.md}}
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
|
|
19
19
|
## Service Detection
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Đọc `@trace.service` và `@trace.module` từ header file feature.
|
|
22
22
|
|
|
23
|
-
|
|
|
23
|
+
| Điều kiện | Hành động |
|
|
24
24
|
|---|---|
|
|
25
|
-
| `@trace.module`
|
|
26
|
-
| `@trace.module`
|
|
27
|
-
| `@trace.service`
|
|
28
|
-
| `@trace.service`
|
|
25
|
+
| `@trace.module` có mặt | Dùng làm `active_module` |
|
|
26
|
+
| `@trace.module` vắng | Dùng `tech_stack.module` từ project-context.yaml |
|
|
27
|
+
| `@trace.service` có mặt | Lưu làm `active_service` |
|
|
28
|
+
| `@trace.service` vắng | Dùng domain của `{UC-ID}` làm fallback |
|
|
29
29
|
|
|
30
|
-
**
|
|
30
|
+
**Phân loại platform type:**
|
|
31
31
|
|
|
32
32
|
| Platform | Modules |
|
|
33
33
|
|---|---|
|
|
@@ -39,28 +39,28 @@ Read `@trace.service` and `@trace.module` from the feature file header.
|
|
|
39
39
|
|
|
40
40
|
## CHECKPOINT — Test Plan
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
Trước khi sinh, quét file feature tìm scenario và các file implementation tìm class/function. Hiện:
|
|
43
43
|
|
|
44
44
|
```
|
|
45
45
|
Test Plan — {UC-ID} ({active_module})
|
|
46
46
|
──────────────────────────────────────
|
|
47
47
|
Platform : {backend | web-frontend | mobile}
|
|
48
|
-
Scenarios : {N}
|
|
49
|
-
Impl files : {
|
|
48
|
+
Scenarios : {N} scenario từ file .feature
|
|
49
|
+
Impl files : {danh sách file gắn tag @trace.implements={UC-ID}}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
{platform
|
|
51
|
+
Test cần sinh:
|
|
52
|
+
{danh sách riêng theo platform — xem template bên dưới}
|
|
53
53
|
|
|
54
54
|
Proceed? (Y/N)
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Chờ "Y" rõ ràng trước khi sinh.
|
|
58
58
|
|
|
59
59
|
---
|
|
60
60
|
|
|
61
61
|
## Generate
|
|
62
62
|
|
|
63
|
-
###
|
|
63
|
+
### Nếu `platform_type = backend`
|
|
64
64
|
|
|
65
65
|
#### java-spring
|
|
66
66
|
|
|
@@ -97,10 +97,10 @@ class {Resource}ControllerTest {
|
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
Rules:
|
|
100
|
-
- Unit
|
|
101
|
-
- Integration
|
|
102
|
-
-
|
|
103
|
-
-
|
|
100
|
+
- Unit test: mock ở layer Repository, test logic Service
|
|
101
|
+
- Integration test: mock ở layer Facade/Service, chỉ test HTTP contract
|
|
102
|
+
- Không bao giờ mock class đang được test
|
|
103
|
+
- Theo naming: `methodName_whenCondition_shouldOutcome` (từ CLAUDE.md §6)
|
|
104
104
|
|
|
105
105
|
#### golang
|
|
106
106
|
|
|
@@ -180,9 +180,9 @@ class {Resource}ControllerTest extends TestCase {
|
|
|
180
180
|
|
|
181
181
|
#### context-engineering
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
Kiểm tra `tech_stack.language` từ project-context.yaml để chọn đúng cú pháp test:
|
|
184
184
|
|
|
185
|
-
**
|
|
185
|
+
**Nếu language = Python** (mặc định):
|
|
186
186
|
|
|
187
187
|
```python
|
|
188
188
|
# @trace.verifies={UC-ID}
|
|
@@ -221,7 +221,7 @@ class Test{Resource}Prompt:
|
|
|
221
221
|
{function}(input=None)
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
**
|
|
224
|
+
**Nếu language = TypeScript / JavaScript** (Node.js LangChain.js, v.v.):
|
|
225
225
|
|
|
226
226
|
```typescript
|
|
227
227
|
// @trace.verifies={UC-ID}
|
|
@@ -244,17 +244,17 @@ describe('{Resource}Prompt', () => {
|
|
|
244
244
|
})
|
|
245
245
|
```
|
|
246
246
|
|
|
247
|
-
**
|
|
247
|
+
**Nếu language = Java** (LangChain4j, v.v.): dùng JUnit 5 + Mockito, cùng pattern như unit test java-spring ở trên — mock interface `ChatLanguageModel`.
|
|
248
248
|
|
|
249
249
|
Rules:
|
|
250
|
-
- Mock
|
|
251
|
-
- Validate input schema
|
|
252
|
-
-
|
|
253
|
-
-
|
|
250
|
+
- Mock LLM client ở boundary — không bao giờ gọi LLM thật trong unit test
|
|
251
|
+
- Validate input schema và output schema riêng biệt
|
|
252
|
+
- Mỗi scenario trong `.feature` map sang một test function
|
|
253
|
+
- Dùng parameterized test cho nhiều biến thể input
|
|
254
254
|
|
|
255
255
|
---
|
|
256
256
|
|
|
257
|
-
###
|
|
257
|
+
### Nếu `platform_type = web-frontend`
|
|
258
258
|
|
|
259
259
|
#### react / nextjs / vue / nuxt / angular
|
|
260
260
|
|
|
@@ -292,15 +292,15 @@ test('{scenario from .feature}', async ({ page }) => {
|
|
|
292
292
|
```
|
|
293
293
|
|
|
294
294
|
Rules:
|
|
295
|
-
-
|
|
296
|
-
-
|
|
297
|
-
- Mock API
|
|
298
|
-
-
|
|
299
|
-
-
|
|
295
|
+
- Một file component test cho mỗi component liên quan tới UC
|
|
296
|
+
- Một file E2E test cho mỗi UC, phủ happy path + các error scenario chính
|
|
297
|
+
- Mock API call ở network layer (MSW hoặc cy.intercept), không phải ở component props
|
|
298
|
+
- Dùng accessible query (`getByRole`, `getByLabelText`) — tránh `getByTestId` trừ khi cần
|
|
299
|
+
- Mỗi test map đúng một scenario trong file `.feature`
|
|
300
300
|
|
|
301
301
|
---
|
|
302
302
|
|
|
303
|
-
###
|
|
303
|
+
### Nếu `platform_type = mobile`
|
|
304
304
|
|
|
305
305
|
#### flutter
|
|
306
306
|
|
|
@@ -436,37 +436,37 @@ class {Feature}ScreenTest {
|
|
|
436
436
|
|
|
437
437
|
## Checklist
|
|
438
438
|
|
|
439
|
-
**
|
|
440
|
-
- [ ] `@trace.verifies`
|
|
441
|
-
- [ ] `@trace.service`
|
|
442
|
-
- [ ]
|
|
443
|
-
- [ ]
|
|
444
|
-
- [ ]
|
|
439
|
+
**Mọi platform:**
|
|
440
|
+
- [ ] `@trace.verifies` trên mỗi test class / test group
|
|
441
|
+
- [ ] `@trace.service` trên mỗi test class / test group
|
|
442
|
+
- [ ] Mỗi scenario trong file `.feature` có ≥ 1 test tương ứng
|
|
443
|
+
- [ ] Phủ happy path
|
|
444
|
+
- [ ] Phủ các scenario error / edge case chính
|
|
445
445
|
|
|
446
|
-
**
|
|
447
|
-
- [ ]
|
|
448
|
-
- [ ]
|
|
449
|
-
- [ ] Test naming
|
|
446
|
+
**Chỉ backend:**
|
|
447
|
+
- [ ] Mock đúng layer (Repository trong unit test, Facade/Service trong controller test)
|
|
448
|
+
- [ ] Không gọi DB thật trong unit test
|
|
449
|
+
- [ ] Test naming theo `methodName_whenCondition_shouldOutcome` (CLAUDE.md §6)
|
|
450
450
|
|
|
451
|
-
**Frontend / Mobile
|
|
452
|
-
- [ ]
|
|
453
|
-
- [ ]
|
|
454
|
-
- [ ] API
|
|
451
|
+
**Chỉ Frontend / Mobile:**
|
|
452
|
+
- [ ] Không hardcode delay (`sleep`, `setTimeout`) trong test — dùng `waitFor` / `pumpAndSettle`
|
|
453
|
+
- [ ] Dùng accessible query (role, label) không phải selector phụ thuộc implementation
|
|
454
|
+
- [ ] Mock API call ở network layer, không phải ở component level
|
|
455
455
|
|
|
456
456
|
---
|
|
457
457
|
|
|
458
458
|
## Write Trace State
|
|
459
459
|
|
|
460
|
-
|
|
460
|
+
Sau khi sinh tất cả file test, cập nhật `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` — với mỗi scenario, tìm row có sẵn theo `sc_id` và cập nhật:
|
|
461
461
|
|
|
462
|
-
|
|
|
462
|
+
| Cột | Giá trị |
|
|
463
463
|
|--------|-------|
|
|
464
|
-
| `test_count` |
|
|
465
|
-
| `test_classes` |
|
|
466
|
-
| `dev_selftest` | `not_run` (
|
|
467
|
-
| `last_updated` |
|
|
464
|
+
| `test_count` | số test method phủ SC này |
|
|
465
|
+
| `test_classes` | tên test class / describe-block, ngăn cách bởi dấu phẩy |
|
|
466
|
+
| `dev_selftest` | `not_run` (test giờ đã tồn tại nhưng chưa chạy — `/dev-run-test` set pass/fail) |
|
|
467
|
+
| `last_updated` | hôm nay `YYYY-MM-DD` |
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
Giữ nguyên mọi cột khác (gồm `dev_selftest_at`, do `/dev-run-test` sở hữu, và `qc_status`/`qc_run_at`, do `/qc-run-test` sở hữu).
|
|
470
470
|
|
|
471
471
|
---
|
|
472
472
|
|
|
@@ -480,11 +480,11 @@ Leave all other columns unchanged (including `dev_selftest_at`, which `/dev-run-
|
|
|
480
480
|
{{include:steps/report-footer.md}}
|
|
481
481
|
|
|
482
482
|
```
|
|
483
|
-
/dev-gen-test
|
|
483
|
+
/dev-gen-test Hoàn tất — {UC-ID} ({active_module})
|
|
484
484
|
✅ {TestClass1} ({N} tests)
|
|
485
485
|
✅ {TestClass2} ({N} tests)
|
|
486
486
|
Trace: {paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv updated
|
|
487
487
|
Next: /dev-run-test {UC-ID}
|
|
488
488
|
|
|
489
|
-
📊 Living Docs:
|
|
489
|
+
📊 Living Docs: chạy /validate-traces (hoặc /sync) để push trace này lên dashboard spec-module.
|
|
490
490
|
```
|