@anhth2/spec-driven-dev-plugin 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/commands/debug.md +38 -8
  2. package/commands/define-product.md +38 -8
  3. package/commands/dev-gen-test.md +39 -9
  4. package/commands/dev-gen-test.tmpl +1 -1
  5. package/commands/dev-run-test.md +43 -10
  6. package/commands/dev-run-test.tmpl +5 -2
  7. package/commands/dev-smoke-test.md +38 -8
  8. package/commands/fix-bug.md +38 -8
  9. package/commands/generate-bdd.md +42 -10
  10. package/commands/generate-bdd.tmpl +4 -2
  11. package/commands/generate-code.md +39 -9
  12. package/commands/generate-code.tmpl +1 -1
  13. package/commands/generate-design-spec.md +38 -8
  14. package/commands/generate-prd.md +38 -8
  15. package/commands/generate-spec-manifest.md +38 -8
  16. package/commands/generate-tech-docs.md +38 -8
  17. package/commands/learn.md +38 -8
  18. package/commands/propose-scenario.md +38 -8
  19. package/commands/qc-analyze.md +514 -0
  20. package/commands/qc-analyze.tmpl +71 -0
  21. package/commands/qc-design-test.md +510 -0
  22. package/commands/qc-design-test.tmpl +67 -0
  23. package/commands/qc-plan.md +492 -0
  24. package/commands/qc-plan.tmpl +49 -0
  25. package/commands/qc-report.md +491 -0
  26. package/commands/qc-report.tmpl +48 -0
  27. package/commands/qc-review.md +496 -0
  28. package/commands/qc-review.tmpl +53 -0
  29. package/commands/qc-run-test.md +538 -0
  30. package/commands/qc-run-test.tmpl +77 -0
  31. package/commands/refine-prd.md +38 -8
  32. package/commands/report-bug.md +38 -8
  33. package/commands/review-code.md +38 -8
  34. package/commands/review-context.md +38 -8
  35. package/commands/review-tech-docs.md +38 -8
  36. package/commands/setup-ai-first.md +7 -0
  37. package/commands/sync.md +7 -0
  38. package/commands/update-framework.md +7 -0
  39. package/commands/validate-traces.md +54 -12
  40. package/commands/validate-traces.tmpl +16 -4
  41. package/core/FRAMEWORK_VERSION +1 -1
  42. package/core/commands/debug.md +38 -8
  43. package/core/commands/define-product.md +38 -8
  44. package/core/commands/dev-gen-test.md +39 -9
  45. package/core/commands/dev-run-test.md +43 -10
  46. package/core/commands/dev-smoke-test.md +38 -8
  47. package/core/commands/fix-bug.md +38 -8
  48. package/core/commands/generate-bdd.md +42 -10
  49. package/core/commands/generate-code.md +39 -9
  50. package/core/commands/generate-design-spec.md +38 -8
  51. package/core/commands/generate-prd.md +38 -8
  52. package/core/commands/generate-spec-manifest.md +38 -8
  53. package/core/commands/generate-tech-docs.md +38 -8
  54. package/core/commands/learn.md +38 -8
  55. package/core/commands/propose-scenario.md +38 -8
  56. package/core/commands/qc-analyze.md +514 -0
  57. package/core/commands/qc-design-test.md +510 -0
  58. package/core/commands/qc-plan.md +492 -0
  59. package/core/commands/qc-report.md +491 -0
  60. package/core/commands/qc-review.md +496 -0
  61. package/core/commands/qc-run-test.md +538 -0
  62. package/core/commands/refine-prd.md +38 -8
  63. package/core/commands/report-bug.md +38 -8
  64. package/core/commands/review-code.md +38 -8
  65. package/core/commands/review-context.md +38 -8
  66. package/core/commands/review-tech-docs.md +38 -8
  67. package/core/commands/setup-ai-first.md +7 -0
  68. package/core/commands/sync.md +7 -0
  69. package/core/commands/update-framework.md +7 -0
  70. package/core/commands/validate-traces.md +54 -12
  71. package/core/modules/qc-playwright/stack-profile.yaml +65 -0
  72. package/core/skills/code/SKILL.md +45 -8
  73. package/core/skills/debug/SKILL.md +52 -8
  74. package/core/skills/design-spec/SKILL.md +38 -8
  75. package/core/skills/discovery/SKILL.md +38 -8
  76. package/core/skills/prd/SKILL.md +14 -0
  77. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  78. package/core/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  79. package/core/skills/qc/qa-analyst/business-rules.md +55 -0
  80. package/core/skills/qc/qa-analyst/data-flow.md +60 -0
  81. package/core/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  82. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  83. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  84. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  85. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  86. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  87. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  88. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  89. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  90. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  91. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  92. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  93. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  94. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  95. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  96. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  97. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  98. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  99. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  100. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  101. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  102. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  103. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  104. package/core/skills/qc/qa-runner/e2e.md +49 -0
  105. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  106. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  107. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  108. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  109. package/core/skills/qc/qa-runner/integration.md +47 -0
  110. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  111. package/core/skills/qc/qa-runner/report/report.md +37 -0
  112. package/core/skills/setup-ai-first/SKILL.md +7 -0
  113. package/core/skills/spec/SKILL.md +14 -0
  114. package/core/skills/test/SKILL.md +83 -16
  115. package/core/steps/context-loader.md +31 -8
  116. package/core/steps/report-footer.md +7 -0
  117. package/core/templates/project-context.yaml +8 -0
  118. package/docs/01-getting-started/README.md +19 -0
  119. package/docs/01-getting-started/core-concepts.md +102 -0
  120. package/docs/01-getting-started/installation.md +154 -0
  121. package/docs/01-getting-started/quickstart.md +85 -0
  122. package/docs/02-guides/README.md +27 -0
  123. package/docs/02-guides/developer/README.md +46 -0
  124. package/docs/02-guides/developer/bdd-and-trace.md +123 -0
  125. package/docs/02-guides/developer/commands.md +76 -0
  126. package/docs/02-guides/developer/pr-checklist.md +15 -0
  127. package/docs/02-guides/developer/scenarios.md +448 -0
  128. package/docs/02-guides/developer/workflow.md +59 -0
  129. package/docs/02-guides/product-owner/README.md +77 -0
  130. package/docs/02-guides/product-owner/commands.md +30 -0
  131. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  132. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  133. package/docs/02-guides/product-owner/scenarios.md +357 -0
  134. package/docs/02-guides/qc-automation.md +92 -0
  135. package/docs/02-guides/tester/README.md +72 -0
  136. package/docs/02-guides/tester/bug-reporting.md +117 -0
  137. package/docs/02-guides/tester/reading-specs.md +79 -0
  138. package/docs/02-guides/tester/scenarios.md +186 -0
  139. package/docs/02-guides/tester/spec-manifest.md +124 -0
  140. package/docs/02-guides/tester/test-checklist.md +31 -0
  141. package/docs/02-guides/tester/workflow.md +79 -0
  142. package/docs/03-concepts/README.md +19 -0
  143. package/docs/03-concepts/architecture.md +243 -0
  144. package/docs/03-concepts/pipeline.md +249 -0
  145. package/docs/03-concepts/traceability.md +148 -0
  146. package/docs/04-operations/README.md +33 -0
  147. package/docs/04-operations/bug-flow.md +321 -0
  148. package/docs/04-operations/publishing.md +137 -0
  149. package/docs/04-operations/sync-and-update.md +328 -0
  150. package/docs/05-reference/README.md +29 -0
  151. package/docs/05-reference/commands.md +229 -0
  152. package/docs/05-reference/modules.md +110 -0
  153. package/docs/05-reference/trace-schema.md +146 -0
  154. package/docs/README.md +51 -0
  155. package/modules/qc-playwright/stack-profile.yaml +65 -0
  156. package/package.json +2 -2
  157. package/skills/code/SKILL.md +45 -8
  158. package/skills/debug/SKILL.md +52 -8
  159. package/skills/design-spec/SKILL.md +38 -8
  160. package/skills/discovery/SKILL.md +38 -8
  161. package/skills/prd/SKILL.md +14 -0
  162. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  163. package/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  164. package/skills/qc/qa-analyst/business-rules.md +55 -0
  165. package/skills/qc/qa-analyst/data-flow.md +60 -0
  166. package/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  167. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  168. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  169. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  170. package/skills/qc/qa-designer/functional/api.md +45 -0
  171. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  172. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  173. package/skills/qc/qa-designer/integration/api.md +42 -0
  174. package/skills/qc/qa-designer/integration/db.md +39 -0
  175. package/skills/qc/qa-designer/integration/gui.md +40 -0
  176. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  177. package/skills/qc/qa-designer/non-functional.md +40 -0
  178. package/skills/qc/qa-planner/test-plan.md +120 -0
  179. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  180. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  181. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  182. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  183. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  184. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  185. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  186. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  187. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  188. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  189. package/skills/qc/qa-runner/e2e.md +49 -0
  190. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  191. package/skills/qc/qa-runner/functional/api.md +35 -0
  192. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  193. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  194. package/skills/qc/qa-runner/integration.md +47 -0
  195. package/skills/qc/qa-runner/non-functional.md +49 -0
  196. package/skills/qc/qa-runner/report/report.md +37 -0
  197. package/skills/setup-ai-first/SKILL.md +7 -0
  198. package/skills/spec/SKILL.md +14 -0
  199. package/skills/test/SKILL.md +83 -16
  200. package/steps/context-loader.md +31 -8
  201. package/steps/report-footer.md +7 -0
  202. package/templates/project-context.yaml +8 -0
  203. package/ARCHITECTURE.md +0 -258
@@ -0,0 +1,45 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › [Product Owner](README.md) › Quy tắc viết PRD
2
+
3
+ # Quy Tắc Viết PRD Hiệu Quả
4
+
5
+ ## PRD là platform-agnostic
6
+
7
+ | ✅ Viết trong PRD | ❌ Không viết trong PRD |
8
+ |---|---|
9
+ | "Đăng nhập thành công → truy cập tính năng" | "Click button Login → hiển thị spinner" |
10
+ | "Sai password 5 lần → khoá 30 phút" | "API POST /auth/login trả về JWT" |
11
+ | "Session hết hạn → yêu cầu xác thực lại" | "Toast message màu đỏ ở góc phải" |
12
+ | "User có thể reset password qua email" | "Gọi sendgrid API để gửi email" |
13
+
14
+ UI details và API specs thuộc về:
15
+ - **Design Spec** → UI/UX cho FE/App
16
+ - **Tech Docs** → API contract, technical design (dev team tự generate). BE tech-design (API contract) nằm trong shared spec module khi `spec_source` được set.
17
+
18
+ ## UC và AC phải testable
19
+
20
+ Mỗi AC phải trả lời được câu hỏi: **"Làm sao biết tính năng này hoạt động đúng?"**
21
+
22
+ ❌ Không testable: `AC: "Hệ thống xử lý nhanh"` · `AC: "UI thân thiện với người dùng"`
23
+
24
+ ✅ Testable: `AC: "Trang login load trong vòng 3 giây"` · `AC: "Error message hiển thị trong vòng 1 giây sau khi submit"`
25
+
26
+ ## BR phải có ID liên tục
27
+
28
+ ```
29
+ UC1 → BR1, BR2, BR3
30
+ UC2 → BR4, BR5 ← tiếp tục từ BR3, không reset về BR1
31
+ UC3 → BR6
32
+ ```
33
+
34
+ ## Luôn có negative path
35
+
36
+ Với mỗi AC happy path, cần có ít nhất 1 AC cho error case:
37
+ ```
38
+ AC1 (happy): Đăng nhập thành công với email + password hợp lệ
39
+ AC2 (error): Đăng nhập thất bại khi password sai → hiển thị lỗi
40
+ AC3 (error): Tài khoản bị khoá → hiển thị thông báo + thời gian còn lại
41
+ ```
42
+
43
+ ---
44
+
45
+ ← [Tình huống thực tế](scenarios.md) · Tiếp theo: [Checklist handoff](handoff-checklist.md)
@@ -0,0 +1,357 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › [Product Owner](README.md) › Tình huống thực tế
2
+
3
+ # Tình Huống Thực Tế
4
+
5
+ ## Tình huống 1 — Bắt đầu tính năng mới từ đầu
6
+
7
+ **Bối cảnh:** PO nhận yêu cầu tính năng mới, cần viết tài liệu để dev team implement.
8
+
9
+ **Bước 1 — Capture ý tưởng:**
10
+ ```
11
+ /define-product
12
+ ```
13
+ Agent sẽ hỏi: Tên tính năng, domain · Mô tả ngắn · Vấn đề cần giải quyết · Actors liên quan · Kết quả mong muốn.
14
+
15
+ Output: `specs/product-definition/FEAT-01-login.md`
16
+
17
+ **Bước 2 — Generate PRD:**
18
+ ```
19
+ /generate-prd specs/product-definition/FEAT-01-login.md
20
+ ```
21
+ Agent tự động: đọc product definition · expand thành PRD đầy đủ với UC, AC, BR · nhắc nếu bạn viết UI details · kiểm tra terminology với business-dictionary.
22
+
23
+ Output: `specs/prd/auth/FEAT-01-login-prd.md`
24
+
25
+ **Bước 3 — Review nội dung:**
26
+ ```
27
+ /refine-prd specs/prd/auth/FEAT-01-login-prd.md
28
+ ```
29
+ Agent fan-out 4 lens (QA/DEV/SA/PO) chạy song song, rồi chạy completeness-critic loop cho đến khi một vòng không tìm ra finding mới, cuối cùng dedup + resolve conflict. Findings đầy đủ trong 1 lần chạy.
30
+
31
+ Mở findings file, xem xét từng finding: `accepted` → apply · `modified` → viết note · `rejected` → bỏ qua.
32
+ ```
33
+ /review-context --resume specs/prd/auth/FEAT-01-login-prd.md
34
+ ```
35
+
36
+ **Bước 4 — Final check:**
37
+ ```
38
+ /review-context specs/prd/auth/FEAT-01-login-prd.md
39
+ ```
40
+ Kiểm tra: `@trace.status`, `@trace.domain`, completeness.
41
+
42
+ **Bước 5 — Approve PRD:**
43
+ ```yaml
44
+ # Trong file PRD, cập nhật:
45
+ @trace.status: approved
46
+ @trace.version: 1.0
47
+ ```
48
+
49
+ **Bước 6 — Tạo Design Spec (FE/App):**
50
+ ```
51
+ /generate-design-spec specs/prd/auth/FEAT-01-login-prd.md
52
+ ```
53
+ Agent hỏi platform (web / app). PO phải cung cấp **Figma link node-level** (URL chứa `?node-id=`, lấy bằng right-click vào frame → "Copy link to selection") cho **mỗi screen**. Screen nào thiếu link → bị flag ❌ Missing, Status giữ `draft`, `/generate-bdd` bị BLOCKED cho đến khi đủ link.
54
+
55
+ Sau khi Designer review + confirm đủ Figma node-id links → `@trace.status: approved`.
56
+
57
+ **Bước 7 — Generate BDD:**
58
+ ```
59
+ /generate-bdd specs/prd/auth/FEAT-01-login-prd.md
60
+ ```
61
+ Agent hỏi: **"Platform? (1) web (2) app (3) system"**
62
+ - Chọn `web` → `specs/bdd/auth/web/FEAT-01-UC1-login-web.feature`
63
+ - Chạy lại, chọn `app` → `specs/bdd/auth/app/FEAT-01-UC1-login-app.feature`
64
+ - Chạy lại, chọn `system` → Agent tổng hợp từ web+app BDDs → `specs/bdd/auth/system/FEAT-01-UC1-login-system.feature`
65
+
66
+ > Nếu project chỉ có web → chỉ cần gen `web` rồi `system`.
67
+
68
+ **Bước 8 — Push và thông báo:**
69
+ ```bash
70
+ git add specs/prd/ specs/design-spec/ specs/bdd/
71
+ git commit -m "feat(auth): add FEAT-01 PRD, design spec, and BDD"
72
+ git push
73
+ ```
74
+ **Thông báo dev team:** "FEAT-01 PRD + BDD đã sẵn sàng, domain: `auth`. BDD tại `specs/bdd/auth/`"
75
+
76
+ ---
77
+
78
+ ## Tình huống 2 — Viết PRD khi dev team chưa setup
79
+
80
+ **Bối cảnh:** PO bắt đầu viết tài liệu, dev team chưa có umbrella repo. **Không cần đợi dev team.**
81
+
82
+ ```
83
+ /define-product → product definition
84
+ /generate-prd → PRD với @trace.domain: auth
85
+ /review-context --fix → auto-fix
86
+ /generate-design-spec → design spec cho FE (nếu có designer)
87
+ /generate-bdd → web → specs/bdd/auth/web/
88
+ /generate-bdd → system → specs/bdd/auth/system/ (tổng hợp từ web)
89
+ ```
90
+
91
+ **Điều duy nhất cần làm:** thống nhất domain names với dev team trước.
92
+ ```bash
93
+ # Khi /setup-ai-first hỏi "List your business domains":
94
+ # → nhập: auth, payment, loyalty
95
+
96
+ # Communicate với dev team:
97
+ # "Domain names của project: auth, payment, loyalty
98
+ # Khi setup umbrella, dùng đúng tên này làm services keys"
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Tình huống 3 — Tạo Design Spec và BDD sau khi PRD approved
104
+
105
+ **Bối cảnh:** PRD đã được approve. Cần tạo Design Spec + BDD trước khi handoff.
106
+
107
+ **Điều kiện:** Có Figma link **node-level** (URL chứa `?node-id=`, right-click frame → "Copy link to selection") cho từng screen.
108
+
109
+ **Bước 1 — Design Spec:**
110
+ ```
111
+ /generate-design-spec specs/prd/auth/FEAT-01-login-prd.md
112
+ ```
113
+ Output: `specs/design-spec/auth/FEAT-01-design-spec-web.md`
114
+
115
+ Mỗi screen cần Figma link node-id. Screen thiếu → flag ❌ Missing, BLOCKED. Sau khi Designer review → `@trace.status: approved`.
116
+
117
+ **Bước 2 — Generate BDD:**
118
+ ```
119
+ /generate-bdd specs/prd/auth/FEAT-01-login-prd.md
120
+ ```
121
+
122
+ | Lần | Platform | Output |
123
+ |---|---|---|
124
+ | 1 | `web` | `specs/bdd/auth/web/FEAT-01-UC1-login-web.feature` |
125
+ | 2 | `app` | `specs/bdd/auth/app/FEAT-01-UC1-login-app.feature` |
126
+ | 3 | `system` | `specs/bdd/auth/system/FEAT-01-UC1-login-system.feature` |
127
+
128
+ ```bash
129
+ git add specs/design-spec/ specs/bdd/
130
+ git commit -m "feat(auth): add FEAT-01 design spec and BDD (web+app+system)"
131
+ git push
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Tình huống 4 — PRD bị review trả lại (NEEDS_REVISION)
137
+
138
+ **Bước 1 — Đọc findings:**
139
+ ```bash
140
+ cat .agent/review/FEAT-01-login-prd-review-context-findings.yaml
141
+ ```
142
+
143
+ **Bước 2 — Xử lý từng finding:** set status `accepted` · `modified: "note của bạn"` · `rejected`.
144
+
145
+ **Bước 3 — Apply:**
146
+ ```
147
+ /review-context --resume specs/prd/auth/FEAT-01-login-prd.md
148
+ ```
149
+
150
+ **Bước 4 — Re-review:**
151
+ ```
152
+ /review-context specs/prd/auth/FEAT-01-login-prd.md
153
+ ```
154
+ Lặp lại cho đến khi `recommendation: APPROVED`.
155
+
156
+ ---
157
+
158
+ ## Tình huống 5 — Requirements thay đổi sau khi PRD đã approved
159
+
160
+ **Bước 1 — Đổi status về draft:**
161
+ ```yaml
162
+ @trace.status: draft
163
+ ```
164
+
165
+ **Bước 2 — Sửa nội dung:**
166
+ ```
167
+ /refine-prd specs/prd/auth/FEAT-01-login-prd.md "Thêm yêu cầu: hỗ trợ đăng nhập bằng OTP"
168
+ ```
169
+
170
+ **Bước 3 — Review lại:**
171
+ ```
172
+ /review-context specs/prd/auth/FEAT-01-login-prd.md
173
+ /review-context --resume (nếu cần fix)
174
+ ```
175
+
176
+ **Bước 4 — Approve và thông báo:**
177
+ ```yaml
178
+ @trace.status: approved
179
+ @trace.version: 1.1 # minor bump vì chỉ thêm AC
180
+ # major bump (2.0) nếu thay đổi cơ bản
181
+ ```
182
+ ```bash
183
+ git add specs/prd/auth/FEAT-01-login-prd.md
184
+ git commit -m "feat(auth): update FEAT-01 PRD v1.1 — add OTP login AC"
185
+ git push
186
+ ```
187
+
188
+ **Bước 5 — Re-generate BDD cho các platform bị ảnh hưởng:**
189
+ ```
190
+ /generate-bdd → web (nếu thay đổi ảnh hưởng FE behavior)
191
+ /generate-bdd → app (nếu project có app)
192
+ /generate-bdd → system
193
+ → BDD mới phản ánh AC đã thay đổi
194
+ ```
195
+ ```bash
196
+ git add specs/bdd/
197
+ git commit -m "feat(auth): update BDD for FEAT-01 v1.1 — OTP login scenarios"
198
+ git push
199
+ ```
200
+ > **Lưu ý:** Dev **KHÔNG tự generate BDD** — đây là trách nhiệm của PO. Nếu bỏ qua bước này, dev sẽ code theo BDD cũ và traces sẽ broken.
201
+
202
+ **Thông báo dev team:** "FEAT-01 PRD + BDD updated v1.0 → v1.1, domain: `auth`. Pull spec submodule và bắt đầu với BDD mới."
203
+
204
+ ---
205
+
206
+ ## Tình huống 6 — Thêm domain mới vào project
207
+
208
+ **Bước 1 — Cập nhật project-context.yaml:**
209
+ ```yaml
210
+ domains:
211
+ - auth
212
+ - payment
213
+ - loyalty # ← thêm vào đây
214
+ ```
215
+
216
+ **Bước 2 — Thông báo dev team cập nhật umbrella config:**
217
+ ```yaml
218
+ services:
219
+ loyalty:
220
+ path: "loyalty-service"
221
+ module: "java-spring"
222
+ specs_dir: "loyalty-service/specs/bdd"
223
+ ```
224
+
225
+ **Bước 3 — Viết PRD bình thường với `@trace.domain: loyalty`.**
226
+
227
+ > **Lưu ý:** Nếu dev team chưa cập nhật services config → `/review-context` P0 check sẽ cảnh báo domain không match.
228
+
229
+ ---
230
+
231
+ ## Tình huống 7 — Conflict giữa 2 PRDs (P3 check)
232
+
233
+ **Bối cảnh:** FEAT-01 quy định "session hết hạn sau 30 phút", FEAT-05 quy định "session hết hạn sau 2 giờ".
234
+
235
+ 1. Đọc findings file — P3 liệt kê cả 2 PRD và điểm mâu thuẫn.
236
+ 2. Quyết định PRD nào đúng.
237
+ 3. Sửa file:
238
+ ```
239
+ /review-context --resume specs/prd/auth/FEAT-01-login-prd.md
240
+ # với finding P3: modified: "session timeout cập nhật thành 2 giờ theo FEAT-05"
241
+ ```
242
+ 4. Cả 2 PRD phải nhất quán trước khi dev team generate BDD.
243
+
244
+ ---
245
+
246
+ ## Tình huống 8 — Cập nhật Business Dictionary
247
+
248
+ **Cách 1 — Thủ công:** Mở `specs/domain-knowledge/business-dictionary.md` → thêm vào Canonical Terms hoặc Banned Terms.
249
+
250
+ **Cách 2 — Để agent phát hiện:** Khi chạy `/generate-prd` hoặc `/review-context`, agent sẽ hỏi nếu phát hiện term mới chưa có trong dictionary.
251
+
252
+ **Sau khi cập nhật:**
253
+ ```bash
254
+ git add specs/domain-knowledge/business-dictionary.md
255
+ git commit -m "docs: add/update business dictionary — {term}"
256
+ git push
257
+ ```
258
+
259
+ > ⚠️ Sau khi ban một term mới, chạy `/review-context --fix` trên các PRDs hiện tại để replace banned terms tự động.
260
+
261
+ ---
262
+
263
+ ## Tình huống 9 — Quản lý nhiều PRD song song
264
+
265
+ ```
266
+ specs/prd/
267
+ ├── auth/
268
+ │ ├── FEAT-01-login-prd.md (approved)
269
+ │ └── FEAT-08-sso-prd.md (draft)
270
+ ├── payment/
271
+ │ ├── FEAT-03-checkout-prd.md (approved)
272
+ │ └── FEAT-11-refund-prd.md (draft)
273
+ └── loyalty/
274
+ └── FEAT-06-points-prd.md (in-review)
275
+ ```
276
+
277
+ **Gợi ý:** Hoàn thiện 1 PRD đến `approved` trước khi bắt đầu PRD tiếp theo. Chỉ PRD `approved` mới được dev team sử dụng.
278
+
279
+ ```bash
280
+ # Xem nhanh tất cả PRDs và status:
281
+ grep -r "@trace.status" specs/prd/ --include="*.md"
282
+ ```
283
+
284
+ ---
285
+
286
+ ## Tình huống 10 — Handoff PRD cho dev team
287
+
288
+ **Checklist trước khi thông báo:**
289
+ ```yaml
290
+ @trace.id: FEAT-01 ✅ có
291
+ @trace.domain: auth ✅ khớp với services keys của dev team
292
+ @trace.status: approved ✅ đã approved
293
+ @trace.version: 1.0 ✅ có version number
294
+ ```
295
+
296
+ ```
297
+ /review-context specs/prd/auth/FEAT-01-login-prd.md
298
+ → Phải thấy recommendation: APPROVED và 0 critical findings
299
+ ```
300
+
301
+ **Template thông báo cho dev team:**
302
+ ```
303
+ [FEAT-01] PRD Login đã approved — sẵn sàng implement
304
+
305
+ Domain: auth
306
+ File: my-project-specs/specs/prd/auth/FEAT-01-login-prd.md
307
+ Version: 1.0
308
+ Design Spec (Web): my-project-specs/specs/design-spec/auth/FEAT-01-design-spec-web.md
309
+
310
+ Lệnh để bắt đầu:
311
+ git submodule update --remote my-project-specs
312
+ /review-context my-project-specs/specs/prd/auth/FEAT-01-login-prd.md
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Tình huống 11 — Brownfield: API đã tồn tại trên hệ thống cũ
318
+
319
+ **Bước 1 — Thêm `API Source: existing` vào PRD Metadata:**
320
+ ```markdown
321
+ | **API Source** | existing |
322
+ ```
323
+
324
+ **Bước 2 — Điền section "Existing API Contract" trong Appendix:**
325
+ ```markdown
326
+ ## Existing API Contract
327
+
328
+ | Method | Path | Auth | Request | Response |
329
+ |--------|------|------|---------|----------|
330
+ | POST | /api/v1/orders | Bearer | `{ product_id, quantity }` | `{ id, status, total }` |
331
+ | GET | /api/v1/orders/:id | Bearer | — | `{ id, items[], status, created_at }` |
332
+
333
+ **Error responses:**
334
+
335
+ | HTTP Status | Error Code | Khi nào xảy ra |
336
+ |-------------|------------|----------------|
337
+ | 404 | ORDER_NOT_FOUND | Order ID không tồn tại |
338
+ | 422 | INSUFFICIENT_STOCK | Số lượng vượt tồn kho |
339
+ ```
340
+
341
+ **Bước 3 — Generate BDD như bình thường:**
342
+ ```
343
+ /generate-bdd → system
344
+ ```
345
+ Framework tự nhận ra `API Source: existing`, dùng contract trong PRD trực tiếp.
346
+
347
+ **Bước 4 — Generate Tech Docs:**
348
+ ```
349
+ /generate-tech-docs
350
+ ```
351
+ Chạy ở mode **Reverse-document**: mô tả lại API đã tồn tại, ghi chú gaps.
352
+
353
+ **Không cần:** Sign-off gate T7 (tự động skip) · `--phase=ui` (API đã live).
354
+
355
+ ---
356
+
357
+ ← [Commands](commands.md) · Tiếp theo: [Quy tắc viết PRD](prd-writing-rules.md)
@@ -0,0 +1,92 @@
1
+ [📚 Docs](../README.md) › [Guides](README.md) › QC Automation
2
+
3
+ # Hướng Dẫn QC Automation — Spec-Driven Dev
4
+
5
+ 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.
6
+
7
+ ## Mục Lục
8
+
9
+ - [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)
10
+ - [Pipeline 6 bước](#pipeline-6-bước)
11
+ - [Stack — module qc-playwright](#stack--module-qc-playwright)
12
+ - [Trace join: qc_status đến Living Docs như thế nào](#trace-join-qc_status-đến-living-docs-như-thế-nào)
13
+ - [Entry point](#entry-point)
14
+ - [Skills theo layer](#skills-theo-layer)
15
+
16
+ ## Hai Luồng Test: Dev Self-Check vs QC Chính Thức
17
+
18
+ Pipeline QC này **khác** với developer **self-check** (`/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test`):
19
+
20
+ | Signal | Owner | Command | Ý nghĩa |
21
+ |--------|-------|---------|---------|
22
+ | `dev_selftest` | Dev | `/dev-run-test` | smoke check của riêng dev (KHÔNG authoritative) |
23
+ | `qc_status` | QC | `/qc-run-test` | kết quả QC automation **chính thức** |
24
+
25
+ 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`.
26
+
27
+ ## Pipeline 6 Bước
28
+
29
+ ```
30
+ /qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report
31
+ (requirement (risk/plan (test-case (review (gen+run (report +
32
+ breakdown) + Q-for-dev) .Test.md) gate) Python → evidence)
33
+ qc_status)
34
+ ```
35
+
36
+ | Command | Vai trò | Output |
37
+ |---------|---------|--------|
38
+ | `/qc-analyze` | bóc tách spec chính thức thành requirement + BR/AC + data-flow + `DOC_GAPS` | `{refinement_dir}/qc/{UC-ID}/` |
39
+ | `/qc-plan` | risk / what-if / questions-for-dev + test plan | `TEST_PLAN.md` |
40
+ | `/qc-design-test` | thiết kế test case (Markdown `.Test.md`), tag `@trace.verifies={UC-ID}-SC{N}` | `test-cases/` |
41
+ | `/qc-review` | cổng review hai chiều: review test case (sau design) và script (sau run) | findings |
42
+ | `/qc-run-test` | sinh + chạy Python pytest-playwright; **ghi `qc_status`** per scenario | `{trace_dir}/{UC-ID}.tsv` |
43
+ | `/qc-report` | report pytest-html + Playwright trace + evidence | `reports/<feature>/report.html` |
44
+
45
+ ## Stack — Module qc-playwright
46
+
47
+ `/qc-run-test` và `/qc-report` dùng stack module `qc-playwright`
48
+ (`.agent/modules/qc-playwright/stack-profile.yaml`): **Python + pytest-playwright + Page
49
+ Object** (slim `BasePage`, 3-layer), **Playwright Trace + pytest-html** (KHÔNG Allure). Stack
50
+ này độc lập với module implementation của dev (java-spring, react, flutter, …).
51
+
52
+ Per-layer guides chi tiết nằm trong `skills/qc/<stage>/` (port từ skills của agent QC):
53
+ functional / integration / e2e / non-functional / exploratory.
54
+
55
+ ## Trace Join: qc_status Đến Living Docs Như Thế Nào
56
+
57
+ 1. `.feature` chính thức định nghĩa scenario là `@trace.scenario={UC-ID}-SC{N}`.
58
+ 2. `/qc-design-test` ghi SC mà test case thuộc về; `/qc-run-test` tag mỗi pytest test
59
+ `# @trace.verifies={UC-ID}-SC{N}`.
60
+ 3. `/qc-run-test` ghi `qc_status` (`pass|fail|skip|not_run`) + `qc_run_at` vào trace TSV của
61
+ service (authoritative), rồi refresh panel mirror local.
62
+ 4. `/validate-traces` (hoặc `/sync`) tổng hợp các TSV thành report Living Docs tại
63
+ `{spec_source}/.living-docs/` — dashboard hiển thị `qc_status` cạnh `dev_selftest`.
64
+
65
+ ## Entry Point
66
+
67
+ Pipeline QC bắt đầu ngay khi BDD của một UC được approved (`/review-context (BDD)` APPROVED):
68
+
69
+ ```
70
+ /qc-analyze {UC-ID} → … → /qc-report {UC-ID} → /validate-traces {UC-ID}
71
+ ```
72
+
73
+ ## Skills Theo Layer
74
+
75
+ Các skill chi tiết theo từng giai đoạn QC nằm trong `skills/qc/`:
76
+
77
+ | Stage skill | Vai trò |
78
+ |---|---|
79
+ | `qa-analyst` | phân tích requirement, sinh `DOC_GAPS` |
80
+ | `qa-planner` | test plan, risk, questions-for-dev |
81
+ | `qa-designer` | thiết kế test case `.Test.md` theo layer (functional / integration / e2e / non-functional / exploratory) |
82
+ | `qa-reviewer` | cổng review test case và script |
83
+ | `qa-runner` | sinh + chạy Python pytest-playwright, sinh report (Playwright Trace + pytest-html) |
84
+
85
+ Mỗi skill **tự chứa** (self-contained) và có version frontmatter để theo dõi khi nâng cấp.
86
+
87
+ ## Xem Thêm
88
+
89
+ - [Guide › Tester](tester/README.md) — vai trò tester, spec-manifest, `/report-bug`, `/propose-scenario`
90
+ - [Concepts › Traceability](../03-concepts/traceability.md) — trace TSV, dev_selftest vs qc_status
91
+ - [Reference › Modules](../05-reference/modules.md) — chi tiết module `qc-playwright`
92
+ - [Reference › Commands](../05-reference/commands.md) — danh mục đầy đủ mọi command
@@ -0,0 +1,72 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › Tester / QA
2
+
3
+ # Hướng Dẫn Tester — Spec-Driven Dev
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
+
18
+ ## Vai Trò Tester Trong Framework
19
+
20
+ ```
21
+ PO/BA Dev Tester
22
+ ────────── ────────────────── ──────────────────────────
23
+ PRD BDD (từ PRD) /sync + /generate-spec-manifest
24
+ Tech Docs Đọc PRD + BDD + Tech Docs
25
+ Code Viết test cases · Chạy test
26
+ ▲ ▲ /report-bug (bug → spec-traced)
27
+ │ │ /propose-scenario (edge case → BDD draft)
28
+ └──────────────┴───── feedback/ trong spec repo ◄────┘
29
+ PO/Dev thấy qua /sync (📥) → fix / promote / update PRD
30
+ ```
31
+
32
+ **Tester chịu trách nhiệm:**
33
+ - Đọc PRD để hiểu business requirement trước khi test
34
+ - Đọc BDD để biết chính xác scenarios cần cover
35
+ - Đọc Tech Docs để hiểu API contracts và data flow
36
+ - Viết test cases dựa trên BDD scenarios
37
+ - Khi bug xảy ra: `/report-bug` → tạo bug report có spec-context đầy đủ, phân loại layer
38
+ - Khi phát hiện edge case chưa có trong BDD: `/propose-scenario` → đề xuất cho PO/Dev duyệt
39
+
40
+ **Tester KHÔNG làm:**
41
+ - Sửa PRD / BDD / Tech Docs trực tiếp — đó là việc của PO và Dev
42
+ - Approve PRD — chỉ PO
43
+ - Generate code — chỉ Dev
44
+
45
+ > **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.
46
+
47
+ ## Commands Dành Cho Tester
48
+
49
+ | Command | Mục đích | Khi nào dùng |
50
+ |---|---|---|
51
+ | `/generate-spec-manifest` | Tạo index TICKET-ID → PRD/BDD/tech-doc | Trước mỗi sprint, sau khi pull specs mới |
52
+ | `/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 |
53
+ | `/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ó |
54
+
55
+ **QC Automation Pipeline (chính thức) — 6 lệnh `/qc-*`:**
56
+
57
+ | Command | Mục đích | Khi nào dùng |
58
+ |---|---|---|
59
+ | `/qc-analyze` | Phân tích spec chain (PRD + BDD + Tech Docs), xác định scope test | Bước 1, sau khi BDD đã approved |
60
+ | `/qc-plan` | Lập test plan: liệt kê scenarios, layer, ưu tiên | Bước 2 |
61
+ | `/qc-design-test` | Thiết kế test case chi tiết (Page Object, data, assertions) | Bước 3 |
62
+ | `/qc-review` | Review test design trước khi code automation | Bước 4 |
63
+ | `/qc-run-test` | Chạy automation test → ghi `qc_status` per scenario vào trace TSV | Bước 5 |
64
+ | `/qc-report` | Tổng hợp kết quả thành QC report | Bước 6 |
65
+
66
+ Đâ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 **[QC Automation guide](../qc-automation.md)**.
67
+
68
+ > **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.
69
+
70
+ ---
71
+
72
+ *Xem thêm:* [Developer Guide](../developer/README.md) · [QC Automation Guide](../qc-automation.md) · [Operations › Bug Flow](../../04-operations/bug-flow.md) · [Reference › Commands](../../05-reference/commands.md)
@@ -0,0 +1,117 @@
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`), ghi vào `{spec_source}/feedback/bdd-proposals/` → commit + push. PO/Dev review rồi đưa vào `.feature`.
33
+ - Nếu behavior **chưa có trong PRD** → lệnh dừng và xuất *PRD change request* cho PO.
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/prd/{domain}/{TICKET-ID}.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/prd/auth/FT-001-login.md (v1.0)
81
+ BDD : free-trial-be/specs/bdd/auth/FT-001-login.feature
82
+ → Scenario: "Lock account after 5 failed attempts"
83
+ Tech Doc : free-trial-specs/specs/tech-docs/auth/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)