@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
package/core/skills/prd/SKILL.md
CHANGED
|
@@ -1,496 +1,387 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Sinh PRD từ một product definition, hoặc phân tích một PRD có sẵn qua 4 lăng kính review (QA, DEV, SA, PO) để tìm gap và rủi ro. Trigger when: "/generate-prd", "/refine-prd", "tạo PRD", "generate PRD", "phân tích PRD", "review PRD", "refine PRD", "PRD có vấn đề gì không", "check PRD quality".
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# PRD Skills — Generate & Refine
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Skill này xử lý hai lệnh: `/generate-prd` để tạo PRD, và `/refine-prd` để phân tích PRD tìm gap.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
## /generate-prd —
|
|
11
|
+
## /generate-prd — Sinh Product Requirements Document
|
|
12
12
|
|
|
13
13
|
### Gate
|
|
14
14
|
|
|
15
|
-
<!-- Directory:
|
|
16
|
-
# Gate —
|
|
15
|
+
<!-- Directory: {paths.product_definitions_dir}/**/*.md -->
|
|
16
|
+
# Gate — Quy trình vào chuẩn cho mọi lệnh
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Mọi lệnh PHẢI chạy gate này trước khi thực thi phần logic riêng của nó.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Bước 0 — Kiểm tra chế độ Sub-Agent
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Trước tiên, kiểm tra xem `$ARGUMENTS` có phải là payload JSON từ một orchestrator hay không:
|
|
23
23
|
|
|
24
|
-
1.
|
|
25
|
-
2.
|
|
26
|
-
- **
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
3.
|
|
24
|
+
1. Thử parse `$ARGUMENTS` dưới dạng JSON.
|
|
25
|
+
2. Nếu parse thành công **và** chứa `"_agent_mode": true`:
|
|
26
|
+
- **Bỏ qua hoàn toàn Bước 1, 2 và 3 của Gate này.**
|
|
27
|
+
- Đặt target file = `payload.target_file`
|
|
28
|
+
- Đặt loaded context = `payload.context` (KHÔNG chạy context-loader.md)
|
|
29
|
+
- Đặt phạm vi UC = `payload.uc_id` (chỉ xử lý UC này)
|
|
30
|
+
- Đặt line range = `payload.uc_section` (chỉ đọc đúng section đó của PRD)
|
|
31
|
+
- Đi thẳng tới phần logic riêng của lệnh.
|
|
32
|
+
3. Nếu `$ARGUMENTS` không phải JSON hoặc không có `_agent_mode` → tiếp tục sang Bước 1 (chế độ thường).
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Bước 0-B — Kiểm tra Model
|
|
35
35
|
|
|
36
|
-
*
|
|
36
|
+
*Bỏ qua bước này nếu `_agent_mode: true` (sub-agent — orchestrator đã kiểm tra rồi).*
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
Các lệnh sinh nội dung và review phức tạp đòi hỏi khả năng suy luận mạnh.
|
|
39
|
+
Dùng model nhỏ hơn sẽ rủi ro: bỏ sót edge case, phân tích spec thiếu sót, vi phạm kiến trúc.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Hiển thị và chờ phản hồi:
|
|
42
42
|
|
|
43
43
|
```
|
|
44
44
|
⚙️ MODEL CHECK
|
|
45
45
|
──────────────────────────────────────────────────────────────────
|
|
46
|
-
Recommended : claude-opus-4 (
|
|
47
|
-
Why needed :
|
|
48
|
-
|
|
46
|
+
Recommended : claude-opus-4 (hoặc model Opus mới nhất)
|
|
47
|
+
Why needed : Phân tích spec, review kiến trúc, sinh code đòi hỏi
|
|
48
|
+
suy luận sâu. Model nhỏ hơn dễ bỏ sót edge case.
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
• Settings → Model →
|
|
52
|
-
•
|
|
50
|
+
Cách đổi trong Claude Code:
|
|
51
|
+
• Settings → Model → chọn "claude-opus"
|
|
52
|
+
• hoặc: /model → chọn claude-opus
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
Y —
|
|
56
|
-
S —
|
|
54
|
+
Đang chạy claude-opus?
|
|
55
|
+
Y — đúng, đang dùng claude-opus → tiếp tục
|
|
56
|
+
S — bỏ qua kiểm tra (tôi chấp nhận rủi ro chất lượng thấp hơn với model hiện tại)
|
|
57
57
|
──────────────────────────────────────────────────────────────────
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
- "Y" →
|
|
61
|
-
- "S" →
|
|
62
|
-
- "N"
|
|
60
|
+
- "Y" → tiếp tục sang Bước 1.
|
|
61
|
+
- "S" → tiếp tục sang Bước 1 (người dùng chấp nhận rủi ro, thêm ⚠️ vào report cuối).
|
|
62
|
+
- "N" hoặc bất kỳ giá trị nào khác → **DỪNG.** Xuất: "Vui lòng chuyển sang claude-opus rồi chạy lại lệnh này."
|
|
63
63
|
|
|
64
|
-
##
|
|
64
|
+
## Bước 1 — Xác định Target File
|
|
65
65
|
|
|
66
|
-
1.
|
|
67
|
-
2.
|
|
68
|
-
- **BDD
|
|
69
|
-
- **PRD
|
|
70
|
-
- **tech-docs
|
|
71
|
-
- **design-spec
|
|
66
|
+
1. Nếu `$ARGUMENTS` được cung cấp và trỏ tới một file tồn tại → dùng trực tiếp làm target.
|
|
67
|
+
2. Nếu `$ARGUMENTS` là một **UC-ID / ticket ID / tên rút gọn** (không có path) → phân giải thành file bằng cách glob theo bố cục feature-package. `{prd-slug}` lúc này **chưa biết**, nên dùng wildcard `*` cho segment đó, và `**` đệ quy dưới `bdd/` để phủ hết các thư mục con theo platform (`bdd/web/`, `bdd/app/`, `bdd/system/`):
|
|
68
|
+
- **Lệnh BDD** (target là `.feature`): `{specs_dir}/{domain}/*/bdd/**/{UC-ID}*.feature` — hoặc `{specs_dir}/*/*/bdd/**/{UC-ID}*.feature` nếu domain cũng chưa biết. Nếu lệnh ngụ ý một platform/scope cụ thể (vd: system tech-doc cần BDD `system/`), ưu tiên kết quả trong thư mục con platform đó.
|
|
69
|
+
- **Lệnh PRD** (target là file PRD `{TICKET-ID}-{prd-slug}.md` — file `.md` duy nhất ở gốc feature folder, cạnh `bdd/`): `{specs_dir}/{domain}/*/{TICKET-ID}*.md` nếu biết TICKET-ID; nếu không, `{specs_dir}/{domain}/*/*.md` (khớp feature folder có id tương ứng), hoặc `{specs_dir}/*/*/*.md` nếu domain cũng chưa biết. *(Glob `*/*.md` ở cấp gốc folder chỉ khớp PRD — tech-docs/design-spec `.md` nằm sâu hơn trong thư mục con.)*
|
|
70
|
+
- **Lệnh tech-docs**: `{specs_dir}/{domain}/*/tech-docs/{UC-ID}*-tech-design*.md`.
|
|
71
|
+
- **Lệnh design-spec**: `{specs_dir}/{domain}/*/design-spec/{TICKET-ID}*.md`.
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
3.
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
73
|
+
Khi một file khớp: đặt nó làm target **và** ghi lại `domain` + `prd_slug` từ path của nó (theo quy tắc trích xuất trong `context-loader.md` Bước 1 — `prd_slug` = segment đầu tiên sau `{specs_dir}/{domain}/`). Mọi path mà lệnh đọc/ghi về sau (BDD/tech-docs/design-spec/trace cùng cấp) đều dùng **`prd_slug` đã phân giải đó**, nên tất cả artifact nằm chung một feature package. Nếu nhiều file khớp (vd: nhiều platform), chọn theo platform/scope của lệnh hoặc liệt kê ra và hỏi.
|
|
74
|
+
3. Nếu `$ARGUMENTS` rỗng hoặc không tìm thấy file khớp:
|
|
75
|
+
- Liệt kê các file trong thư mục liên quan của lệnh này (vd: `specs/*/*/*.md` — file PRD ở gốc mỗi feature folder — cho lệnh PRD, `specs/*/*/bdd/**/*.feature` cho lệnh BDD).
|
|
76
|
+
- Hiển thị danh sách cho người dùng và hỏi: "Bạn muốn làm việc với file nào? (Nhập số thứ tự hoặc tên file)"
|
|
77
|
+
- Chờ người dùng chọn rồi mới tiếp tục.
|
|
78
78
|
|
|
79
|
-
##
|
|
79
|
+
## Bước 2 — Chạy Context Loader
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
Nạp toàn bộ context của dự án bằng cách làm theo quy trình trong `steps/context-loader.md`.
|
|
82
|
+
Lưu toàn bộ context đã nạp vào bộ nhớ để dùng xuyên suốt phiên làm việc của lệnh.
|
|
83
83
|
|
|
84
|
-
##
|
|
84
|
+
## Bước 3 — CHECKPOINT
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Sau khi hoàn thành Bước 1 và 2, hiển thị bản tóm tắt và chờ xác nhận:
|
|
87
87
|
|
|
88
88
|
```
|
|
89
89
|
CHECKPOINT
|
|
90
90
|
-----------
|
|
91
91
|
Target : {resolved file path}
|
|
92
|
-
Project : {project.name
|
|
92
|
+
Project : {project.name từ project-context.yaml}
|
|
93
93
|
Tech stack : {language} / {framework}
|
|
94
|
-
Module : {module
|
|
95
|
-
Domains : {
|
|
94
|
+
Module : {module nếu có, else "not configured"}
|
|
95
|
+
Domains : {danh sách domain, ngăn cách bởi dấu phẩy}
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
Tiếp tục? (Y/N)
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
- "Y" →
|
|
102
|
-
- "N" →
|
|
100
|
+
Chờ người dùng trả lời rõ ràng "Y" hoặc "N" rồi mới tiếp tục.
|
|
101
|
+
- "Y" → tiếp tục sang các bước riêng của lệnh bên dưới.
|
|
102
|
+
- "N" → dừng lại và hỏi người dùng muốn thay đổi gì.
|
|
103
103
|
|
|
104
104
|
|
|
105
|
-
###
|
|
105
|
+
### Quy tắc nội dung — chống jargon kỹ thuật *(áp dụng cho mọi PRD sinh ra)*
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
**1. PRD platform-agnostic — chỉ mô tả WHAT (nghiệp vụ), KHÔNG mô tả HOW (kỹ thuật).**
|
|
108
|
+
Viết AC / Business Rule / Business Logic theo *kết quả nghiệp vụ*, KHÔNG nhét chi tiết triển khai (API, JWT/token, endpoint, HTTP status, tên class/bảng/cột DB, query, spinner, animation…). Những thứ đó thuộc **Tech Docs** (kỹ thuật) hoặc **Design Spec** (giao diện).
|
|
108
109
|
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
| ✅ Viết trong PRD (nghiệp vụ) | ❌ KHÔNG viết trong PRD |
|
|
111
|
+
|---|---|
|
|
112
|
+
| "Đăng nhập thành công → truy cập được tính năng" | "API trả về JWT token" ← Tech Docs |
|
|
113
|
+
| "Sai mật khẩu 5 lần → khoá tài khoản 30 phút" | "Click button → hiện toast" ← Design Spec |
|
|
114
|
+
| "Phiên hết hạn → yêu cầu xác thực lại" | "Hiển thị spinner khi loading" ← Design Spec |
|
|
111
115
|
|
|
112
|
-
**
|
|
113
|
-
|
|
114
|
-
**Domain**: {domain}
|
|
115
|
-
**Ticket**: {TICKET_PREFIX}-{N} (if available)
|
|
116
|
-
**Date**: {date}
|
|
116
|
+
- Nếu PO đưa chi tiết UI (màu, layout, animation) → **nhắc**: *"Chi tiết UI này thuộc Design Spec, không thuộc PRD. Ghi nhận để tạo Design Spec sau."*
|
|
117
|
+
- Enum/thuật ngữ kỹ thuật ĐÃ chuẩn hoá trong domain-knowledge (vd `userType`, `TYPE_1`) thì giữ nguyên gốc — đây là từ vựng nghiệp vụ, KHÔNG phải jargon triển khai.
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
**2. Terminology — bám từ điển dự án.**
|
|
120
|
+
- Thay mọi **banned term** bằng canonical term (xem `business-dictionary.md` § Banned Terms); ghi chú việc thay ở mục **Giả định AI**.
|
|
121
|
+
- Status/Enum → lấy đúng giá trị trong `core-entities.md` (Enum Registry).
|
|
122
|
+
- **Thuật ngữ MỚI**: nếu input PO có từ chưa có trong `business-dictionary.md` và lặp ≥2 lần → **DỪNG, hỏi PO** (nghĩa là gì / canonical term / có thêm vào từ điển không) trước khi tiếp tục.
|
|
120
123
|
|
|
121
|
-
|
|
124
|
+
**3. Cross-reference bắt buộc.** Mọi chỗ nhắc TICKET-ID khác → inline link `[TICKET-ID](./file.md)` nếu file PRD tồn tại; không để plain text.
|
|
122
125
|
|
|
123
|
-
###
|
|
124
|
-
- {goal 1}
|
|
126
|
+
### Generate
|
|
125
127
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
Sinh PRD theo đúng cấu trúc chuẩn dưới đây (template canonical: `templates/prd.template.md`). Quy ước bắt buộc:
|
|
129
|
+
|
|
130
|
+
- **Ngôn ngữ:** heading + nội dung viết tiếng Việt (giữ thuật ngữ kỹ thuật/Enum nguyên gốc).
|
|
131
|
+
- **Tiêu đề file:** `# {TICKET}-{N} {Feature Name}` — KHÔNG thêm tiền tố "PRD —".
|
|
132
|
+
- **Tên file ghi ra:** `specs/{domain}/{prd-slug}/{TICKET}-{prd-slug}.md` (vd `SEG01-segment-scoring-service.md` — KHÔNG đặt tên `prd.md`; bố cục feature-package — mọi artifact của feature nằm chung folder này, PRD là file `.md` duy nhất ở gốc folder).
|
|
133
|
+
- **Business Rule:** đặt BÊN TRONG từng Use Case (không gom thành mục phẳng), bảng 3 cột `ID | Business Rule | Business Logic`; ID theo dạng `{TICKET}-{N}-UC{n}-BR{m}` (đánh số BR liên tục xuyên suốt các UC, không reset mỗi UC).
|
|
134
|
+
- **Acceptance Criteria:** danh sách phẳng `**AC{n}:**`, văn xuôi — KHÔNG ép Given/When/Then.
|
|
135
|
+
- **Liên kết:** trỏ tới PRD/tài liệu liên quan bằng link tương đối; trỏ `core-entities` / `business-dictionary` ở mục Tài liệu tham khảo.
|
|
136
|
+
- **Giả định AI:** nếu phát hiện độ vênh/giả định chưa được PO chốt → liệt kê thành `Q1…Qn` để PO xác nhận; nếu mọi thứ đã rõ từ product-definition → ghi "Không có — toàn bộ nội dung đã được PO xác nhận".
|
|
137
|
+
|
|
138
|
+
Template (cấu trúc đầu ra — single-source từ `templates/prd.template.md`):
|
|
139
|
+
|
|
140
|
+
````markdown
|
|
141
|
+
# {TICKET}-{N} {Feature Name}
|
|
142
|
+
|
|
143
|
+
<!--
|
|
144
|
+
Template này được sử dụng bởi workflow /generate-prd.
|
|
145
|
+
AI Agent sẽ điền các section dựa trên input từ PO.
|
|
146
|
+
Các placeholder {…} cần được thay thế bằng nội dung thực tế.
|
|
147
|
+
|
|
148
|
+
FORMAT CHUẨN: Business Rule = bảng 3 cột
|
|
149
|
+
ID | Business Rule | Business Logic (KHÔNG tách Business Logic ra khối riêng).
|
|
150
|
+
|
|
151
|
+
TERMINOLOGY:
|
|
152
|
+
- Tuân thủ 100% từ điển project: specs/domain-knowledge/business-dictionary.md
|
|
153
|
+
(KHÔNG dùng từ điển của project khác). Thay banned term bằng canonical term;
|
|
154
|
+
nếu phát hiện banned term trong input PO → thay + ghi chú trong "Giả định AI".
|
|
155
|
+
- Status/Enum values → tham chiếu core-entities.md (Enum Registry).
|
|
156
|
+
|
|
157
|
+
CROSS-REFERENCE (BẮT BUỘC): Bất kỳ chỗ nào nhắc đến một tính năng/ticket khác
|
|
158
|
+
(pre-condition, business rule, giả định, AC, hay bất kỳ section nào) → PHẢI gắn inline link:
|
|
159
|
+
[TICKET-ID khác](../{prd-slug-khác}/{TICKET-ID-khác}-{prd-slug-khác}.md)
|
|
160
|
+
Không để TICKET-ID dạng plain text nếu tồn tại file PRD tương ứng. (Mỗi PRD nằm trong feature-package riêng nên link trỏ sang folder anh em `../{prd-slug-khác}/`.)
|
|
161
|
+
Ngoài ra, ghi rõ quan hệ phụ thuộc trong "Tài liệu tham khảo" ở Appendix.
|
|
162
|
+
|
|
163
|
+
NEW TERM DETECTION: Nếu input PO xuất hiện thuật ngữ CHƯA CÓ trong business-dictionary.md
|
|
164
|
+
và lặp lại ≥ 2 lần → DỪNG lại, hỏi PO confirm trước khi tiếp tục:
|
|
165
|
+
+ Thuật ngữ đó nghĩa gì trong ngữ cảnh hệ thống?
|
|
166
|
+
+ English term chuẩn nên dùng là gì?
|
|
167
|
+
+ Có cần bổ sung vào business-dictionary.md không?
|
|
168
|
+
Sau khi PO confirm → cập nhật business-dictionary.md (nếu PO đồng ý) rồi mới tiếp tục.
|
|
169
|
+
|
|
170
|
+
NUMBERING:
|
|
171
|
+
- UC ID: {TICKET}-{N}-UC{n} (n bắt đầu từ 1, tăng theo từng use case)
|
|
172
|
+
- BR ID: {TICKET}-{N}-UC{n}-BR{m} (m tăng LIÊN TỤC xuyên suốt PRD, KHÔNG reset mỗi UC)
|
|
173
|
+
-->
|
|
128
174
|
|
|
129
|
-
|
|
175
|
+
---
|
|
130
176
|
|
|
131
|
-
|
|
177
|
+
## Metadata
|
|
132
178
|
|
|
133
|
-
|
|
179
|
+
| Field | Value |
|
|
180
|
+
|---------------|------------------------------------------|
|
|
181
|
+
| **PRD ID** | {TICKET}-{N} |
|
|
182
|
+
| **Version** | 1.0 |
|
|
183
|
+
| **Status** | draft |
|
|
184
|
+
| **Author** | AI-assisted |
|
|
185
|
+
| **Domain** | {domain} |
|
|
186
|
+
| **Created** | {date} |
|
|
187
|
+
| **Updated** | {date} |
|
|
188
|
+
| **Jira Ticket** | [{TICKET}-{N}]({ticket_url}) |
|
|
189
|
+
| **API Source** | *(để trống nếu greenfield — chỉ điền `existing` khi PRD bọc một API đã chạy production)* |
|
|
134
190
|
|
|
135
|
-
|
|
136
|
-
|-------|------|----------|-------------|
|
|
137
|
-
| {DOMAIN}-UC1 | {name} | High | {description} |
|
|
191
|
+
---
|
|
138
192
|
|
|
139
|
-
|
|
193
|
+
# Feature
|
|
140
194
|
|
|
141
|
-
|
|
142
|
-
|-------|------|----|
|
|
143
|
-
| BR-1 | {rule} | UC1 |
|
|
195
|
+
**{Feature Name}**
|
|
144
196
|
|
|
145
|
-
|
|
197
|
+
{Đoạn mô tả tổng quan: feature làm gì, cho ai, giải quyết vấn đề gì — lấy từ product-definition.}
|
|
146
198
|
|
|
147
|
-
|
|
148
|
-
- AC1: Given {context}, when {action}, then {result}
|
|
199
|
+
---
|
|
149
200
|
|
|
150
|
-
|
|
151
|
-
{from product-definition}
|
|
201
|
+
# 1. Tổng quan
|
|
152
202
|
|
|
153
|
-
##
|
|
154
|
-
{from product-definition}
|
|
203
|
+
## a. User Story
|
|
155
204
|
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
|
|
205
|
+
- **Là một (As a)** {persona}
|
|
206
|
+
- **Tôi muốn (I want to)** {action}
|
|
207
|
+
- **Để (So that)** {benefit}
|
|
159
208
|
|
|
160
|
-
|
|
209
|
+
## b. Phạm vi
|
|
161
210
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
```
|
|
211
|
+
**In Scope**
|
|
212
|
+
- {hạng mục trong phạm vi 1}
|
|
213
|
+
- {hạng mục trong phạm vi 2}
|
|
166
214
|
|
|
167
|
-
|
|
215
|
+
**Out of Scope** *(chỉ thêm khi có ranh giới cần nói rõ)*
|
|
216
|
+
- {hạng mục ngoài phạm vi + lý do / chủ sở hữu}
|
|
168
217
|
|
|
169
|
-
|
|
218
|
+
---
|
|
170
219
|
|
|
171
|
-
|
|
220
|
+
# 2. Acceptance Criteria
|
|
172
221
|
|
|
173
|
-
|
|
174
|
-
- `✅ Complete` — all steps succeeded, no issues found
|
|
175
|
-
- `❌ Failed` — command could not complete due to a blocking error
|
|
176
|
-
- `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
|
|
222
|
+
**AC1:** {Tiêu chí nghiệm thu, văn xuôi, kiểm chứng được.}
|
|
177
223
|
|
|
178
|
-
|
|
224
|
+
**AC2:** {…}
|
|
179
225
|
|
|
180
|
-
|
|
181
|
-
```
|
|
182
|
-
Output Artifacts:
|
|
183
|
-
{created|updated} {file-path} ({brief description})
|
|
184
|
-
{created|updated} {file-path} ({brief description})
|
|
185
|
-
```
|
|
226
|
+
---
|
|
186
227
|
|
|
187
|
-
|
|
228
|
+
# 3. Use Case
|
|
188
229
|
|
|
189
|
-
|
|
230
|
+
#### {TICKET}-{N}-UC1: {Tên use case}
|
|
190
231
|
|
|
191
|
-
|
|
192
|
-
so the user always sees where this command sits in the end-to-end flow:
|
|
232
|
+
**Actor:** {actor}
|
|
193
233
|
|
|
194
|
-
|
|
195
|
-
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
196
|
-
```
|
|
234
|
+
**Description:** {mô tả luồng}
|
|
197
235
|
|
|
198
|
-
|
|
236
|
+
**Pre-condition:**
|
|
237
|
+
- {điều kiện trước 1}
|
|
199
238
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
| Discovery | `/define-product` |
|
|
203
|
-
| PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
|
|
204
|
-
| Design Spec | `/generate-design-spec` |
|
|
205
|
-
| BDD | `/generate-bdd` · `/review-context` (BDD) |
|
|
206
|
-
| Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
|
|
207
|
-
| Code | `/generate-code` · `/review-code` |
|
|
208
|
-
| Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
|
|
209
|
-
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
210
|
-
| Trace Audit | `/validate-traces` |
|
|
239
|
+
**Post-condition:**
|
|
240
|
+
- {kết quả sau 1}
|
|
211
241
|
|
|
212
|
-
|
|
213
|
-
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
242
|
+
**Business Rule**
|
|
214
243
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
244
|
+
| ID | Business Rule | Business Logic |
|
|
245
|
+
|----|---------------|----------------|
|
|
246
|
+
| {TICKET}-{N}-UC1-BR1 | {luật ngắn gọn} | - {logic chi tiết, xuống dòng bằng `<br/>`}<br/>- {…} |
|
|
247
|
+
| {TICKET}-{N}-UC1-BR2 | {…} | - {…} |
|
|
218
248
|
|
|
219
|
-
|
|
249
|
+
---
|
|
220
250
|
|
|
221
|
-
|
|
251
|
+
#### {TICKET}-{N}-UC2: {Tên use case}
|
|
252
|
+
|
|
253
|
+
{lặp cấu trúc UC như trên; BR đánh số tiếp tục BR3, BR4…}
|
|
222
254
|
|
|
223
|
-
| Current command | Suggest next |
|
|
224
|
-
|-------------------------|-----------------------------------------------|
|
|
225
|
-
| /setup-ai-first | `/define-product` to start your first feature |
|
|
226
|
-
| /define-product | `/generate-prd {product-definition-file}` |
|
|
227
|
-
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
228
|
-
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
229
|
-
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
230
|
-
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
231
|
-
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
232
|
-
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
233
|
-
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
234
|
-
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
235
|
-
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
236
|
-
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
237
|
-
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
238
|
-
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
239
|
-
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
240
|
-
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
241
|
-
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
242
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/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}` or `/debug {error}` |
|
|
246
|
-
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
247
|
-
| /dev-smoke-test | Create PR and link to ticket |
|
|
248
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
249
|
-
| /fix-bug | Create PR and link to ticket |
|
|
250
|
-
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
251
|
-
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
252
|
-
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
253
|
-
| /learn | Continue working — lesson applies on next command |
|
|
254
|
-
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
255
|
-
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
256
|
-
|
|
257
|
-
Format the footer as:
|
|
258
|
-
```
|
|
259
255
|
---
|
|
260
|
-
Status : {badge}
|
|
261
|
-
{Output Artifacts block}
|
|
262
|
-
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
263
|
-
(review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
|
|
264
|
-
Next : {suggested command with example arguments}
|
|
265
|
-
```
|
|
266
|
-
*(Omit the `Pipeline` line for cross-cutting commands listed above.)*
|
|
267
256
|
|
|
257
|
+
# 4. UI/UX Guidelines
|
|
268
258
|
|
|
269
|
-
|
|
259
|
+
## a. User Flow
|
|
270
260
|
|
|
271
|
-
|
|
261
|
+
```mermaid
|
|
262
|
+
flowchart TD
|
|
263
|
+
START(["{điểm bắt đầu}"]) --> A{"{điểm quyết định}"}
|
|
264
|
+
A -->|{nhánh}| B["{bước}"]
|
|
265
|
+
```
|
|
272
266
|
|
|
273
|
-
|
|
267
|
+
## b. Wireframe
|
|
274
268
|
|
|
275
|
-
###
|
|
269
|
+
### Screen 1: {Tên màn}
|
|
276
270
|
|
|
277
|
-
|
|
278
|
-
|
|
271
|
+
| Thành phần | Chi tiết |
|
|
272
|
+
|------------|----------|
|
|
273
|
+
| **Screen** | {tên/ngữ cảnh màn} |
|
|
274
|
+
| **Components** | - {thành phần 1}<br/>- {thành phần 2} |
|
|
275
|
+
| **Actions** | - {hành động 1 → kết quả}<br/>- {hành động 2 → kết quả} |
|
|
279
276
|
|
|
280
|
-
|
|
277
|
+
---
|
|
281
278
|
|
|
282
|
-
|
|
279
|
+
### Screen 2: {Tên màn}
|
|
283
280
|
|
|
284
|
-
|
|
281
|
+
{lặp bảng như trên cho từng màn}
|
|
285
282
|
|
|
286
|
-
|
|
287
|
-
2. If it parses successfully **and** contains `"_agent_mode": true`:
|
|
288
|
-
- **Skip Steps 1, 2, and 3 of this Gate entirely.**
|
|
289
|
-
- Set target file = `payload.target_file`
|
|
290
|
-
- Set loaded context = `payload.context` (do NOT run context-loader.md)
|
|
291
|
-
- Set UC scope = `payload.uc_id` (process only this UC)
|
|
292
|
-
- Set line range = `payload.uc_section` (read only that PRD section)
|
|
293
|
-
- Proceed directly to the command-specific logic.
|
|
294
|
-
3. If `$ARGUMENTS` is not JSON or `_agent_mode` is absent → continue to Step 1 (normal mode).
|
|
283
|
+
---
|
|
295
284
|
|
|
296
|
-
|
|
285
|
+
# Appendix
|
|
297
286
|
|
|
298
|
-
|
|
287
|
+
## Input gốc từ PO
|
|
299
288
|
|
|
300
|
-
|
|
301
|
-
Using a smaller model risks missed edge cases, incomplete spec analysis, and architecture violations.
|
|
289
|
+
> {Trích nguyên văn input/ghi chú gốc của PO + đường dẫn product-definition nguồn.}
|
|
302
290
|
|
|
303
|
-
|
|
291
|
+
## Tài liệu tham khảo
|
|
304
292
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
Recommended : claude-opus-4 (or latest Opus model)
|
|
309
|
-
Why needed : Spec analysis, architecture review, code generation
|
|
310
|
-
require deep reasoning. Smaller models miss edge cases.
|
|
293
|
+
- [{TICKET liên quan}](../{prd-slug-khác}/{TICKET-ID-khác}-{prd-slug-khác}.md) — {quan hệ: pre-condition / overlapping / related…}
|
|
294
|
+
- Từ điển nghiệp vụ: `{path}/business-dictionary.md`
|
|
295
|
+
- Domain knowledge: `{path}/{domain}.md`
|
|
311
296
|
|
|
312
|
-
|
|
313
|
-
• Settings → Model → select "claude-opus"
|
|
314
|
-
• or: /model → choose claude-opus
|
|
297
|
+
## Existing API Contract *(CHỈ brownfield — điền khi API Source = existing; greenfield BỎ QUA cả section này)*
|
|
315
298
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
299
|
+
<!--
|
|
300
|
+
Chỉ dùng khi PRD bọc một API đã tồn tại trên hệ thống. PO ghi lại contract để:
|
|
301
|
+
- /generate-bdd (system) dùng trực tiếp làm input — không cần tổng hợp từ FE/App BDD;
|
|
302
|
+
- /generate-tech-docs chạy mode reverse-document (mô tả lại as-is, không design mới);
|
|
303
|
+
- /review-tech-docs bỏ qua cổng T7 cross-team sign-off (contract đã cố định).
|
|
304
|
+
Nếu greenfield (thiết kế mới) → xoá toàn bộ section này.
|
|
305
|
+
-->
|
|
321
306
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
307
|
+
| Method | Path | Auth | Request | Response |
|
|
308
|
+
|--------|------|------|---------|----------|
|
|
309
|
+
| {GET/POST/PUT/DELETE} | {/api/v1/path} | {Bearer / none} | `{ field: type }` | `{ field: type }` |
|
|
325
310
|
|
|
326
|
-
|
|
311
|
+
**Error responses:**
|
|
327
312
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
- **PRD commands** (target is `prd.md`): `{specs_dir}/{domain}/*/prd.md` (match the feature folder whose id corresponds), else `{specs_dir}/*/*/prd.md`.
|
|
332
|
-
- **tech-docs commands**: `{specs_dir}/{domain}/*/tech-docs/{UC-ID}*-tech-design*.md`.
|
|
333
|
-
- **design-spec commands**: `{specs_dir}/{domain}/*/design-spec/{TICKET-ID}*.md`.
|
|
313
|
+
| HTTP Status | Error Code | Khi nào xảy ra |
|
|
314
|
+
|-------------|------------|----------------|
|
|
315
|
+
| {4xx/5xx} | {ERR_CODE} | {condition} |
|
|
334
316
|
|
|
335
|
-
|
|
336
|
-
3. If `$ARGUMENTS` is empty or no match found:
|
|
337
|
-
- List files in the relevant directory for this command (e.g., `specs/*/*/prd.md` for PRD commands, `specs/*/*/bdd/**/*.feature` for BDD commands).
|
|
338
|
-
- Present the list to the user and ask: "Which file do you want to work with? (Enter number or filename)"
|
|
339
|
-
- Wait for user selection before continuing.
|
|
317
|
+
## Giả định AI
|
|
340
318
|
|
|
341
|
-
|
|
319
|
+
> {Giả định / độ vênh AI phát hiện khi đối chiếu product-definition với domain-knowledge — cần PO review. AI KHÔNG tự hoà giải.}
|
|
342
320
|
|
|
343
|
-
|
|
344
|
-
Store all loaded context in memory for use throughout this command session.
|
|
321
|
+
- **Q1 — [AI DRAFT] {tiêu đề}:** {mô tả độ vênh + nguồn}. **Cần PO chốt {điều gì}.**
|
|
345
322
|
|
|
346
|
-
|
|
323
|
+
_(Nếu không có độ vênh: ghi "Không có — toàn bộ nội dung đã được PO xác nhận qua Product Definition.")_
|
|
347
324
|
|
|
348
|
-
|
|
325
|
+
---
|
|
349
326
|
|
|
350
|
-
|
|
351
|
-
CHECKPOINT
|
|
352
|
-
-----------
|
|
353
|
-
Target : {resolved file path}
|
|
354
|
-
Project : {project.name from project-context.yaml}
|
|
355
|
-
Tech stack : {language} / {framework}
|
|
356
|
-
Module : {module if set, else "not configured"}
|
|
357
|
-
Domains : {comma-separated domain list}
|
|
327
|
+
# Change Log
|
|
358
328
|
|
|
359
|
-
|
|
360
|
-
```
|
|
329
|
+
### v1.0 — {mô tả} ({date})
|
|
361
330
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
### Analyze — 4 Lenses (run all four perspectives)
|
|
368
|
-
|
|
369
|
-
#### QA Lens — Test Coverage & Edge Cases
|
|
370
|
-
Evaluate:
|
|
371
|
-
- Are all acceptance criteria testable and measurable?
|
|
372
|
-
- Are edge cases and error scenarios specified?
|
|
373
|
-
- Are boundary conditions defined?
|
|
374
|
-
- Is there ambiguity in expected behavior?
|
|
375
|
-
|
|
376
|
-
#### DEV Lens — Technical Clarity & Feasibility
|
|
377
|
-
Evaluate:
|
|
378
|
-
- Are API inputs/outputs clearly defined?
|
|
379
|
-
- Are business rules unambiguous enough to implement?
|
|
380
|
-
- Are there performance or scalability concerns?
|
|
381
|
-
- Are cross-service dependencies fully described?
|
|
382
|
-
- Is there anything technically infeasible or risky?
|
|
383
|
-
|
|
384
|
-
#### SA Lens — Architecture & Design
|
|
385
|
-
Evaluate:
|
|
386
|
-
- Does this fit the existing architecture?
|
|
387
|
-
- Are there design patterns or constraints to apply?
|
|
388
|
-
- Is data modeling clear (entities, relationships)?
|
|
389
|
-
- Are there security or auth implications?
|
|
390
|
-
|
|
391
|
-
#### PO Lens — Business Value & Scope
|
|
392
|
-
Evaluate:
|
|
393
|
-
- Is scope clearly bounded?
|
|
394
|
-
- Are priorities clear?
|
|
395
|
-
- Are success metrics defined?
|
|
396
|
-
- Are stakeholder needs fully captured?
|
|
397
|
-
- Any scope creep risk?
|
|
398
|
-
|
|
399
|
-
### Write Output
|
|
400
|
-
|
|
401
|
-
Derive the output filename from the PRD slug:
|
|
402
|
-
- PRD file: `specs/payment/create-invoice/prd.md` → output: `.agent/review/create-invoice-findings.yaml`
|
|
403
|
-
- Rule: take the PRD's parent folder name (the `prd-slug`), append `-findings.yaml`
|
|
404
|
-
|
|
405
|
-
Write findings to `.agent/review/{prd-slug}-findings.yaml`:
|
|
406
|
-
|
|
407
|
-
```yaml
|
|
408
|
-
# Generated by /refine-prd
|
|
409
|
-
# Review each finding and mark: accepted / rejected / needs_discussion
|
|
410
|
-
prd_source: "specs/{domain}/{prd-slug}/prd.md"
|
|
411
|
-
generated_at: "{ISO datetime}"
|
|
412
|
-
status: "pending_review"
|
|
413
|
-
|
|
414
|
-
findings:
|
|
415
|
-
- id: "F001"
|
|
416
|
-
lens: "QA" # QA | DEV | SA | PO
|
|
417
|
-
severity: "major" # critical | major | minor
|
|
418
|
-
section: "§6. Acceptance Criteria"
|
|
419
|
-
finding: "{Clear description of the gap or issue}"
|
|
420
|
-
suggestion: "{Specific actionable improvement}"
|
|
421
|
-
status: "pending" # pending | accepted | rejected | needs_discussion
|
|
422
|
-
|
|
423
|
-
- id: "F002"
|
|
424
|
-
lens: "DEV"
|
|
425
|
-
severity: "minor"
|
|
426
|
-
section: "§8. Cross-Service Dependencies"
|
|
427
|
-
finding: "{finding}"
|
|
428
|
-
suggestion: "{suggestion}"
|
|
429
|
-
status: "pending"
|
|
430
|
-
|
|
431
|
-
summary:
|
|
432
|
-
total_findings: {N}
|
|
433
|
-
by_severity:
|
|
434
|
-
critical: {N}
|
|
435
|
-
major: {N}
|
|
436
|
-
minor: {N}
|
|
437
|
-
by_lens:
|
|
438
|
-
QA: {N}
|
|
439
|
-
DEV: {N}
|
|
440
|
-
SA: {N}
|
|
441
|
-
PO: {N}
|
|
442
|
-
recommendation: "APPROVED_WITH_MINOR_CHANGES | NEEDS_REVISION | BLOCKED"
|
|
443
|
-
```
|
|
331
|
+
| Mục | Thay đổi |
|
|
332
|
+
|-----|----------|
|
|
333
|
+
| — | Bản đầu — sinh từ product-definition. |
|
|
444
334
|
|
|
445
|
-
|
|
335
|
+
---
|
|
446
336
|
|
|
447
|
-
|
|
448
|
-
|
|
337
|
+
<!--
|
|
338
|
+
NEXT STEPS:
|
|
339
|
+
Khi PRD được approve (status: approved), chạy:
|
|
340
|
+
/generate-bdd "specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md"
|
|
341
|
+
để sinh BDD feature specs từ PRD này.
|
|
342
|
+
-->
|
|
449
343
|
|
|
450
|
-
|
|
451
|
-
🔴 Critical: {N} 🟡 Major: {N} 🟢 Minor: {N}
|
|
344
|
+
````
|
|
452
345
|
|
|
453
|
-
|
|
454
|
-
[F001] QA/major — {brief description}
|
|
455
|
-
[F002] DEV/minor — {brief description}
|
|
346
|
+
### Output
|
|
456
347
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
348
|
+
```
|
|
349
|
+
✅ Đã tạo PRD: specs/{domain}/{prd-slug}/{TICKET}-{prd-slug}.md
|
|
350
|
+
Status: draft
|
|
460
351
|
```
|
|
461
352
|
|
|
462
|
-
# Report Footer —
|
|
353
|
+
# Report Footer — Định dạng output chuẩn cho mọi lệnh
|
|
463
354
|
|
|
464
|
-
|
|
355
|
+
Mọi report của lệnh phải kết thúc bằng section footer chuẩn này.
|
|
465
356
|
|
|
466
357
|
## Status Badge
|
|
467
358
|
|
|
468
|
-
|
|
469
|
-
- `✅ Complete` —
|
|
470
|
-
- `❌ Failed` —
|
|
471
|
-
- `⚠️ Warnings` —
|
|
359
|
+
Chọn một theo kết quả:
|
|
360
|
+
- `✅ Complete` — mọi bước thành công, không có vấn đề
|
|
361
|
+
- `❌ Failed` — lệnh không hoàn thành được do lỗi chặn
|
|
362
|
+
- `⚠️ Warnings` — hoàn thành nhưng có vấn đề không chặn, nên review lại
|
|
472
363
|
|
|
473
364
|
## Output Artifacts
|
|
474
365
|
|
|
475
|
-
|
|
366
|
+
Liệt kê mọi file được tạo hoặc sửa bởi lệnh này:
|
|
476
367
|
```
|
|
477
368
|
Output Artifacts:
|
|
478
|
-
{created|updated} {file-path} ({
|
|
479
|
-
{created|updated} {file-path} ({
|
|
369
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
370
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
480
371
|
```
|
|
481
372
|
|
|
482
|
-
|
|
373
|
+
Nếu không ghi file nào (vd: lệnh review hoặc phân tích) → ghi `Output Artifacts: none (read-only)`.
|
|
483
374
|
|
|
484
375
|
## Pipeline Position
|
|
485
376
|
|
|
486
|
-
|
|
487
|
-
|
|
377
|
+
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`,
|
|
378
|
+
để người dùng luôn thấy lệnh này nằm ở đâu trong luồng end-to-end:
|
|
488
379
|
|
|
489
380
|
```
|
|
490
381
|
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
491
382
|
```
|
|
492
383
|
|
|
493
|
-
|
|
384
|
+
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:
|
|
494
385
|
|
|
495
386
|
| Phase | Commands |
|
|
496
387
|
|-------|----------|
|
|
@@ -504,59 +395,72 @@ Find the current command in this phase legend and mark **its** phase in the map
|
|
|
504
395
|
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
505
396
|
| Trace Audit | `/validate-traces` |
|
|
506
397
|
|
|
507
|
-
|
|
398
|
+
Với **lệnh review**, thêm vòng review 3 bước và đánh dấu bước hiện tại, vd:
|
|
508
399
|
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
509
400
|
|
|
510
|
-
**
|
|
511
|
-
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`)
|
|
512
|
-
**
|
|
401
|
+
**Lệnh xuyên suốt** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
|
|
402
|
+
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) nằm ngoài pipeline tuyến tính —
|
|
403
|
+
**bỏ hẳn dòng Pipeline** cho các lệnh này (đừng cố nhét chúng vào sơ đồ).
|
|
513
404
|
|
|
514
|
-
##
|
|
405
|
+
## Gợi ý lệnh tiếp theo
|
|
515
406
|
|
|
516
|
-
|
|
407
|
+
Gợi ý lệnh kế tiếp hợp lý theo phase của workflow:
|
|
517
408
|
|
|
518
|
-
|
|
|
409
|
+
| Lệnh hiện tại | Gợi ý lệnh tiếp theo |
|
|
519
410
|
|-------------------------|-----------------------------------------------|
|
|
520
|
-
| /setup-ai-first | `/define-product`
|
|
411
|
+
| /setup-ai-first | `/define-product` để bắt đầu feature đầu tiên |
|
|
521
412
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
522
|
-
| /generate-prd | `/refine-prd {prd-file}`
|
|
523
|
-
| /refine-prd |
|
|
524
|
-
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (
|
|
525
|
-
| /generate-design-spec | Designer review →
|
|
526
|
-
| /generate-bdd | `/review-context {feature-file}`
|
|
527
|
-
| /review-context (BDD) | `/generate-tech-docs {UC-ID}`
|
|
528
|
-
| /qc-analyze | `/qc-plan {UC-ID}` (
|
|
413
|
+
| /generate-prd | `/refine-prd {prd-file}` rồi `/review-context {prd-file}` |
|
|
414
|
+
| /refine-prd | Mở Review Board → cập nhật PRD → `/review-context {prd-file}` |
|
|
415
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (rồi BDD sau khi sign-off); BE: `/generate-bdd {prd-file}` trực tiếp; sửa PRD nếu NEEDS_FIX |
|
|
416
|
+
| /generate-design-spec | Designer review → xác nhận link Figma → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
417
|
+
| /generate-bdd | `/review-context {feature-file}` để kiểm tra độ phủ |
|
|
418
|
+
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` nếu APPROVED; sinh lại nếu NEEDS_FIX |
|
|
419
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (xử lý các gap blocker 🔴 trước) |
|
|
529
420
|
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
530
|
-
| /qc-design-test | `/qc-review {UC-ID}` (test-case
|
|
531
|
-
| /qc-review (test-case) | `/qc-run-test {UC-ID}`
|
|
532
|
-
| /qc-run-test | `/qc-report {UC-ID}`
|
|
533
|
-
| /qc-review (script) | `/qc-report {UC-ID}`
|
|
534
|
-
| /qc-report | `/validate-traces {UC-ID}`
|
|
421
|
+
| /qc-design-test | `/qc-review {UC-ID}` (review test-case) |
|
|
422
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` nếu APPROVED; sửa TC nếu NEEDS_FIX |
|
|
423
|
+
| /qc-run-test | `/qc-report {UC-ID}` rồi `/qc-review {UC-ID}` (review script) |
|
|
424
|
+
| /qc-review (script) | `/qc-report {UC-ID}` rồi tạo PR nếu APPROVED |
|
|
425
|
+
| /qc-report | `/validate-traces {UC-ID}` để làm mới Living Docs (qc_status) |
|
|
535
426
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
536
|
-
| /review-tech-docs | `/generate-code {feature-file}`
|
|
537
|
-
| /generate-code |
|
|
427
|
+
| /review-tech-docs | `/generate-code {feature-file}` nếu APPROVED; sửa doc nếu NEEDS_FIX |
|
|
428
|
+
| /generate-code | Lần gen đầu → `/review-code {UC-ID}`; gen lại → `/dev-gen-test {UC-ID}` |
|
|
538
429
|
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
539
430
|
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
540
|
-
| /dev-run-test (failing) | `/fix-bug {ticket-id}`
|
|
541
|
-
| /review-code | `/dev-smoke-test {UC-ID}`
|
|
542
|
-
| /dev-smoke-test |
|
|
543
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`;
|
|
544
|
-
| /fix-bug |
|
|
545
|
-
| /debug | `/fix-bug {ticket-id}`
|
|
546
|
-
| /report-bug |
|
|
547
|
-
| /propose-scenario |
|
|
548
|
-
| /learn |
|
|
549
|
-
| /sync | `/validate-traces`
|
|
550
|
-
| /update-framework | Review `git diff .agent/`, commit; `/sync`
|
|
551
|
-
|
|
552
|
-
|
|
431
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` hoặc `/debug {error}` |
|
|
432
|
+
| /review-code | `/dev-smoke-test {UC-ID}` hoặc tạo PR |
|
|
433
|
+
| /dev-smoke-test | Tạo PR và link tới ticket |
|
|
434
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; tất cả OK → tạo PR |
|
|
435
|
+
| /fix-bug | Tạo PR và link tới ticket |
|
|
436
|
+
| /debug | `/fix-bug {ticket-id}` nếu cần sửa |
|
|
437
|
+
| /report-bug | Gửi cho dev (`/fix-bug {BUG-ID}`); nếu thiếu coverage → `/propose-scenario {UC-ID}` |
|
|
438
|
+
| /propose-scenario | Báo PO/Dev review proposal trong `feedback/bdd-proposals/` |
|
|
439
|
+
| /learn | Tiếp tục làm việc — lesson áp dụng ở lệnh kế tiếp |
|
|
440
|
+
| /sync | `/validate-traces` để xem độ phủ đầy đủ; xử lý mọi `📥 tester feedback` được nêu |
|
|
441
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` để đồng bộ nội dung dự án |
|
|
442
|
+
|
|
443
|
+
Định dạng footer như sau:
|
|
553
444
|
```
|
|
554
445
|
---
|
|
555
446
|
Status : {badge}
|
|
556
|
-
{Output Artifacts
|
|
447
|
+
{khối Output Artifacts}
|
|
557
448
|
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
558
|
-
(review
|
|
559
|
-
Next : {
|
|
449
|
+
(lệnh review) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
|
|
450
|
+
Next : {lệnh gợi ý kèm ví dụ tham số}
|
|
560
451
|
```
|
|
561
|
-
*(
|
|
452
|
+
*(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## /refine-prd — Phân tích PRD qua 4 lăng kính review
|
|
458
|
+
|
|
459
|
+
Lệnh này thực thi **y hệt** `commands/refine-prd.md` — không nhân bản logic ở đây để tránh lệch schema findings.
|
|
460
|
+
|
|
461
|
+
`commands/refine-prd.md` bao gồm:
|
|
462
|
+
- Phân tích PRD bằng 4 lăng kính **fan-out đa sub-agent** (QA / DEV / SA / PO) + vòng completeness-critic (1 lần chạy ra đủ finding).
|
|
463
|
+
- Ghi findings YAML với **schema đầy đủ** (`uc_id`, `quote`, `auto_fixable`) — bắt buộc cho source-jump và nút "Apply to PRD" của Review Board.
|
|
464
|
+
- **Resume Mode** (`--resume`): áp dụng findings đã accept → bump version → ghi changelog → reset `draft`.
|
|
562
465
|
|
|
466
|
+
→ **Đọc và tuân theo `commands/refine-prd.md`** với cùng `$ARGUMENTS`.
|