@educa-corp/sdd-framework 0.2.3 → 0.2.5

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.
Files changed (150) hide show
  1. package/commands/generate-architecture.md +706 -0
  2. package/commands/generate-architecture.tmpl +194 -0
  3. package/commands/generate-code.md +16 -2
  4. package/commands/generate-code.tmpl +16 -2
  5. package/commands/generate-tech-docs.md +19 -0
  6. package/commands/generate-tech-docs.tmpl +19 -0
  7. package/core/FRAMEWORK_VERSION +1 -1
  8. package/core/commands/generate-architecture.md +706 -0
  9. package/core/commands/generate-code.md +16 -2
  10. package/core/commands/generate-tech-docs.md +19 -0
  11. package/core/skills/setup-ai-first/SKILL.md +12 -4
  12. package/core/templates/architecture.template.md +392 -111
  13. package/docs/01-getting-started/installation.md +47 -112
  14. package/docs/01-getting-started/quickstart.md +58 -72
  15. package/docs/01-getting-started/what-is-sdd.md +75 -0
  16. package/docs/02-concepts/architecture.md +109 -0
  17. package/docs/02-concepts/glossary.md +87 -0
  18. package/docs/02-concepts/overview.md +93 -0
  19. package/docs/02-concepts/pipeline-steps/00-setup.md +102 -0
  20. package/docs/02-concepts/pipeline-steps/01-discovery.md +129 -0
  21. package/docs/02-concepts/pipeline-steps/02-specification.md +130 -0
  22. package/docs/02-concepts/pipeline-steps/03-design-spec.md +90 -0
  23. package/docs/02-concepts/pipeline-steps/04-bdd.md +120 -0
  24. package/docs/02-concepts/pipeline-steps/05-tech-docs.md +101 -0
  25. package/docs/02-concepts/pipeline-steps/06-code.md +119 -0
  26. package/docs/02-concepts/pipeline-steps/07-dev-selftest.md +92 -0
  27. package/docs/02-concepts/pipeline-steps/08-qc-automation.md +102 -0
  28. package/docs/02-concepts/pipeline-steps/09-validate-traces.md +104 -0
  29. package/docs/02-concepts/pipeline-steps/10-feedback-loop.md +105 -0
  30. package/docs/02-concepts/pipeline-steps/README.md +92 -0
  31. package/docs/02-concepts/roles-and-hitl.md +73 -0
  32. package/docs/02-concepts/traceability.md +94 -0
  33. package/docs/03-guides/architect.md +98 -0
  34. package/docs/03-guides/developer.md +76 -0
  35. package/docs/03-guides/product-owner.md +68 -0
  36. package/docs/03-guides/tester-qa.md +70 -0
  37. package/docs/04-reference/commands.md +105 -0
  38. package/docs/04-reference/configuration.md +94 -0
  39. package/docs/04-reference/model-selection.md +68 -0
  40. package/docs/04-reference/modules.md +74 -0
  41. package/docs/04-reference/trace-schema.md +93 -0
  42. package/docs/README.md +29 -40
  43. package/docs/explain/00-setup-ai-first.md +77 -0
  44. package/docs/explain/00b-generate-architecture.md +76 -0
  45. package/docs/explain/01-define-product.md +79 -0
  46. package/docs/explain/02-generate-prd.md +78 -0
  47. package/docs/explain/03-refine-prd.md +86 -0
  48. package/docs/explain/04-review-context.md +100 -0
  49. package/docs/explain/05-generate-design-spec.md +73 -0
  50. package/docs/explain/06-generate-bdd.md +77 -0
  51. package/docs/explain/07-generate-tech-docs.md +71 -0
  52. package/docs/explain/08-review-tech-docs.md +79 -0
  53. package/docs/explain/09-generate-code.md +78 -0
  54. package/docs/explain/10-review-code.md +70 -0
  55. package/docs/explain/11-map-testids.md +69 -0
  56. package/docs/explain/12-dev-gen-test.md +66 -0
  57. package/docs/explain/13-dev-run-test.md +69 -0
  58. package/docs/explain/14-dev-smoke-test.md +67 -0
  59. package/docs/explain/15-qc-analyze.md +68 -0
  60. package/docs/explain/16-qc-plan.md +61 -0
  61. package/docs/explain/17-qc-design-test.md +61 -0
  62. package/docs/explain/18-qc-review.md +59 -0
  63. package/docs/explain/19-qc-run-test.md +67 -0
  64. package/docs/explain/20-qc-report.md +61 -0
  65. package/docs/explain/21-validate-traces.md +68 -0
  66. package/docs/explain/22-generate-spec-manifest.md +60 -0
  67. package/docs/explain/23-fix-bug.md +69 -0
  68. package/docs/explain/24-debug.md +61 -0
  69. package/docs/explain/25-report-bug.md +65 -0
  70. package/docs/explain/26-propose-scenario.md +63 -0
  71. package/docs/explain/27-learn.md +65 -0
  72. package/docs/explain/28-sync.md +70 -0
  73. package/docs/explain/29-update-framework.md +65 -0
  74. package/docs/explain/README.md +134 -0
  75. package/package.json +1 -1
  76. package/skills/setup-ai-first/SKILL.md +12 -4
  77. package/skills/setup-ai-first/SKILL.tmpl +12 -4
  78. package/templates/architecture.template.md +392 -111
  79. package/docs/01-getting-started/README.md +0 -19
  80. package/docs/01-getting-started/core-concepts.md +0 -102
  81. package/docs/02-guides/README.md +0 -26
  82. package/docs/02-guides/bdd-input-checklist.md +0 -68
  83. package/docs/02-guides/developer/README.md +0 -49
  84. package/docs/02-guides/developer/bdd-and-trace.md +0 -126
  85. package/docs/02-guides/developer/commands.md +0 -76
  86. package/docs/02-guides/developer/pr-checklist.md +0 -16
  87. package/docs/02-guides/developer/scenarios.md +0 -460
  88. package/docs/02-guides/developer/workflow.md +0 -121
  89. package/docs/02-guides/prd-input-checklist.md +0 -94
  90. package/docs/02-guides/product-owner/README.md +0 -81
  91. package/docs/02-guides/product-owner/commands.md +0 -30
  92. package/docs/02-guides/product-owner/handoff-checklist.md +0 -42
  93. package/docs/02-guides/product-owner/prd-writing-rules.md +0 -45
  94. package/docs/02-guides/product-owner/scenarios.md +0 -438
  95. package/docs/02-guides/tech-docs-input-checklist.md +0 -109
  96. package/docs/02-guides/tester/README.md +0 -75
  97. package/docs/02-guides/tester/bug-reporting.md +0 -117
  98. package/docs/02-guides/tester/qc-automation.md +0 -165
  99. package/docs/02-guides/tester/reading-specs.md +0 -79
  100. package/docs/02-guides/tester/scenarios.md +0 -186
  101. package/docs/02-guides/tester/spec-manifest.md +0 -130
  102. package/docs/02-guides/tester/test-checklist.md +0 -31
  103. package/docs/02-guides/tester/workflow.md +0 -77
  104. package/docs/03-concepts/README.md +0 -20
  105. package/docs/03-concepts/architecture.md +0 -248
  106. package/docs/03-concepts/mechanisms-explained.md +0 -124
  107. package/docs/03-concepts/pipeline.md +0 -278
  108. package/docs/03-concepts/traceability.md +0 -152
  109. package/docs/04-operations/README.md +0 -33
  110. package/docs/04-operations/bug-flow.md +0 -364
  111. package/docs/04-operations/publishing.md +0 -154
  112. package/docs/04-operations/sync-and-update.md +0 -522
  113. package/docs/05-reference/README.md +0 -34
  114. package/docs/05-reference/command-cheatsheet.md +0 -147
  115. package/docs/05-reference/commands.md +0 -234
  116. package/docs/05-reference/model-selection.md +0 -74
  117. package/docs/05-reference/modules.md +0 -110
  118. package/docs/05-reference/trace-schema.md +0 -154
  119. package/docs/06-commands/README.md +0 -75
  120. package/docs/06-commands/explain-debug.md +0 -32
  121. package/docs/06-commands/explain-define-product.md +0 -43
  122. package/docs/06-commands/explain-dev-gen-test.md +0 -28
  123. package/docs/06-commands/explain-dev-run-test.md +0 -24
  124. package/docs/06-commands/explain-dev-smoke-test.md +0 -25
  125. package/docs/06-commands/explain-fix-bug.md +0 -28
  126. package/docs/06-commands/explain-generate-bdd.md +0 -45
  127. package/docs/06-commands/explain-generate-code.md +0 -53
  128. package/docs/06-commands/explain-generate-design-spec.md +0 -54
  129. package/docs/06-commands/explain-generate-prd.md +0 -45
  130. package/docs/06-commands/explain-generate-spec-manifest.md +0 -20
  131. package/docs/06-commands/explain-generate-tech-docs.md +0 -56
  132. package/docs/06-commands/explain-learn.md +0 -21
  133. package/docs/06-commands/explain-map-testids.md +0 -28
  134. package/docs/06-commands/explain-propose-scenario.md +0 -24
  135. package/docs/06-commands/explain-qc-analyze.md +0 -22
  136. package/docs/06-commands/explain-qc-design-test.md +0 -20
  137. package/docs/06-commands/explain-qc-plan.md +0 -21
  138. package/docs/06-commands/explain-qc-report.md +0 -23
  139. package/docs/06-commands/explain-qc-review.md +0 -24
  140. package/docs/06-commands/explain-qc-run-test.md +0 -27
  141. package/docs/06-commands/explain-refine-prd.md +0 -51
  142. package/docs/06-commands/explain-report-bug.md +0 -24
  143. package/docs/06-commands/explain-review-code.md +0 -45
  144. package/docs/06-commands/explain-review-context.md +0 -68
  145. package/docs/06-commands/explain-review-tech-docs.md +0 -45
  146. package/docs/06-commands/explain-setup-ai-first.md +0 -25
  147. package/docs/06-commands/explain-sync.md +0 -24
  148. package/docs/06-commands/explain-update-framework.md +0 -22
  149. package/docs/06-commands/explain-validate-traces.md +0 -25
  150. package/docs/t-sample.md +0 -826
@@ -1,109 +0,0 @@
1
- [📚 Docs](../README.md) › [Guides](README.md) › Checklist Input Tech-Docs
2
-
3
- # Checklist Input Tech-Docs — Tech Lead Cần Làm Gì Để Gen Chuẩn
4
-
5
- > Áp cho `/generate-tech-docs`. Từ **một hoặc vài file BDD bạn (tech lead) trỏ vào**, lệnh sinh/bồi đắp **một** tech-doc full-stack cho cả PRD. Chuẩn bị đúng đầu vào để dev đọc là code được, và FE không phải chờ sửa lại.
6
-
7
- ## Mô hình (đọc trước để trỏ lệnh cho đúng)
8
-
9
- - **1 PRD = 1 file tech-doc** `{TICKET-ID}-tech-design.md` — gộp cả BE (API, data model, DB) lẫn client (§4.5 component/state/Figma) + §5 sequence xuyên tầng.
10
- - **Input = file BDD bạn chỉ định**, KHÔNG phải cả PRD. Lệnh chỉ nạp đúng file bạn trỏ (giữ context nhỏ), rồi **ghi/bồi đắp** vào doc chung của PRD.
11
- - **Append là đường chính:** chạy lệnh trên BDD này → lần sau trỏ BDD khác cùng PRD → doc **lớn dần lên**, không ghi đè phần cũ. §10 UC Coverage là "sổ điểm danh" để lệnh biết cái gì đã có.
12
-
13
- ```
14
- BDD (web/app/system) ──/generate-tech-docs {file(s) bạn trỏ}──▶ {TICKET}-tech-design.md
15
- run 1: system/UC1 → tạo doc, phần BE của UC1
16
- run 2: web/UC1 app/UC1 → append §4.5 client cho UC1
17
- run 3: system/UC2 … → append UC2
18
- ```
19
-
20
- ## Bạn trỏ lệnh thế nào (batching)
21
-
22
- `/generate-tech-docs` nhận **1 hoặc nhiều** file/UC trong một lần (space-separated) — coi là **một batch**, gộp vào doc trong lần chạy đó.
23
-
24
- | Cách trỏ | Khi nào dùng |
25
- |----------|--------------|
26
- | `/generate-tech-docs system/{UC}.feature` | Vẽ phần BE (API contract) của 1 UC trước |
27
- | `/generate-tech-docs {UC}` (system+web+app cùng UC) | Muốn cả full-stack của 1 UC trong 1 lần — trỏ đủ 3 file platform |
28
- | `/generate-tech-docs system/UC1 system/UC2` | Bồi thêm nhiều UC backend một lượt |
29
-
30
- - **Cảnh báo mềm nếu > 5 file/lần** (không chặn) — batch to = nạp nhiều context, chất lượng thiết kế giảm. Nên tách nhỏ: **per UC**, hoặc **per platform**.
31
- - **Kinh nghiệm:** greenfield nên đi **system trước** (chốt API contract) → rồi mới trỏ `web/`·`app/` để append §4.5 bám đúng endpoint. Không bắt buộc (BE+FE cùng file) nhưng ít rework hơn.
32
- - Trỏ lại UC **đã có** trong doc → lệnh hỏi xác nhận trước khi cập nhật (thêm platform còn thiếu / refresh khi BDD bump version).
33
-
34
- ---
35
-
36
- ## BDD khác tech-doc thế nào?
37
-
38
- Hai cái trả lời **hai câu hỏi khác nhau** về cùng một tính năng:
39
-
40
- | | **BDD (web/app/system)** | **Tech-doc (design)** |
41
- |---|---|---|
42
- | Trả lời | **CÁI GÌ** — hệ thống/màn phải làm gì (hành vi) | **LÀM SAO** — hiện thực kỹ thuật |
43
- | Chi tiết kỹ thuật? | **KHÔNG** | **CÓ** — nơi *duy nhất* chứa endpoint/shape/DB/component/state |
44
- | Ai làm | PO (spec repo) | Tech lead/Dev (`/generate-tech-docs`) |
45
- | Dùng để | kiểm chứng hành vi (QC trace về đây) | dev code theo; FE đọc để gọi API thật |
46
-
47
- ```
48
- PRD → BDD (CÁI GÌ) → /generate-tech-docs → tech-doc (LÀM SAO) → code
49
- ```
50
-
51
- > Một câu: **BDD nói "đúng thì ra cái gì", tech-doc nói "gọi/dựng thế nào để ra cái đó".**
52
-
53
- ---
54
-
55
- ## Chuẩn bị trước khi `/generate-tech-docs`
56
-
57
- **1. BDD được trỏ đã duyệt + sạch lỗi chưa?**
58
- Mỗi file trong batch nên `@trace.status: approved` và **0 finding critical** từ `/review-context`. Lệnh **HALT** nếu còn lỗi critical; chưa approved → cảnh báo mềm.
59
- → *Tech-doc dẫn xuất từ BDD; BDD lỗi thì design lỗi theo.*
60
-
61
- **2. BDD đã mô tả đủ hành vi chưa?**
62
- Mỗi scenario rõ: **kết quả trả về**, **side-effect** (lưu/đổi gì), **tín hiệu lỗi** (báo gì khi nào).
63
- → *Nguyên liệu để suy ra endpoint, mã lỗi, data model, và §5 sequence. Thiếu = design thiếu.*
64
-
65
- **3. Có client (web/app) trong batch → có design-spec chưa?**
66
- §4.5 (component, Figma mapping, test-id, state) lấy fidelity từ **design-spec**. Thiếu → cảnh báo mềm, §4.5 vẽ tạm từ BDD và đánh dấu `[DRAFT — no design-spec]`.
67
- → *Muốn §4.5 chuẩn: chạy `/generate-design-spec` trước.*
68
-
69
- **4. `core-entities.md` đã chuẩn chưa?**
70
- §3 Data Model cần bảng/trường/kiểu/enum đúng. Sai tên một trường = lệch cả request/response lẫn DB.
71
-
72
- **5. `CLAUDE.md` có kiến trúc + coding standard chưa?**
73
- §2 Architecture + service flow bám **layer/kiến trúc project**. Thiếu → design chung chung, code sau lệch.
74
-
75
- **6. Service trỏ đúng stack module chưa?** (java-spring / golang / dotnet / angular / …)
76
- → *Sai module = mẫu layer/component sai stack.*
77
-
78
- **7. Brownfield? → bảng "Existing API Contract" trong PRD phải đầy đủ.**
79
- `API Source: existing` → lệnh **chép lại** contract (reverse-document). Còn "⛔ thiếu" → tech-doc hổng.
80
-
81
- **8. Phụ thuộc liên service đã ghi chưa?** (§1c PRD)
82
- → *Bỏ sót = §6 thiếu chỗ nối, đội khác tích hợp hụt.*
83
-
84
- ---
85
-
86
- ## Checklist nhanh — trước khi gõ lệnh
87
-
88
- - [ ] Đã chọn **đúng file BDD** cần vẽ lần này (per UC / per platform); batch **≤ 5** file
89
- - [ ] Mỗi file trong batch `@trace.status: approved` + **0 finding critical** (không → HALT)
90
- - [ ] Mỗi scenario rõ: kết quả + side-effects + tín hiệu lỗi
91
- - [ ] Có `web/`·`app/` trong batch → **design-spec sẵn** (không → §4.5 degraded)
92
- - [ ] `core-entities.md` cập nhật (data model)
93
- - [ ] `CLAUDE.md` có kiến trúc layer + coding standards
94
- - [ ] Service trỏ đúng stack module
95
- - [ ] Brownfield → bảng Existing API Contract trong PRD **đầy đủ** (hết ⛔)
96
- - [ ] Phụ thuộc liên service (§1c PRD) ghi rõ nếu có
97
-
98
- ---
99
-
100
- ## Sau khi sinh tech-doc
101
-
102
- - Ra **một** file `{TICKET-ID}-tech-design.md` (hoặc doc cũ được bồi thêm), trạng thái `draft`.
103
- - `/review-tech-docs` chạy các check T1–T7. **T7 = cổng sign-off liên đội**: greenfield/partner cần FE/App/SA confirm contract trước khi `@trace.status: approved`; brownfield (`existing`) skip T7 vì contract đã chốt.
104
- - Nếu doc sống trong spec repo dùng chung → **commit + push** để cả team `/sync` đọc.
105
- - Approved rồi mới `/generate-code`.
106
-
107
- ---
108
-
109
- ← [Guides](README.md) · Liên quan: [Checklist Input BDD (System/BE)](bdd-input-checklist.md) · [Checklist Input PRD](prd-input-checklist.md) · [Giải thích /generate-tech-docs](../06-commands/explain-generate-tech-docs.md)
@@ -1,75 +0,0 @@
1
- [📚 Docs](../../README.md) › [Guides](../README.md) › Tester / QA
2
-
3
- # Hướng Dẫn Tester — SDD Framework
4
-
5
- Tài liệu dành cho **QA / Tester** — cách kết nối với spec framework, workflow kiểm thử, và các tình huống thực tế.
6
-
7
- ## Mục Lục
8
-
9
- | Trang | Nội dung |
10
- |---|---|
11
- | [Spec Manifest & Setup](spec-manifest.md) | Spec manifest là gì · setup tester agent · Living Docs panel |
12
- | [Workflow](workflow.md) | Luồng làm việc cơ bản từ nhận task đến pass/fail |
13
- | [Đọc Spec Chain](reading-specs.md) | Thứ tự đọc PRD → BDD → Tech Docs · ví dụ thực tế |
14
- | [Tình huống thực tế](scenarios.md) | 6 scenario: feature mới, PRD thay đổi, multi-service, regression, ... |
15
- | [Báo cáo bug](bug-reporting.md) | `/report-bug` · `/propose-scenario` · template báo cáo |
16
- | [Checklist test pass](test-checklist.md) | Checklist trước khi báo "test pass" |
17
- | [QC Automation](qc-automation.md) | Deep-dive pipeline `/qc-*` 6 bước · stack `qc-playwright` · `qc_status` → Living Docs |
18
-
19
- ## Vai Trò Tester Trong Framework
20
-
21
- ```
22
- PO/BA Dev Tester / QA
23
- ───────────────── ─────────────────── ──────────────────────────
24
- PRD (đọc BDD — KHÔNG gen) /sync + /generate-spec-manifest
25
- BDD web→app→system Tech Docs Đọc PRD + BDD + Tech Docs
26
- Design Spec Code Viết test cases · chạy /qc-*
27
- ▲ ▲ /report-bug · /propose-scenario
28
- │ │ (bug / edge case → spec repo)
29
- └─────────────────────┴──── feedback/ trong spec repo ◄────┘
30
- PO/Dev thấy qua /sync (📥) → fix / promote / update PRD
31
- ```
32
-
33
- **Tester chịu trách nhiệm:**
34
- - Đọc PRD để hiểu business requirement trước khi test
35
- - Đọc BDD để biết chính xác scenarios cần cover
36
- - Đọc Tech Docs để hiểu API contracts và data flow
37
- - Viết test cases dựa trên BDD scenarios
38
- - Khi bug xảy ra: `/report-bug` → tạo bug report có spec-context đầy đủ, phân loại layer
39
- - Khi phát hiện edge case chưa có trong BDD: `/propose-scenario` → đề xuất cho PO/Dev duyệt
40
-
41
- **Tester KHÔNG làm:**
42
- - Sửa PRD / BDD / Tech Docs trực tiếp — đó là việc của PO và Dev
43
- - Approve PRD — chỉ PO
44
- - Generate code — chỉ Dev
45
-
46
- > **Lưu ý về `/propose-scenario`:** lệnh này **không** sửa BDD. Nó chỉ ghi một bản *đề xuất* (draft Gherkin) vào vùng `feedback/bdd-proposals/` của spec repo dùng chung. PO/Dev review và đưa vào `.feature` chính thức.
47
-
48
- ## Commands Dành Cho Tester
49
-
50
- | Command | Mục đích | Khi nào dùng |
51
- |---|---|---|
52
- | `/generate-spec-manifest` | Tạo index TICKET-ID → PRD/BDD/tech-doc | Trước mỗi sprint, sau khi pull specs mới |
53
- | `/report-bug {UC-ID} {mô tả}` | Tạo bug report có spec-context + phân loại layer (read-only) | Khi test fail / phát hiện bug |
54
- | `/propose-scenario {UC-ID} {mô tả}` | Đề xuất scenario BDD mới cho edge case chưa cover | Khi tìm thấy case ngoài BDD hiện có |
55
-
56
- **QC Automation Pipeline (chính thức) — 6 lệnh `/qc-*`:**
57
-
58
- | Command | Mục đích | Khi nào dùng |
59
- |---|---|---|
60
- | `/qc-analyze` | Phân tích spec chain (PRD + BDD + Tech Docs), xác định scope test | Bước 1, sau khi BDD `@trace.status: approved` (cảnh báo mềm nếu chưa) |
61
- | `/qc-plan` | Lập test plan: liệt kê scenarios, layer, ưu tiên | Bước 2 |
62
- | `/qc-design-test` | Thiết kế test case chi tiết (Page Object, data, assertions) | Bước 3 |
63
- | `/qc-review` | Review test design trước khi code automation | Bước 4 |
64
- | `/qc-run-test` | Chạy automation test → ghi `qc_status` per scenario vào trace TSV | Bước 5 |
65
- | `/qc-report` | Tổng hợp kết quả thành QC report | Bước 6 |
66
-
67
- Đây là **bộ test chính thức (authoritative) của QC**, chạy ngay trong framework. Pipeline dùng stack module `qc-playwright` (Python + pytest-playwright + Page Object). Xem chi tiết flow tại **chương [QC Automation](qc-automation.md)** (một phần của guide Tester / QA này).
68
-
69
- > **Artifact ra đâu:** `/qc-analyze` ghi **2 file** (`REQUIREMENT_ANALYSIS.md` + `DOC_GAPS.md`), `/qc-plan` → `TEST_PLAN.md`, `/qc-design-test` → `test-cases/*.Test.md` — tất cả trong `{qc_dir}/{UC-ID}/` (mặc định `docs/`, **visible**, không phải `.agent/` ẩn). Skill QC nạp từ `paths.qc_skills_dir` — trỏ được tới repo QC để skill **không bị `/update-framework` ghi đè**. Chi tiết: [QC Automation guide](qc-automation.md#skill-sourcing--upgrade-safety).
70
-
71
- > **Phân biệt với test commands của Dev:** `/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test` là **dev tự kiểm tra code của mình** — phát tín hiệu `dev_selftest`, KHÔNG phải bộ test chính thức. Bộ test authoritative của QC là pipeline `/qc-*` (sinh ra `qc_status`). Hai luồng tách biệt.
72
-
73
- ---
74
-
75
- *Xem thêm:* [Developer Guide](../developer/README.md) · [Chương QC Automation](qc-automation.md) · [Operations › Bug Flow](../../04-operations/bug-flow.md) · [Reference › Commands](../../05-reference/commands.md)
@@ -1,117 +0,0 @@
1
- [📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Báo cáo bug
2
-
3
- # Khi Tìm Thấy Bug — Quy Trình Trace
4
-
5
- Khi test fail, báo cáo phải có đủ **spec context** để Dev fix đúng chỗ.
6
-
7
- ## Cách nhanh nhất: `/report-bug`
8
-
9
- ```bash
10
- /report-bug FT-001 tài khoản khoá sau 6 lần sai, spec ghi 5
11
- ```
12
-
13
- Lệnh tự động:
14
- - Resolve spec-context từ `spec-manifest.yaml`: PRD path + version, BDD scenario fail, tech-doc
15
- - Tìm **AC bị vi phạm** trong PRD
16
- - **Phân loại layer** theo BUG_FLOW (Code / BDD / PRD / Design Spec / Env) → route đúng người
17
- - Phát hiện **coverage gap** → gợi ý `/propose-scenario`
18
- - Ghi report vào **spec repo** (`{spec_source}/feedback/bug-reports/{BUG-ID}.md`) → **commit + push**
19
-
20
- Hoàn toàn **read-only** trên spec/code chính thức — chỉ ghi vào vùng `feedback/`.
21
-
22
- > **Làm sao PO/Dev biết?** Report được commit+push vào **spec repo dùng chung**. PO/Dev chạy `/sync` hàng ngày sẽ thấy dòng `📥 New tester feedback`. File nằm local một mình thì không ai biết — chính bước push + `/sync` mới khép vòng. (Không có quyền push → tạo PR/MR.)
23
-
24
- ## Khi bug là "thiếu scenario" — `/propose-scenario`
25
-
26
- Nếu `/report-bug` báo *coverage gap* (behavior đúng nhưng chưa có scenario nào kiểm):
27
-
28
- ```bash
29
- /propose-scenario FT-001 login với email có khoảng trắng ở cuối vẫn phải thành công
30
- ```
31
-
32
- - Nếu behavior **đã nằm trong một AC của PRD** → lệnh draft Gherkin (tag `@proposed @from-test`, mang `Status: proposed`), ghi vào `{spec_source}/feedback/bdd-proposals/` → commit + push. PO/Dev review → đặt `Status: accepted` → `/generate-bdd` tự chèn vào `.feature` rồi lưu trữ (`incorporated`).
33
- - Nếu behavior **chưa có trong PRD** → lệnh **ghi** một *PRD change request* (`State: Open`) vào `{spec_source}/feedback/prd-change-requests/{UC-ID}-{slug}.md` → commit + push (KHÔNG chỉ in ra). PO thấy nó khi `/sync`, thêm/sửa AC rồi `/generate-bdd` lại.
34
-
35
- > Tester không tự ghi vào BDD — chỉ đề xuất. Giữ đúng ownership.
36
-
37
- ## Template báo cáo bug
38
-
39
- *(Tham khảo — `/report-bug` tự sinh theo format này. Dùng khi báo cáo thủ công.)*
40
-
41
- ```
42
- Bug ID : BUG-{date}-{seq}
43
- Feature : FT-{xxx} — {feature name}
44
- Service : BE / Web / App
45
- Severity : Critical / Major / Minor
46
-
47
- Spec context:
48
- PRD : specs/{domain}/{prd-slug}/{TICKET-ID}-{prd-slug}.md (v{x.x})
49
- BDD : {bdd path} → Scenario: "{scenario title}"
50
- Tech Doc : {tech_docs path}
51
-
52
- AC bị vi phạm:
53
- AC{N}: "{AC text từ PRD}"
54
-
55
- BDD Scenario bị fail:
56
- "{Scenario title}"
57
- Given: {given state}
58
- When : {action}
59
- Then : {expected theo spec}
60
-
61
- Actual behavior:
62
- {what actually happened}
63
-
64
- Steps to reproduce:
65
- 1. {step}
66
- 2. {step}
67
-
68
- Environment: staging / production
69
- ```
70
-
71
- ## Ví dụ báo cáo thực tế
72
-
73
- ```
74
- Bug ID : BUG-20260605-003
75
- Feature : FT-001 — User Login
76
- Service : BE
77
- Severity : Major
78
-
79
- Spec context:
80
- PRD : specs/auth/FT-001-login/FT-001-login.md (v1.0)
81
- BDD : free-trial-specs/specs/auth/FT-001-login/bdd/system/FT-001-login.feature
82
- → Scenario: "Lock account after 5 failed attempts"
83
- Tech Doc : free-trial-specs/specs/auth/FT-001-login/tech-docs/FT-001-auth-api.md
84
-
85
- AC bị vi phạm:
86
- AC3: "Sai password 5 lần liên tiếp → khoá tài khoản 30 phút"
87
-
88
- BDD Scenario bị fail:
89
- "Lock account after 5 failed attempts"
90
- Given : user "alice@example.com" has 0 failed attempts
91
- When : login with wrong password 5 times
92
- Then : 5th attempt returns 423 Locked
93
- AND retry_after = 1800
94
-
95
- Actual behavior:
96
- 5th attempt returns 401 Unauthorized (không phải 423)
97
- Không có retry_after header
98
- → Tài khoản không bị khoá, vẫn cho thử tiếp
99
-
100
- Steps to reproduce:
101
- POST /api/v1/auth/login × 5 với password sai
102
- → lần thứ 5 vẫn nhận 401
103
-
104
- Environment: staging (deploy 2026-06-05 09:00)
105
- ```
106
-
107
- ## Sau khi gửi bug report
108
-
109
- Dev sẽ xác định bug thuộc layer nào (code / BDD / PRD / env) và phản hồi với root cause + scenario cần re-test.
110
-
111
- > Xem flow phối hợp đầy đủ giữa Tester ↔ Dev ↔ PO trong **[Operations › Bug Flow](../../04-operations/bug-flow.md)**.
112
-
113
- > **Nếu AI lặp lại cùng kiểu lỗi qua nhiều feature:** ghi chú trong bug report. Dev chạy `/learn` để biến nó thành guardrail — AI sẽ không sinh lại lỗi đó ở các UC sau.
114
-
115
- ---
116
-
117
- ← [Tình huống thực tế](scenarios.md) · Tiếp theo: [Checklist test pass](test-checklist.md)
@@ -1,165 +0,0 @@
1
- [📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › QC Automation
2
-
3
- # Hướng Dẫn QC Automation — SDD Framework
4
-
5
- > Đây là **một chương của [guide Tester / QA](README.md)** — QC và Tester là **cùng một role**. Chương này đi sâu vào pipeline QC tự động (`/qc-*`); phần vai trò chung, spec-manifest, `/report-bug`, `/propose-scenario`… ở [README của guide](README.md).
6
-
7
- Pipeline QC automation **chính thức** của framework — được port từ agent của team QC (reference repo `ai-automation-qc-base`) vào ngay trong framework. Nó sinh và chạy automation **Playwright/pytest** từ BDD `.feature` chính thức, rồi ghi tín hiệu **`qc_status`** (authoritative) vào trace TSV → Living Docs.
8
-
9
- ## Mục Lục
10
-
11
- - [Hai luồng test: dev self-check vs QC chính thức](#hai-luồng-test-dev-self-check-vs-qc-chính-thức)
12
- - [Pipeline 6 bước](#pipeline-6-bước)
13
- - [Stack — module qc-playwright](#stack--module-qc-playwright)
14
- - [Trace join: qc_status đến Living Docs như thế nào](#trace-join-qc_status-đến-living-docs-như-thế-nào)
15
- - [Entry point](#entry-point)
16
- - [Skills theo layer](#skills-theo-layer)
17
-
18
- ## Hai Luồng Test: Dev Self-Check vs QC Chính Thức
19
-
20
- Pipeline QC này **khác** với developer **self-check** (`/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test`):
21
-
22
- | Signal | Owner | Command | Ý nghĩa |
23
- |--------|-------|---------|---------|
24
- | `dev_selftest` | Dev | `/dev-run-test` | smoke check của riêng dev (KHÔNG authoritative) |
25
- | `qc_status` | QC | `/qc-run-test` | kết quả QC automation **chính thức** |
26
-
27
- Cả hai hiển thị **cạnh nhau** trong Living Docs; không cái nào ghi đè cái nào. `dev_selftest: pass` chỉ nghĩa "dev đã tự smoke qua"; coverage chính thức nằm ở `qc_status`.
28
-
29
- ## Pipeline 6 Bước
30
-
31
- ```
32
- /qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report
33
- (requirement (risk/plan (test-case (review (gen+run (report +
34
- breakdown) + Q-for-dev) .Test.md) gate) Python → evidence)
35
- qc_status)
36
- ```
37
-
38
- | Command | Vai trò | Output |
39
- |---------|---------|--------|
40
- | `/qc-analyze` | bóc tách spec chính thức thành **1 file phân tích gộp** (requirement + BR/AC + data-flow) + `DOC_GAPS` | `{qc_dir}/{UC-ID}/` → `REQUIREMENT_ANALYSIS.md` + `DOC_GAPS.md` (**2 file**) |
41
- | `/qc-plan` | risk / what-if / questions-for-dev + test plan | `TEST_PLAN.md` |
42
- | `/qc-design-test` | thiết kế test case (Markdown `.Test.md`), tag `@trace.verifies={UC-ID}-SC{N}` | `test-cases/` |
43
- | `/qc-review` | cổng review hai chiều: review test case (sau design) và script (sau run) | findings |
44
- | `/qc-run-test` | sinh + chạy Python pytest-playwright; **ghi `qc_status`** per scenario | `{trace_dir}/{UC-ID}-{platform}.tsv` |
45
- | `/qc-report` | report pytest-html + Playwright trace + evidence | `reports/<feature>/report.html` |
46
-
47
- > **Nơi lưu artifact (`qc_dir`):** mọi output của pipeline (trừ report) nằm trong thư mục QC
48
- > **lộ ra ngoài** `{qc_dir}/{UC-ID}/` — mặc định `docs/{UC-ID}/`, cấu hình qua `paths.qc_dir`
49
- > trong `project-context.yaml`. Đây là **working-doc riêng của QC** trong repo QC, **không ẩn**
50
- > (KHÔNG nằm trong `.agent/`). Spec gốc (PRD/`.feature`/design-spec) KHÔNG nằm đây — chúng đến
51
- > từ **submodule spec của PO** (`spec_source`). `/qc-analyze` chỉ ghi **đúng 2 file**:
52
- > `REQUIREMENT_ANALYSIS.md` (phân tích gộp) + `DOC_GAPS.md`.
53
-
54
- ## Stack — Module qc-playwright
55
-
56
- `/qc-run-test` và `/qc-report` dùng stack module `qc-playwright`
57
- (`.agent/modules/qc-playwright/stack-profile.yaml`): **Python + pytest-playwright + Page
58
- Object** (slim `BasePage`, 3-layer), **Playwright Trace + pytest-html** (KHÔNG Allure). Stack
59
- này độc lập với module implementation của dev (java-spring, react, flutter, …).
60
-
61
- Per-layer guides chi tiết nằm trong `skills/qc/<stage>/` (port từ skills của agent QC):
62
- functional / integration / e2e / non-functional / exploratory.
63
-
64
- ### Test-ID contract — locate element không cần scan
65
-
66
- Để QC **không** phải dò/giả lập vị trí element lúc runtime (chậm), FE tech-design có section **§4.5.6 Test Selectors**: mỗi element **có action** được gán test-id ổn định (`{uc}-{screen}-{element}-{type}`, vd `ft001-login-submit-btn`). `/generate-code` emit đúng id đó theo attribute platform (web `data-testid` · RN `testID` · Flutter `Key`/`Semantics` · iOS `accessibilityIdentifier`); `/qc-design-test` cite test-id trong step; `/qc-run-test` build Page Object locator **thẳng từ map** (ưu tiên trong locator priority `data-testid → role → …`). Element có action mà chưa có test-id trong §4.5.6 → QC **fallback** role/text (chậm hơn) và nên bổ sung vào tech-design. Xem [Trace Schema](../../05-reference/trace-schema.md) và FE tech-design (`/generate-tech-docs`).
67
-
68
- > **Component reuse / code có sẵn:** `/generate-tech-docs` + `/generate-code` chỉ gán id cho code **mới**. Với component dùng chung (id ở usage site, component phải *forward* test-id) hoặc màn hình **brownfield** đã viết tay → chạy **`/map-testids {UC-ID}`**: reverse-document id đang có, gán id còn thiếu, patch forwarding + ghi vào `figma-components/{module}.md` (section *Test-ID Forwarding*), điền §4.5.6. Nhờ vậy QC vẫn locate-by-id không cần scan.
69
-
70
- ## Trace Join: qc_status Đến Living Docs Như Thế Nào
71
-
72
- 1. `.feature` chính thức định nghĩa scenario là `@trace.scenario={UC-ID}-SC{N}`.
73
- 2. `/qc-design-test` ghi SC mà test case thuộc về; `/qc-run-test` tag mỗi pytest test
74
- `# @trace.verifies={UC-ID}-SC{N}`.
75
- 3. `/qc-run-test` ghi `qc_status` (`pass|fail|skip|not_run`) + `qc_run_at` vào trace TSV của
76
- service (authoritative), rồi refresh panel mirror local.
77
- 4. `/validate-traces` (hoặc `/sync`) tổng hợp các TSV thành report Living Docs tại
78
- `{spec_source}/.living-docs/` — dashboard hiển thị `qc_status` cạnh `dev_selftest`.
79
-
80
- ## Entry Point
81
-
82
- Pipeline QC bắt đầu khi BDD của một UC đã duyệt — `# @trace.status: approved` (sau `/review-context (BDD)` sạch critical + người duyệt đặt). `/qc-analyze` đọc field này và **cảnh báo mềm** nếu chưa approved:
83
-
84
- ```
85
- /qc-analyze {UC-ID} → … → /qc-report {UC-ID} → /validate-traces {UC-ID}
86
- ```
87
-
88
- ## Skills Theo Layer
89
-
90
- Các skill chi tiết theo từng giai đoạn QC nằm trong `skills/qc/`:
91
-
92
- | Stage skill | Vai trò |
93
- |---|---|
94
- | `qa-analyst` | phân tích requirement, sinh `DOC_GAPS` |
95
- | `qa-planner` | test plan, risk, questions-for-dev |
96
- | `qa-designer` | thiết kế test case `.Test.md` theo layer (functional / integration / e2e / non-functional / exploratory) |
97
- | `qa-reviewer` | cổng review test case và script |
98
- | `qa-runner` | sinh + chạy Python pytest-playwright, sinh report (Playwright Trace + pytest-html) |
99
-
100
- Mỗi skill **tự chứa** (self-contained) và có version frontmatter để theo dõi khi nâng cấp.
101
-
102
- ## Khi QC Tìm Thấy Bug / Spec Gap — Đẩy Lên Specs
103
-
104
- QC chạy pipeline nhưng **không tự sửa spec/code**. Khi phát hiện vấn đề, đẩy lên spec repo của PO
105
- qua flow feedback có sẵn (`/report-bug` · `/propose-scenario` — PO/Dev nhận khi `/sync`):
106
-
107
- | QC phát hiện ở | Loại | Hành động |
108
- |---|---|---|
109
- | `/qc-run-test` FAIL = **product-gap** (impl ≠ spec, lỗi thật) | bug | `/report-bug {UC-ID} {expected vs actual}` |
110
- | `/qc-run-test` FAIL = **script-bug** (sai selector/logic script) | — | QC tự sửa script + chạy lại (**KHÔNG** file bug) |
111
- | `/qc-analyze` `DOC_GAPS` blocker = **spec sai / mơ hồ / mâu thuẫn** (PRD·BDD) | spec defect | `/report-bug {UC-ID}` (BUG_FLOW phân loại PRD/BDD) |
112
- | `/qc-analyze` `DOC_GAPS` = **thiếu coverage** (behavior trong AC nhưng chưa có scenario) | coverage gap | `/propose-scenario {UC-ID}` |
113
- | `DOC_GAPS` = `ASSUMPTION` / `OPEN QUESTION` | câu hỏi | qc-plan → questions-for-dev (xác nhận với PO/Dev, không file bug) |
114
-
115
- `/report-bug` ghi `feedback/bug-reports/BUG-xxx.md` + commit/push lên spec repo; `/propose-scenario`
116
- ghi `feedback/bdd-proposals/`. PO/Dev thấy khi `/sync`, rồi BUG_FLOW định tuyến root cause:
117
-
118
- ```
119
- • Code bug → Dev /fix-bug (KHÔNG đổi spec)
120
- • BDD sai / thiếu → sửa .feature / promote proposal → /generate-bdd
121
- • PRD mơ hồ / sai → PO sửa PRD → /refine-prd → /review-context → /generate-bdd
122
- ↓ (nếu spec đổi → regenerate)
123
- /generate-code lại → QC /qc-run-test lại → qc_status: fail → pass
124
- ```
125
-
126
- > QC chỉ **đọc** spec (từ submodule PO) — mọi thay đổi PRD/BDD là việc của PO/Dev. QC đẩy *tín hiệu*
127
- > (bug / proposal / gap), không tự sửa canonical spec. `/qc-report` ở cuối pipeline **in sẵn** danh
128
- > sách lệnh `/report-bug` cho từng product-gap để QC chạy. Chi tiết flow bug: [Operations · Bug Flow](../../04-operations/bug-flow.md).
129
-
130
- ## Skill Sourcing & Upgrade-Safety
131
-
132
- Các skill QC (`qa-analyst` / `qa-designer` / `qa-planner` / `qa-reviewer` / `qa-runner` +
133
- `DOC_GAPS.template.md`) **không bị hardcode** — command nạp chúng từ `paths.qc_skills_dir`:
134
-
135
- | Tình huống | `qc_skills_dir` | Hệ quả khi `/update-framework` |
136
- |---|---|---|
137
- | Mặc định (standalone) | `.agent/skills/qc` (bản framework bundle) | **Bị ghi đè** mỗi lần upgrade → đừng sửa trực tiếp ở đây |
138
- | QC sở hữu skill (khuyến nghị) | repo QC / submodule, vd `qc-base/.claude/skills` | **Không bao giờ bị đụng** — upgrade chỉ rewrite `.agent/` |
139
-
140
- > `qc_skills_dir` chỉ cần trỏ tới thư mục **chứa các folder `qa-*`**. Cả 2 layout đều hợp lệ:
141
- > framework bundle (`.agent/skills/qc/qa-analyst/…`) và repo QC (`.claude/skills/qa-analyst/…`).
142
-
143
- **Cách QC tách skill ra khỏi vòng đời framework:**
144
-
145
- ```bash
146
- # 1. Đưa repo skill của QC vào project (submodule để pin version):
147
- git submodule add <ai-automation-qc-base-repo-url> qc-base
148
-
149
- # 2. Trỏ qc_skills_dir trong .agent/project-context.yaml:
150
- # paths:
151
- # qc_skills_dir: "qc-base/.claude/skills"
152
-
153
- # 3. Từ giờ: QC hoàn thiện skill trong repo qc-base, bump submodule khi cần.
154
- # /update-framework ghi đè .agent/ nhưng KHÔNG chạm qc-base/ → skill an toàn.
155
- ```
156
-
157
- Nhờ vậy **vòng đời skill QC** và **vòng đời framework** tách hẳn nhau: nâng cấp framework
158
- không nuốt mất skill đang hoàn thiện, và QC update skill 1 chỗ (repo của họ) cho mọi project.
159
-
160
- ## Xem Thêm
161
-
162
- - [Guide › Tester](README.md) — vai trò tester, spec-manifest, `/report-bug`, `/propose-scenario`
163
- - [Concepts › Traceability](../../03-concepts/traceability.md) — trace TSV, dev_selftest vs qc_status
164
- - [Reference › Modules](../../05-reference/modules.md) — chi tiết module `qc-playwright`
165
- - [Reference › Commands](../../05-reference/commands.md) — danh mục đầy đủ mọi command
@@ -1,79 +0,0 @@
1
- [📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Đọc Spec Chain
2
-
3
- # Đọc Và Hiểu Spec Chain
4
-
5
- ## Thứ tự đọc và mục đích
6
-
7
- | Tài liệu | Đọc để | Ví dụ thực tế |
8
- |---|---|---|
9
- | **PRD** | Hiểu WHAT — business requirement | "Sai password 5 lần → khoá 30 phút" |
10
- | **BDD** | Biết HOW VERIFIED — exact scenarios | `Given 5 failed logins, Then 423 Locked` |
11
- | **Tech Docs BE** | Biết API contract khi test BE | `POST /api/v1/auth/login`, error codes |
12
- | **Tech Docs Web** | Biết UI states khi test Web | Screen names, component behaviors |
13
-
14
- ## Ví dụ đọc spec chain — FT-001 Login
15
-
16
- Sau khi chạy `/generate-spec-manifest`, tra manifest để lấy paths:
17
-
18
- ```yaml
19
- # spec-manifest.yaml
20
- FT-001:
21
- prd: "my-project-specs/specs/auth/FT-001-login/FT-001-login.md"
22
- bdd:
23
- be: "my-project-specs/specs/auth/FT-001-login/bdd/system/FT-001-UC1-login-system.feature"
24
- web: "my-project-specs/specs/auth/FT-001-login/bdd/web/FT-001-UC1-login-web.feature"
25
- tech_docs:
26
- be: "my-project-specs/specs/auth/FT-001-login/tech-docs/FT-001-auth-api.md"
27
- ```
28
-
29
- **Bước 1: Đọc PRD** tại `my-project-specs/specs/auth/FT-001-login/FT-001-login.md`
30
- *(nằm trong spec submodule — shared repo của PO)*
31
-
32
- ```markdown
33
- # AC trong PRD FT-001:
34
- AC1: Đăng nhập thành công → truy cập được hệ thống
35
- AC2: Sai password → hiển thị lỗi, không tiết lộ thông tin user
36
- AC3: Sai password 5 lần liên tiếp → khoá tài khoản 30 phút
37
- AC4: Tài khoản bị khoá → thông báo thời gian mở khoá
38
- ```
39
-
40
- **Bước 2: Đọc BDD System (cho BE)** tại `my-project-specs/specs/auth/FT-001-login/bdd/system/FT-001-UC1-login-system.feature`
41
- *(nằm trong spec submodule — PO gen, chứa contract BE phải đáp ứng; tất cả BDD web/app/system đều ở spec repo)*
42
-
43
- ```gherkin
44
- Scenario: Successful login
45
- Given user "alice@example.com" exists
46
- When POST /api/v1/auth/login {"email": "alice@...", "password": "correct"}
47
- Then status 200, body has access_token and refresh_token
48
-
49
- Scenario: Lock after 5 failures
50
- Given user has 0 failed attempts
51
- When login with wrong password 5 times
52
- Then 5th attempt returns 423
53
- And response has retry_after: 1800
54
- ```
55
-
56
- **Bước 3: Đọc Tech Docs BE** tại `my-project-specs/specs/auth/FT-001-login/tech-docs/FT-001-auth-api.md`
57
- *(nằm trong spec submodule — Dev gen, SA sign-off, đây là API contract chính thức)*
58
-
59
- ```markdown
60
- # Auth API — Error Codes
61
- 401 — sai password (failed_attempts < 5)
62
- 423 — tài khoản bị khoá (retry_after tính bằng giây)
63
- 404 — email không tồn tại (không phân biệt với 401 — security)
64
-
65
- # Headers bắt buộc
66
- Authorization: Bearer {token}
67
- X-Request-ID: uuid (optional, dùng để trace)
68
- ```
69
-
70
- **Kết quả: tester biết cần test:**
71
- - `POST /auth/login` với đúng credentials → 200 + token
72
- - `POST /auth/login` với sai password → 401 (message không reveal user exists/not)
73
- - 5 lần sai → 423 + `retry_after: 1800`
74
- - Email không tồn tại → 404 (message = 401 message — security by design)
75
- - Sau 30 phút → có thể login lại
76
-
77
- ---
78
-
79
- ← [Workflow](workflow.md) · Tiếp theo: [Tình huống thực tế](scenarios.md)