@edupia-tutor/spec-driven-docs 0.14.6 → 0.14.8
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 +1 -1
- package/commands/debug.md +1 -1
- package/commands/define-product.md +1 -1
- package/commands/dev-gen-test.md +1 -1
- package/commands/dev-run-test.md +1 -1
- package/commands/dev-smoke-test.md +1 -1
- package/commands/fix-bug.md +1 -1
- package/commands/generate-bdd.md +74 -5
- package/commands/generate-bdd.tmpl +73 -4
- package/commands/generate-code.md +19 -2
- package/commands/generate-code.tmpl +18 -1
- package/commands/generate-design-spec.md +50 -6
- package/commands/generate-design-spec.tmpl +49 -5
- package/commands/generate-prd.md +9 -5
- package/commands/generate-prd.tmpl +1 -0
- package/commands/generate-spec-manifest.md +1 -1
- package/commands/generate-tech-docs.md +2 -1
- package/commands/generate-tech-docs.tmpl +1 -0
- package/commands/learn.md +1 -1
- package/commands/map-testids.md +1 -1
- package/commands/propose-scenario.md +7 -3
- package/commands/propose-scenario.tmpl +6 -2
- package/commands/qc-analyze.md +15 -1
- package/commands/qc-analyze.tmpl +14 -0
- package/commands/qc-design-test.md +1 -1
- package/commands/qc-plan.md +1 -1
- package/commands/qc-report.md +1 -1
- package/commands/qc-review.md +1 -1
- package/commands/qc-run-test.md +1 -1
- package/commands/refine-prd.md +33 -13
- package/commands/refine-prd.tmpl +32 -12
- package/commands/report-bug.md +1 -1
- package/commands/review-code.md +1 -1
- package/commands/review-context.md +49 -27
- package/commands/review-context.tmpl +48 -26
- package/commands/review-tech-docs.md +1 -1
- package/commands/setup-ai-first.md +10 -10
- package/commands/setup-ai-first.tmpl +9 -9
- package/commands/sync.md +1 -1
- package/commands/update-framework.md +1 -1
- package/commands/validate-traces.md +2 -1
- package/commands/validate-traces.tmpl +1 -0
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +1 -1
- package/core/commands/define-product.md +1 -1
- package/core/commands/dev-gen-test.md +1 -1
- package/core/commands/dev-run-test.md +1 -1
- package/core/commands/dev-smoke-test.md +1 -1
- package/core/commands/fix-bug.md +1 -1
- package/core/commands/generate-bdd.md +74 -5
- package/core/commands/generate-code.md +19 -2
- package/core/commands/generate-design-spec.md +50 -6
- package/core/commands/generate-prd.md +9 -5
- package/core/commands/generate-spec-manifest.md +1 -1
- package/core/commands/generate-tech-docs.md +2 -1
- package/core/commands/learn.md +1 -1
- package/core/commands/map-testids.md +1 -1
- package/core/commands/propose-scenario.md +7 -3
- package/core/commands/qc-analyze.md +15 -1
- package/core/commands/qc-design-test.md +1 -1
- package/core/commands/qc-plan.md +1 -1
- package/core/commands/qc-report.md +1 -1
- package/core/commands/qc-review.md +1 -1
- package/core/commands/qc-run-test.md +1 -1
- package/core/commands/refine-prd.md +33 -13
- package/core/commands/report-bug.md +1 -1
- package/core/commands/review-code.md +1 -1
- package/core/commands/review-context.md +49 -27
- package/core/commands/review-tech-docs.md +1 -1
- package/core/commands/setup-ai-first.md +10 -10
- package/core/commands/sync.md +1 -1
- package/core/commands/update-framework.md +1 -1
- package/core/commands/validate-traces.md +2 -1
- package/core/skills/code/SKILL.md +7 -759
- package/core/skills/debug/SKILL.md +9 -859
- package/core/skills/design-spec/SKILL.md +3 -582
- package/core/skills/prd/SKILL.md +5 -464
- package/core/skills/setup-ai-first/SKILL.md +3 -208
- package/core/skills/spec/SKILL.md +7 -450
- package/core/skills/test/SKILL.md +10 -1290
- package/core/steps/report-footer.md +1 -1
- package/core/steps/spawn-agent.md +12 -7
- package/core/templates/prd.template.md +7 -4
- package/core/templates/project-context.yaml +2 -2
- package/docs/01-getting-started/core-concepts.md +3 -3
- package/docs/01-getting-started/quickstart.md +4 -3
- package/docs/02-guides/bdd-input-checklist.md +68 -0
- package/docs/02-guides/developer/README.md +3 -0
- package/docs/02-guides/developer/bdd-and-trace.md +4 -3
- package/docs/02-guides/developer/commands.md +3 -3
- package/docs/02-guides/developer/pr-checklist.md +1 -0
- package/docs/02-guides/developer/scenarios.md +2 -2
- package/docs/02-guides/developer/workflow.md +3 -3
- package/docs/02-guides/prd-input-checklist.md +94 -0
- package/docs/02-guides/product-owner/README.md +5 -3
- package/docs/02-guides/product-owner/commands.md +1 -1
- package/docs/02-guides/product-owner/handoff-checklist.md +5 -5
- package/docs/02-guides/product-owner/scenarios.md +19 -17
- package/docs/02-guides/tech-docs-input-checklist.md +82 -0
- package/docs/02-guides/tester/README.md +1 -1
- package/docs/02-guides/tester/bug-reporting.md +1 -1
- package/docs/02-guides/tester/qc-automation.md +1 -1
- package/docs/03-concepts/README.md +1 -0
- package/docs/03-concepts/mechanisms-explained.md +34 -0
- package/docs/03-concepts/pipeline.md +12 -9
- package/docs/03-concepts/traceability.md +7 -4
- package/docs/04-operations/bug-flow.md +2 -0
- package/docs/04-operations/sync-and-update.md +3 -3
- package/docs/05-reference/command-cheatsheet.md +9 -9
- package/docs/05-reference/commands.md +12 -10
- package/docs/05-reference/trace-schema.md +2 -1
- package/package.json +1 -1
- package/skills/code/SKILL.md +7 -759
- package/skills/code/SKILL.tmpl +7 -164
- package/skills/debug/SKILL.md +9 -859
- package/skills/debug/SKILL.tmpl +9 -252
- package/skills/design-spec/SKILL.md +3 -582
- package/skills/design-spec/SKILL.tmpl +3 -87
- package/skills/prd/SKILL.md +5 -464
- package/skills/prd/SKILL.tmpl +5 -63
- package/skills/setup-ai-first/SKILL.md +3 -208
- package/skills/setup-ai-first/SKILL.tmpl +3 -108
- package/skills/spec/SKILL.md +7 -450
- package/skills/spec/SKILL.tmpl +7 -162
- package/skills/test/SKILL.md +10 -1290
- package/skills/test/SKILL.tmpl +10 -288
- package/steps/report-footer.md +1 -1
- package/steps/spawn-agent.md +12 -7
- package/templates/prd.template.md +7 -4
- package/templates/project-context.yaml +2 -2
package/skills/test/SKILL.tmpl
CHANGED
|
@@ -2,295 +2,17 @@
|
|
|
2
2
|
description: Sinh unit và integration test từ BDD spec, chạy test suite và report kết quả, hoặc dev-smoke-test các API endpoint live trên service đang chạy. Trigger when: "/dev-gen-test", "/dev-run-test", "/dev-smoke-test", "tạo test", "viết test", "chạy test", "generate tests", "run tests", "test kết quả", "smoke test", "test API", "kiểm tra endpoint đang chạy".
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Test Skills — Generate, Run & Smoke
|
|
5
|
+
# Test Skills — Generate, Run & Smoke (Dev Self-Check)
|
|
6
6
|
|
|
7
|
-
Skill này xử lý
|
|
7
|
+
Skill này xử lý `/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test` — **dev self-check** (`dev_selftest`), KHÔNG phải QC chính thức (`/qc-*`). Để **không lệch**, skill KHÔNG nhân bản — mỗi lệnh thực thi **y hệt** command.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## /dev-gen-test — Generate Unit & Integration Tests
|
|
12
|
-
|
|
13
|
-
### Gate
|
|
14
|
-
|
|
15
|
-
<!-- Directory: specs/*/*/bdd/*.feature — or pass UC-ID/class path as argument -->
|
|
16
|
-
{{include:steps/gate.md}}
|
|
17
|
-
|
|
18
|
-
Cũng đọc:
|
|
19
|
-
- File `.feature` để hiểu các behavior kỳ vọng
|
|
20
|
-
- Tìm file cần test: Controller có `@trace.implements={UC-ID}`, Service implementation, Facade implementation (nếu áp dụng)
|
|
21
|
-
|
|
22
|
-
### CHECKPOINT — Test Plan
|
|
23
|
-
|
|
24
|
-
Trước khi sinh, trình bày plan:
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
Test Plan — {UC-ID}:
|
|
28
|
-
|
|
29
|
-
Unit Tests ({unit test framework}):
|
|
30
|
-
- {ServiceName}ServiceImplTest
|
|
31
|
-
• {method}: {scenario} → {expected result}
|
|
32
|
-
- {FacadeName}FacadeImplTest (if applicable)
|
|
33
|
-
• {method}: {scenario} → {expected result}
|
|
34
|
-
|
|
35
|
-
Integration Tests:
|
|
36
|
-
- {ControllerName}ControllerTest
|
|
37
|
-
• {endpoint}: {scenario} → HTTP {status}
|
|
38
|
-
|
|
39
|
-
Total: {N} test classes, ~{M} test cases
|
|
40
|
-
Proceed? (Y/N)
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Chờ xác nhận.
|
|
44
|
-
|
|
45
|
-
### Generate
|
|
46
|
-
|
|
47
|
-
#### Unit Test Template
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
// @trace.verifies={UC-ID}
|
|
51
|
-
// @trace.test_type=unit
|
|
52
|
-
[Test class using your project's test framework]
|
|
53
|
-
|
|
54
|
-
class {Resource}ServiceImplTest {
|
|
55
|
-
|
|
56
|
-
// Mock dependencies
|
|
57
|
-
|
|
58
|
-
@Test
|
|
59
|
-
// "Should {expected outcome} when {condition}"
|
|
60
|
-
void methodName_whenValid_shouldReturnExpected() {
|
|
61
|
-
// Given — set up mocks and inputs
|
|
62
|
-
// When — call the method under test
|
|
63
|
-
// Then — assert results and verify interactions
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@Test
|
|
67
|
-
// "Should throw {Exception} when {resource} not found"
|
|
68
|
-
void methodName_whenNotFound_shouldThrowException() {
|
|
69
|
-
// Given — mock returns empty/null
|
|
70
|
-
// When & Then — assert exception is thrown
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
#### Integration Test Template (Controller/HTTP layer)
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
// @trace.verifies={UC-ID}
|
|
79
|
-
// @trace.test_type=integration
|
|
80
|
-
[Integration test class for HTTP layer]
|
|
81
|
-
|
|
82
|
-
class {Resource}ControllerTest {
|
|
83
|
-
|
|
84
|
-
// Inject MockMvc or HTTP test client
|
|
85
|
-
// MockBean/stub the Facade/Service
|
|
86
|
-
|
|
87
|
-
@Test
|
|
88
|
-
// "GET /v1/{resource} - should return 200 with data"
|
|
89
|
-
void filter_shouldReturn200() {
|
|
90
|
-
// Given — stub facade/service
|
|
91
|
-
// When — perform HTTP GET
|
|
92
|
-
// Then — assert status 200 and response body
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@Test
|
|
96
|
-
// "POST /v1/{resource} - should return 201 when valid"
|
|
97
|
-
void create_shouldReturn201() {
|
|
98
|
-
// Given — stub facade/service
|
|
99
|
-
// When — perform HTTP POST with valid body
|
|
100
|
-
// Then — assert status 201
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@Test
|
|
104
|
-
// "POST /v1/{resource} - should return 400 when invalid"
|
|
105
|
-
void create_shouldReturn400WhenInvalid() {
|
|
106
|
-
// Given — no stub needed
|
|
107
|
-
// When — perform HTTP POST with missing required fields
|
|
108
|
-
// Then — assert status 400
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### File Placement
|
|
114
|
-
|
|
115
|
-
Theo cấu trúc test của dự án từ CLAUDE.md. Điển hình:
|
|
116
|
-
```
|
|
117
|
-
src/test/{language}/{package}/
|
|
118
|
-
├── service/impl/{Resource}ServiceImplTest.{ext}
|
|
119
|
-
├── facade/impl/{Resource}FacadeImplTest.{ext} (if applicable)
|
|
120
|
-
└── controller/{Resource}ControllerTest.{ext}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Self-Review Checklist
|
|
124
|
-
|
|
125
|
-
- [ ] Tag `@trace.verifies` trên mỗi test class
|
|
126
|
-
- [ ] Mỗi scenario trong .feature có ít nhất một test
|
|
127
|
-
- [ ] Chỉ mock đúng layer (không mock repo trong controller test)
|
|
128
|
-
- [ ] Test name theo pattern `methodName_whenCondition_shouldOutcome`
|
|
129
|
-
- [ ] Không có debug print trong test
|
|
130
|
-
|
|
131
|
-
### Output
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
/dev-gen-test Complete — {UC-ID}:
|
|
135
|
-
✅ service/{Service}Test.{ext} ({M} tests)
|
|
136
|
-
✅ facade/{Facade}Test.{ext} ({M} tests)
|
|
137
|
-
✅ controller/{Controller}Test.{ext} ({M} tests)
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
{{include:steps/report-footer.md}}
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## /dev-run-test — Run Tests & Report Results
|
|
145
|
-
|
|
146
|
-
### Gate
|
|
147
|
-
|
|
148
|
-
{{include:steps/context-loader.md}}
|
|
149
|
-
|
|
150
|
-
Xác định service/module từ argument (UC-ID hoặc tên service).
|
|
151
|
-
Đọc `conventions.test_command` từ project context đã nạp.
|
|
152
|
-
|
|
153
|
-
### Run
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
# Run all tests in module
|
|
157
|
-
{TEST_COMMAND}
|
|
158
|
-
|
|
159
|
-
# Run specific test class (faster)
|
|
160
|
-
{TEST_COMMAND_FOR_CLASS}
|
|
161
|
-
|
|
162
|
-
# Run by pattern
|
|
163
|
-
{TEST_COMMAND_BY_PATTERN}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Analyze Results
|
|
167
|
-
|
|
168
|
-
#### Khi test PASS
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
✅ Tests passed
|
|
172
|
-
- Total: {N}
|
|
173
|
-
- Passed: {N}
|
|
174
|
-
- Duration: {X}s
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
#### Khi test FAIL — Debug Mode
|
|
178
|
-
|
|
179
|
-
Đọc stack trace và phân tích:
|
|
180
|
-
|
|
181
|
-
| Error Pattern | Nguyên nhân thường gặp | Suggested Fix |
|
|
182
|
-
|---|---|---|
|
|
183
|
-
| NullPointerException trong test | Thiếu setup mock | Kiểm tra setup `given(...)` cho dependency null |
|
|
184
|
-
| Bean/dependency not found | Thiếu khai báo mock/stub | Thêm mock cho dependency thiếu |
|
|
185
|
-
| Expected 200 but got 403 | Thiếu setup auth trong test | Thêm auth user/role vào test context |
|
|
186
|
-
| Expected 200 but got 400 | Request body fail validation | Kiểm tra field bắt buộc trong request DTO |
|
|
187
|
-
| LazyInitializationException | Lazy collection truy cập ngoài transaction | Thêm `@Transactional` trên test hoặc dùng eager fetch |
|
|
188
|
-
| Mapper/mapper implementation not found | Code generator (vd MapStruct) chưa chạy | Chạy compile trước khi test |
|
|
189
|
-
|
|
190
|
-
### Output
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
/dev-run-test Report — {service}
|
|
194
|
-
Run at: {datetime}
|
|
195
|
-
|
|
196
|
-
## Summary
|
|
197
|
-
✅ Passed: {N} | ❌ Failed: {M} | ⏭️ Skipped: {K}
|
|
198
|
-
Duration: {X}s
|
|
199
|
-
|
|
200
|
-
## Failed Tests
|
|
201
|
-
| Test | Error | Root Cause |
|
|
202
|
-
|------|-------|-----------|
|
|
203
|
-
| {TestClass}.{method} | {exception} | {analysis} |
|
|
204
|
-
|
|
205
|
-
## Recommendations
|
|
206
|
-
{specific fix for each failure}
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
{{include:steps/report-footer.md}}
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## /dev-smoke-test — Test Live API Endpoints
|
|
214
|
-
|
|
215
|
-
Dùng khi service **đang chạy sẵn** để verify endpoint hoạt động đúng.
|
|
216
|
-
Khác `/dev-run-test` (chạy unit/integration test không cần live server).
|
|
217
|
-
|
|
218
|
-
### Phase 1 — Find Service URL
|
|
219
|
-
|
|
220
|
-
{{include:steps/context-loader.md}}
|
|
221
|
-
|
|
222
|
-
Đọc `conventions.service_run` từ project context đã nạp để tìm port.
|
|
223
|
-
Default: `http://localhost:8080`
|
|
224
|
-
|
|
225
|
-
Kiểm tra service đang chạy:
|
|
226
|
-
```bash
|
|
227
|
-
curl -s http://localhost:{port}/health
|
|
228
|
-
# or /actuator/health for Spring Boot
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
Nếu chưa chạy: "Service is not running. Start it with: `{RUN_COMMAND}` from your project root."
|
|
232
|
-
|
|
233
|
-
### Phase 2 — Identify Endpoints
|
|
234
|
-
|
|
235
|
-
Từ UC-ID → tìm Controller có `@trace.implements={UC-ID}`:
|
|
236
|
-
- Liệt kê: method, path, auth/role bắt buộc
|
|
237
|
-
|
|
238
|
-
### Phase 3 — Get Auth Token (nếu cần)
|
|
239
|
-
|
|
240
|
-
Nếu endpoint yêu cầu auth, hỏi:
|
|
241
|
-
```
|
|
242
|
-
This endpoint requires authentication. Options:
|
|
243
|
-
1. Paste your Bearer token (from Postman / browser DevTools / test login)
|
|
244
|
-
2. Use a test/dev token from your local config
|
|
245
|
-
3. Skip auth — only test public endpoints
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
### Phase 4 — Run Smoke Test
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
# GET
|
|
252
|
-
curl -s -X GET "http://localhost:{port}/v1/{resource}?page=0&size=5" \
|
|
253
|
-
-H "Authorization: Bearer {token}" | {JSON_FORMATTER}
|
|
254
|
-
|
|
255
|
-
# POST
|
|
256
|
-
curl -s -X POST "http://localhost:{port}/v1/{resource}" \
|
|
257
|
-
-H "Authorization: Bearer {token}" \
|
|
258
|
-
-H "Content-Type: application/json" \
|
|
259
|
-
-d '{"field1": "test_value"}'
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
### Phase 5 — Interpret Results
|
|
263
|
-
|
|
264
|
-
| Result | Ý nghĩa |
|
|
265
|
-
|--------|---------|
|
|
266
|
-
| 200/201 + đúng data | ✅ OK |
|
|
267
|
-
| 200 + sai data | ⚠️ Logic bug → dùng `/debug` |
|
|
268
|
-
| 400 | Request body sai → kiểm tra field bắt buộc |
|
|
269
|
-
| 401 | Token hết hạn hoặc sai realm |
|
|
270
|
-
| 403 | Sai role → kiểm tra auth config |
|
|
271
|
-
| 500 + stacktrace | Server error → dán vào `/debug` |
|
|
272
|
-
| Connection refused | Service chưa chạy hoặc sai port |
|
|
273
|
-
|
|
274
|
-
Nếu có lỗi trong log:
|
|
275
|
-
```bash
|
|
276
|
-
tail -n 100 {LOG_FILE_PATH}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Output
|
|
280
|
-
|
|
281
|
-
```
|
|
282
|
-
/dev-smoke-test Report — {UC-ID}
|
|
283
|
-
Tested at: {datetime}
|
|
284
|
-
Base URL: http://localhost:{port}
|
|
285
|
-
|
|
286
|
-
## Endpoints Tested
|
|
287
|
-
| Method | Path | Status | Result |
|
|
288
|
-
|--------|------|--------|--------|
|
|
289
|
-
| GET | /v1/{resource} | 200 ✅ | 5 records returned |
|
|
290
|
-
| POST | /v1/{resource} | 201 ✅ | Created id=42 |
|
|
9
|
+
## /dev-gen-test — Sinh test dev self-check
|
|
10
|
+
→ **Đọc và tuân theo `commands/dev-gen-test.md`** với cùng `$ARGUMENTS`.
|
|
291
11
|
|
|
292
|
-
##
|
|
293
|
-
|
|
294
|
-
|
|
12
|
+
## /dev-run-test — Chạy test & ghi `dev_selftest`
|
|
13
|
+
→ **Đọc và tuân theo `commands/dev-run-test.md`** với cùng `$ARGUMENTS`.
|
|
14
|
+
(Command lo: bảng phân tích lỗi theo platform · ghi `dev_selftest`/`dev_selftest_at` vào trace TSV.)
|
|
295
15
|
|
|
296
|
-
|
|
16
|
+
## /dev-smoke-test — Smoke test service/app đang chạy
|
|
17
|
+
→ **Đọc và tuân theo `commands/dev-smoke-test.md`** với cùng `$ARGUMENTS`.
|
|
18
|
+
(Command lo: flow theo từng platform — backend curl/health · web E2E Playwright/Cypress · mobile device/emulator · LLM pipeline.)
|
package/steps/report-footer.md
CHANGED
|
@@ -60,7 +60,7 @@ Gợi ý lệnh kế tiếp hợp lý theo phase của workflow:
|
|
|
60
60
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
61
61
|
| /generate-prd | `/refine-prd {prd-file}` rồi `/review-context {prd-file}` |
|
|
62
62
|
| /refine-prd | Mở Review Board → cập nhật PRD → `/review-context {prd-file}` |
|
|
63
|
-
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (
|
|
63
|
+
| /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) |
|
|
64
64
|
| /generate-design-spec | Designer review → xác nhận link Figma → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
65
65
|
| /generate-bdd | `/review-context {feature-file}` để kiểm tra độ phủ |
|
|
66
66
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` nếu APPROVED; sinh lại nếu NEEDS_FIX |
|
package/steps/spawn-agent.md
CHANGED
|
@@ -71,14 +71,18 @@ Dựng payload và gọi Agent tool cho từng UC:
|
|
|
71
71
|
```json
|
|
72
72
|
{
|
|
73
73
|
"_agent_mode": true,
|
|
74
|
-
"command":
|
|
75
|
-
"uc_id":
|
|
76
|
-
"target_file":
|
|
77
|
-
"uc_section":
|
|
78
|
-
"context":
|
|
74
|
+
"command": "generate-bdd",
|
|
75
|
+
"uc_id": "{TICKET-ID}-UC{N}",
|
|
76
|
+
"target_file": "{đường dẫn tuyệt đối tới PRD hoặc feature file}",
|
|
77
|
+
"uc_section": { "line_start": {N}, "line_end": {N} },
|
|
78
|
+
"context": { "<context gọn từ Bước A>" },
|
|
79
|
+
"active_platform": "{web|app|system — platform orchestrator đã chọn ở Platform Selection}",
|
|
80
|
+
"design_coverage": { "<Screen States + AC-UI behavioral orchestrator đã trích ở 'Design Spec — Gate & Load' (B1); rỗng nếu BE / không có design-spec>" }
|
|
79
81
|
}
|
|
80
82
|
```
|
|
81
83
|
|
|
84
|
+
> **Truyền state orchestrator đã phân giải (quan trọng):** orchestrator (session chính) đã chạy các Guard + chọn platform + nạp design-spec MỘT LẦN *trước* khi spawn. Phải kèm `active_platform` và `design_coverage` vào payload để sub-agent áp đúng (đặc biệt phủ Screen States + AC-UI cho FE/App). KHÔNG kèm → sub-agent sinh BDD thiếu phần design (PRD lớn mất B1).
|
|
85
|
+
|
|
82
86
|
> **Phạm vi lệnh**: Chỉ `/generate-bdd` khởi động chế độ orchestration. `/generate-code` và `/dev-gen-test` có thể chạy như sub-agent (chúng tôn trọng `_agent_mode: true` từ Gate Bước 0), nhưng không spawn thêm sub-agent — phạm vi của chúng vốn đã là một UC duy nhất.
|
|
83
87
|
|
|
84
88
|
Serialize JSON này và truyền làm `$ARGUMENTS` khi gọi lệnh sub-agent.
|
|
@@ -108,8 +112,9 @@ Khi `gate.md Bước 0` phát hiện `_agent_mode: true`:
|
|
|
108
112
|
2. **Bỏ qua context-loader.md** — dùng trực tiếp `payload.context`
|
|
109
113
|
3. **Chỉ giới hạn ở `payload.uc_id`** — không xử lý các UC khác trong file
|
|
110
114
|
4. Chỉ đọc section PRD giữa `payload.uc_section.line_start` và `line_end`
|
|
111
|
-
5.
|
|
112
|
-
6.
|
|
115
|
+
5. **Dùng state orchestrator đã phân giải:** `active_platform` = `payload.active_platform`; `design_coverage` = `payload.design_coverage`. **KHÔNG chạy lại** các Guard (PRD approved / Design-Spec) hay tự nạp lại design-spec / hỏi platform — orchestrator đã làm một lần ở session chính.
|
|
116
|
+
6. Thực thi logic thường của lệnh cho riêng UC này (dùng `design_coverage` từ payload để phủ Screen States + AC-UI)
|
|
117
|
+
7. Trả về JSON kết quả có cấu trúc (định dạng Bước E ở trên)
|
|
113
118
|
|
|
114
119
|
---
|
|
115
120
|
|
|
@@ -197,11 +197,14 @@ _(Nếu không có độ vênh: ghi "Không có — toàn bộ nội dung đã
|
|
|
197
197
|
|
|
198
198
|
# Change Log
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
> Hiện tại: **v1.0** ({date}) · Lịch sử đầy đủ → [changelog](./changelog/{TICKET}-{N}-{slug}.changelog.md) *(file kho chỉ tạo khi changelog vượt 5 version)*
|
|
201
201
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
<!-- Bảng phẳng, MỘT dòng/version, MỚI NHẤT TRÊN CÙNG. Chỉ giữ tối đa 5 version gần nhất ở đây;
|
|
203
|
+
cũ hơn → /refine-prd & /review-context tự dồn (rollover) sang file changelog/ ở link trên. -->
|
|
204
|
+
|
|
205
|
+
| Version | Date | Changes (UC/AC/BR bị ảnh hưởng) |
|
|
206
|
+
|---------|------|---------------------------------|
|
|
207
|
+
| 1.0 | {date} | Bản đầu — sinh từ product-definition. |
|
|
205
208
|
|
|
206
209
|
---
|
|
207
210
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# 3. When a workflow says "→ key.subkey", look up that key
|
|
15
15
|
# and use the resolved value as the actual path
|
|
16
16
|
# 4. All paths are RELATIVE to workspace root
|
|
17
|
-
# 5. For "{domain}", substitute
|
|
17
|
+
# 5. For "{domain}", substitute the feature's domain (PRD: row `Domain` in Metadata / folder path; .feature: @trace.domain)
|
|
18
18
|
# =============================================================
|
|
19
19
|
|
|
20
20
|
project:
|
|
@@ -132,7 +132,7 @@ domains:
|
|
|
132
132
|
# With spec_source set, only ONE override is needed instead of four separate dir vars.
|
|
133
133
|
#
|
|
134
134
|
# services: # domain → service submodule routing
|
|
135
|
-
# {{DOMAIN_1}}: # must match
|
|
135
|
+
# {{DOMAIN_1}}: # must match the PRD's `Domain` (Metadata row) / folder path segment
|
|
136
136
|
# path: "{{SERVICE_SUBMODULE_DIR}}" # relative path to service submodule (code + .trace/)
|
|
137
137
|
# module: "{{STACK_MODULE}}" # e.g., java-spring, nextjs, flutter
|
|
138
138
|
# # NOTE: with spec_source set, BDD + tech-docs are cross-team and live in the spec repo —
|