@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,79 @@
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/prd/auth/FT-001-login.md"
22
+ bdd:
23
+ be: "free-trial-be/specs/bdd/auth/system/FT-001-UC1-login-system.feature"
24
+ web: "free-trial-web/specs/bdd/auth/web/FT-001-UC1-login-web.feature"
25
+ tech_docs:
26
+ be: "my-project-specs/specs/tech-docs/auth/FT-001-auth-api.md"
27
+ ```
28
+
29
+ **Bước 1: Đọc PRD** tại `my-project-specs/specs/prd/auth/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 `free-trial-be/specs/bdd/auth/system/FT-001-UC1-login-system.feature`
41
+ *(nằm trong service submodule của BE — PO gen, chứa contract BE phải đáp ứng)*
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/tech-docs/auth/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)
@@ -0,0 +1,186 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](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: Test feature mới được assign
6
+
7
+ **Bối cảnh:** PO thông báo FT-042 Checkout đã approved.
8
+
9
+ ```bash
10
+ # 1. Cập nhật repo
11
+ git pull && git submodule update --remote --recursive
12
+
13
+ # 2. Refresh manifest
14
+ /generate-spec-manifest
15
+
16
+ # 3. Kiểm tra status
17
+ # FT-042:
18
+ # status: approved ← ✅ có thể test
19
+ # prd: "specs/prd/payment/FT-042-checkout.md"
20
+ # bdd:
21
+ # be: "free-trial-be/specs/bdd/payment/system/FT-042-UC1-checkout-system.feature"
22
+ # web: "free-trial-web/specs/bdd/payment/web/FT-042-UC1-checkout-web.feature"
23
+ ```
24
+
25
+ **Test plan từ BDD BE (7 scenarios):**
26
+
27
+ | # | Scenario | Input | Expected |
28
+ |---|---|---|---|
29
+ | 1 | Checkout thành công | Cart đủ hàng, card valid | 201 + order_id |
30
+ | 2 | Cart rỗng | Không có items | 400 EMPTY_CART |
31
+ | 3 | Hết hàng | item_id đã sold out | 409 OUT_OF_STOCK |
32
+ | 4 | Card bị từ chối | card number test declined | 402 PAYMENT_DECLINED |
33
+ | 5 | Timeout payment gateway | mock timeout | 504 + order status PENDING |
34
+ | 6 | Giới hạn thanh toán | amount > 10,000,000 VND | 400 LIMIT_EXCEEDED |
35
+ | 7 | Session hết hạn | expired token | 401 UNAUTHORIZED |
36
+
37
+ ---
38
+
39
+ ## Tình huống 2: PRD thay đổi giữa sprint
40
+
41
+ **Bối cảnh:** Đang test FT-042 thì PO update PRD v1.0 → v1.1 (giới hạn từ 5tr → 10tr).
42
+
43
+ ```bash
44
+ git pull && git submodule update --remote --recursive
45
+ /generate-spec-manifest
46
+ # spec-manifest.yaml: FT-042 prd_version: "1.1"
47
+ # FT-042 Changelog:
48
+ # v1.1 | 2026-06-05 | BR7: payment limit thay đổi 5,000,000 → 10,000,000
49
+ ```
50
+
51
+ **Cập nhật test case:**
52
+ ```
53
+ Test case 6 cũ: amount > 5,000,000 → 400 LIMIT_EXCEEDED ← STALE
54
+ Test case 6 mới: amount > 10,000,000 → 400 LIMIT_EXCEEDED ← theo v1.1
55
+
56
+ Thêm test case mới:
57
+ Test case 6b: amount = 9,999,999 → 201 OK (boundary case — giờ pass)
58
+ Test case 6c: amount = 10,000,001 → 400 LIMIT_EXCEEDED
59
+ ```
60
+
61
+ > Nếu Dev chưa update code theo v1.1 → test fail vì code vẫn dùng limit 5tr → báo Dev, không phải bug.
62
+
63
+ ---
64
+
65
+ ## Tình huống 3: Test BE và Web cùng 1 feature
66
+
67
+ **Bối cảnh:** FT-001 Login có BDD cho cả BE (API) và Web (UI).
68
+
69
+ **BE test** — đọc `bdd.be` (System BDD) + `tech_docs.be`:
70
+
71
+ ```
72
+ Endpoint: POST /api/v1/auth/login
73
+ Test tool: Postman / k6 / Jest supertest
74
+
75
+ Test cases từ BDD System (cho BE):
76
+ ✅ SC1: Valid credentials → 200 + JWT
77
+ ✅ SC2: Wrong password → 401 (message generic)
78
+ ✅ SC3: 5 failures → 423 + retry_after
79
+ ✅ SC4: Locked account → 423
80
+ ✅ SC5: Email không tồn tại → 404 (message = 401 message)
81
+ ```
82
+
83
+ **Web test** — đọc `bdd.web` + `tech_docs.web`:
84
+
85
+ ```
86
+ Tool: Playwright
87
+
88
+ Test cases từ BDD Web:
89
+ ✅ SC1: Điền đúng → redirect dashboard
90
+ ✅ SC2: Sai password → toast error, password cleared
91
+ ✅ SC3: 5 lần sai → form disabled + countdown timer
92
+ ✅ SC4: "Quên mật khẩu?" link visible sau 3 lần sai
93
+ ✅ SC5: Session expired → redirect về login với message
94
+ ```
95
+
96
+ **Cross-check quan trọng:** BE trả `retry_after: 1800` → Web hiển thị countdown `29:59`. Nếu Web không đọc đúng header → bug.
97
+
98
+ ---
99
+
100
+ ## Tình huống 4: Feature chưa có BDD
101
+
102
+ **Manifest báo:**
103
+ ```
104
+ ⚠️ 1 PRDs with no matching BDD:
105
+ - FT-055 (notification) — run /generate-bdd first
106
+ ```
107
+
108
+ **Xử lý:**
109
+ ```
110
+ Không tự gen BDD — đó là việc của Dev.
111
+
112
+ 1. PRD có status: approved nhưng chưa có BDD → báo Dev lead
113
+ PRD còn draft → chờ PO approve trước
114
+
115
+ 2. Nếu bị yêu cầu test mà chưa có BDD:
116
+ → Test dựa trên PRD AC trực tiếp
117
+ → Ghi chú rõ trong test report: "Tested against PRD AC, no BDD available"
118
+ → Không thể trace chi tiết → coverage thấp hơn
119
+
120
+ 3. Sau khi Dev gen BDD → refresh manifest → test lại đầy đủ
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Tình huống 5: Regression testing sau merge lớn
126
+
127
+ **Bối cảnh:** Dev merge refactor module Auth (đổi tên `AuthService` → `IdentityService`).
128
+
129
+ ```bash
130
+ git pull && git submodule update --remote --recursive
131
+ /generate-spec-manifest
132
+ ```
133
+
134
+ **Xác định scope regression từ spec-manifest:**
135
+
136
+ ```
137
+ 1. Domain bị ảnh hưởng: auth
138
+ 2. Tất cả features có domain: auth:
139
+ - FT-001 (login), FT-003 (register), FT-007 (password reset), FT-012 (2FA)
140
+
141
+ 3. Features khác có @trace.module: IdentityService:
142
+ → Grep trong tech_docs: "IdentityService"
143
+ → FT-019 (profile) cũng phụ thuộc vào IdentityService
144
+
145
+ Regression scope: FT-001, FT-003, FT-007, FT-012, FT-019
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Tình huống 6: Test feature multi-service (BE + Web + App)
151
+
152
+ **Bối cảnh:** FT-042 Checkout có cả BE API, Web UI, và App UI.
153
+
154
+ ```yaml
155
+ FT-042:
156
+ domain: payment
157
+ status: approved
158
+ bdd:
159
+ be: "free-trial-be/specs/bdd/payment/system/FT-042-UC1-checkout-system.feature"
160
+ web: "free-trial-web/specs/bdd/payment/web/FT-042-UC1-checkout-web.feature"
161
+ app: "free-trial-app/specs/bdd/payment/app/FT-042-UC1-checkout-app.feature"
162
+ ```
163
+
164
+ **Test strategy:**
165
+
166
+ ```
167
+ Layer 1 — BE API:
168
+ → Test /api/v1/checkout endpoint isolated
169
+ → Tool: Postman hoặc Jest supertest
170
+
171
+ Layer 2 — Web E2E:
172
+ → Tool: Playwright
173
+ → Flow: Cart → Checkout page → Payment form → Order confirmation
174
+
175
+ Layer 3 — App E2E:
176
+ → Tool: Maestro / Detox
177
+ → Flow: Cart screen → Checkout → Payment → Success screen
178
+
179
+ Layer 4 — Cross-layer:
180
+ → Web checkout → kiểm tra order trong BE database
181
+ → App checkout → cùng order visible trong Web dashboard
182
+ ```
183
+
184
+ ---
185
+
186
+ ← [Đọc Spec Chain](reading-specs.md) · Tiếp theo: [Báo cáo bug](bug-reporting.md)
@@ -0,0 +1,124 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Spec Manifest & Setup
2
+
3
+ # Spec Manifest & Setup
4
+
5
+ ## Spec-Manifest Là Gì Và Tại Sao Cần
6
+
7
+ Trong umbrella repo, spec files nằm rải rác ở nhiều submodule:
8
+
9
+ ```
10
+ free-trial-spec/
11
+ ├── specs/prd/auth/FT-001-login.md ← PRD (spec submodule)
12
+ ├── specs/product-definition/auth/... ← PDD
13
+ ├── free-trial-be/specs/bdd/... ← BDD của BE
14
+ ├── free-trial-web/specs/bdd/... ← BDD của Web
15
+ └── free-trial-app/specs/bdd/... ← BDD của App
16
+ ```
17
+
18
+ Tester's agent không biết layout này → cần một **index file** để tra cứu.
19
+
20
+ `spec-manifest.yaml` là file được gen tự động, ánh xạ TICKET-ID → tất cả file liên quan:
21
+
22
+ ```yaml
23
+ features:
24
+ FT-001:
25
+ domain: auth
26
+ status: approved
27
+ prd: "specs/prd/auth/FT-001-login.md"
28
+ pdd: "specs/product-definition/auth/FT-001-def.md"
29
+ tech_docs:
30
+ be: "free-trial-specs/specs/tech-docs/auth/FT-001-UC1-auth-api.md"
31
+ web: "free-trial-specs/specs/tech-docs/auth/FT-001-UC1-login-web.md"
32
+ bdd:
33
+ be: "free-trial-be/specs/bdd/auth/system/FT-001-UC1-login-system.feature"
34
+ web: "free-trial-web/specs/bdd/auth/web/FT-001-UC1-login-web.feature"
35
+ ```
36
+
37
+ **Quan trọng:**
38
+ - File này **không commit vào git** (gitignored) — gen local mỗi khi cần
39
+ - Luôn `git pull` trước khi gen để có submodule mới nhất
40
+ - Chỉ test các feature có `status: approved` — draft PRD chưa được approve
41
+ - Nếu nhiều người gen cùng lúc → kết quả **giống nhau** (deterministic) — không conflict
42
+ - Khi PO cập nhật PRD hoặc BDD → re-run `/generate-spec-manifest` để manifest phản ánh nội dung mới
43
+
44
+ ## Setup Tester Agent
45
+
46
+ ### Lần đầu tiên
47
+
48
+ ```bash
49
+ # 1. Clone umbrella repo (nếu chưa có)
50
+ git clone {umbrella-repo-url} free-trial-spec
51
+ cd free-trial-spec
52
+
53
+ # 2. Init tất cả submodules
54
+ git submodule update --init --recursive
55
+
56
+ # 3. Mở Claude Code tại umbrella root
57
+ # QUAN TRỌNG: mở tại free-trial-spec/, không phải free-trial-tests/
58
+ ```
59
+
60
+ ### Trước mỗi test sprint
61
+
62
+ ```bash
63
+ # Cập nhật tất cả submodules về commit mới nhất
64
+ git pull
65
+ git submodule update --remote --recursive
66
+
67
+ # Gen manifest
68
+ /generate-spec-manifest
69
+ # → viết spec-manifest.yaml tại free-trial-spec/ root
70
+ ```
71
+
72
+ ### Cấu hình tester agent đọc manifest
73
+
74
+ Trong tester's agent config (hoặc system prompt), thêm:
75
+
76
+ ```
77
+ Trước khi test bất kỳ feature nào:
78
+ 1. Đọc spec-manifest.yaml tại project root
79
+ 2. Lookup TICKET-ID → lấy paths của prd, bdd, tech_docs
80
+ 3. Chỉ test features có status: approved
81
+ 4. Đọc PRD trước để hiểu business context
82
+ 5. Đọc BDD để biết scenarios cần cover
83
+ ```
84
+
85
+ ## Living Docs Panel (umbrella mode)
86
+
87
+ Khi làm việc với umbrella repo, VS Code Living Docs panel cần được đồng bộ trước khi xem (chạy `/sync` hoặc `/validate-traces`).
88
+
89
+ **Report canonical (Living Docs):** `{spec_source}/.living-docs/trace-report.json` + bản mirror TSV — nằm trong **spec module** (gitignored, regenerate mỗi lần `/sync` hoặc `/validate-traces`).
90
+
91
+ **Panel mirror:** `./.trace` của workspace hiện tại — giữ panel **không bị trống** kể cả khi mở Claude Code bên trong một service submodule đơn lẻ.
92
+
93
+ ```bash
94
+ # Chạy sau mỗi codegen session — hoặc khi cần refresh trạng thái coverage
95
+ /sync # hoặc /validate-traces
96
+
97
+ # → Đọc TSVs từ: user-service/.trace/, order-service/.trace/, ...
98
+ # → Ghi canonical: {spec_source}/.living-docs/trace-report.json (+ TSV mirror)
99
+ # → Ghi panel mirror: ./.trace (workspace hiện tại — panel luôn có data)
100
+ # → Panel cập nhật ngay sau khi lệnh hoàn tất
101
+ ```
102
+
103
+ Panel hiển thị trạng thái cross-service:
104
+
105
+ | Cột | Ý nghĩa |
106
+ |-----|---------|
107
+ | PRDs | Số PRD đã approve / tổng |
108
+ | UCs | Số Use Cases đã implement |
109
+ | Code Cov. | % scenarios có code |
110
+ | Test Cov. | % scenarios có test |
111
+ | DRIFT | Spec thay đổi sau khi gen code |
112
+ | GAP | Code có nhưng chưa có test |
113
+ | dev_selftest | Dev đã chạy self-check: `pass` / `fail` / `not_run` |
114
+ | qc_status | Kết quả QC chính thức: `pass` / `fail` / `skip` / `not_run` |
115
+
116
+ > **`dev_selftest`:** tín hiệu cho QC thấy dev đã tự chạy self-check. **Không phải** coverage chính thức — đó là `qc_status`.
117
+ >
118
+ > **`qc_status`:** kết quả pipeline QC chính thức (`/qc-run-test`). Dashboard hiển thị hai cột cạnh nhau để phân biệt rõ hai luồng.
119
+
120
+ > **Prerequisite:** Mỗi service submodule cần `.agent/project-context.yaml` với `paths.trace_dir`. Nếu thiếu → panel trống → báo Dev team.
121
+
122
+ ---
123
+
124
+ ← [Tester Guide](README.md) · Tiếp theo: [Workflow](workflow.md)
@@ -0,0 +1,31 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Checklist Test Pass
2
+
3
+ # Checklist Trước Khi Báo "test pass"
4
+
5
+ **Spec & coverage:**
6
+ - [ ] Tất cả BDD scenarios đã được cover (happy path + edge + error)
7
+ - [ ] Mọi AC trong PRD đã được verify
8
+ - [ ] Manifest version khớp với PRD version đang deploy
9
+ - [ ] Không có scenarios bị skip mà không có lý do ghi chú
10
+
11
+ **Môi trường:**
12
+ - [ ] Test đã chạy trên đúng môi trường (staging, không phải local dev)
13
+ - [ ] Cross-service flows đã được verify (nếu feature span nhiều service)
14
+
15
+ **TSV & Living Docs:**
16
+ - [ ] `/qc-run-test` đã chạy → `qc_status` đã ghi vào `{service}/.trace/{UC-ID}.tsv`
17
+ - [ ] TSV đã được commit vào service submodule + umbrella pointer đã update + push
18
+ - [ ] `/validate-traces` (hoặc `/sync`) đã chạy → Living Docs panel hiển thị `qc_status: pass`
19
+ - [ ] Không còn scenario nào `qc_status: not_run` trong UC đang test
20
+ - [ ] Nếu có `qc_status: fail` → đã `/report-bug` kèm path evidence (`reports/<feature>/report.html`)
21
+
22
+ ## Xem Thêm
23
+
24
+ - [Guide › QC Automation](../qc-automation.md) — pipeline `/qc-*` chi tiết, `qc_status`, stack `qc-playwright`
25
+ - [Operations › Bug Flow](../../04-operations/bug-flow.md) — flow phối hợp Tester ↔ Dev ↔ PO
26
+ - [Concepts › Traceability](../../03-concepts/traceability.md) — trace TSV, dev_selftest vs qc_status
27
+ - [Reference › Commands](../../05-reference/commands.md) — danh mục đầy đủ mọi command
28
+
29
+ ---
30
+
31
+ ← [Báo cáo bug](bug-reporting.md)
@@ -0,0 +1,79 @@
1
+ [📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Workflow
2
+
3
+ # Workflow Cơ Bản
4
+
5
+ ```
6
+ Nhận task: "Test FT-042 — Checkout flow"
7
+
8
+
9
+ git pull && git submodule update --remote --recursive
10
+
11
+
12
+ /generate-spec-manifest
13
+ → spec-manifest.yaml được refresh
14
+
15
+
16
+ Lookup FT-042 trong spec-manifest.yaml
17
+ → status: approved? ✅ (nếu draft → dừng, báo PO)
18
+ → ghi lại paths (tất cả đều nằm trong submodule):
19
+ prd: {spec_source}/specs/prd/{domain}/FT-042-*.md
20
+ bdd.be: {service-be}/specs/bdd/{domain}/FT-042-*.feature
21
+ bdd.web: {service-web}/specs/bdd/{domain}/FT-042-*.feature
22
+ tech_docs.be: {spec_source}/specs/tech-docs/{domain}/FT-042-*.md
23
+
24
+
25
+ Đọc PRD tại path manifest.prd
26
+ → file nằm trong SPEC submodule (shared — PO viết)
27
+ → hiểu AC, UC, BR — đây là "ground truth"
28
+
29
+
30
+ Đọc BDD tại path manifest.bdd.be / bdd.web
31
+ → file nằm trong SERVICE submodule (be/web/app — PO gen từ PRD)
32
+ → mỗi Scenario = 1 test case cần cover
33
+ → BE có BDD riêng (system/), Web có BDD riêng (web/), App có BDD riêng (app/)
34
+
35
+
36
+ Đọc Tech Docs tại path manifest.tech_docs.be / tech_docs.web
37
+ → file nằm trong SPEC submodule (shared — Dev gen, SA sign-off)
38
+ → BE: API endpoints, request/response schema, error codes
39
+ → Web: screen flow, component states
40
+
41
+
42
+ Chạy QC automation pipeline (6 bước — ghi kết quả chính thức vào TSV)
43
+
44
+ ├─ /qc-analyze {UC-ID} → bóc tách spec, xác định scope, phát hiện DOC_GAPS
45
+ ├─ /qc-plan {UC-ID} → risk + test plan + questions-for-dev
46
+ ├─ /qc-design-test {UC-ID} → thiết kế test case chi tiết (.Test.md)
47
+ ├─ /qc-review {UC-ID} → review test design trước khi chạy
48
+ ├─ /qc-run-test {UC-ID} → sinh + chạy pytest-playwright
49
+ │ → ghi qc_status (pass/fail/skip) per scenario
50
+ │ → vào {service}/.trace/{UC-ID}.tsv ← AUTHORITATIVE
51
+ └─ /qc-report {UC-ID} → report pytest-html + Playwright trace evidence
52
+ → reports/<feature>/report.html ← LOCAL, gitignored
53
+
54
+
55
+ Commit TSV vào service submodule + update umbrella pointer
56
+ cd {service}
57
+ git add .trace/{UC-ID}.tsv
58
+ git commit -m "qc: record qc_status for {UC-ID} — pass/fail"
59
+ git push
60
+ cd .. ← umbrella root
61
+ git add {service}
62
+ git commit -m "chore: update {service} submodule pointer — {UC-ID} qc_status"
63
+ git push
64
+
65
+
66
+ /validate-traces (hoặc /sync)
67
+ → tổng hợp TSVs từ tất cả services → Living Docs cập nhật cột qc_status
68
+
69
+
70
+ Kết quả:
71
+ qc_status: pass → done, Living Docs phản ánh coverage chính thức
72
+ qc_status: fail → /report-bug với BDD scenario + AC bị vi phạm
73
+ đính kèm path evidence: reports/<feature>/report.html
74
+ (evidence local — share file hoặc upload riêng nếu cần)
75
+ ```
76
+
77
+ ---
78
+
79
+ ← [Spec Manifest & Setup](spec-manifest.md) · Tiếp theo: [Đọc Spec Chain](reading-specs.md)
@@ -0,0 +1,19 @@
1
+ [📚 Docs](../README.md) › Concepts
2
+
3
+ # Concepts
4
+
5
+ Hiểu **cách framework được xây dựng và vận hành** — kiến trúc nhiều lớp, pipeline các phase, và hệ thống traceability. Đọc section này khi bạn muốn biết *vì sao* mọi thứ hoạt động như vậy, không chỉ *cách dùng* lệnh.
6
+
7
+ ## Mục lục (this section)
8
+
9
+ - [architecture.md](architecture.md) — 6 lớp (Protection → Output), module plug-in system, build pipeline (`*.tmpl` → `*.md` → `core/`), directory map, sub-agent orchestration, hook data-protection.
10
+ - [pipeline.md](pipeline.md) — các phase Discovery → PRD → Design-Spec → BDD → Tech-Docs → Code → Dev self-check → QC automation → Tester feedback; review gates; và step-architecture model (gate / context-loader / spawn-agent / report-footer) đằng sau mỗi command.
11
+ - [traceability.md](traceability.md) — `@trace.*` tags, trace TSV, hai tín hiệu `dev_selftest` vs `qc_status`, Living Docs (canonical trong spec-module + panel mirror), và `/validate-traces`.
12
+
13
+ ## Đọc gì trước?
14
+
15
+ 1. Muốn cái nhìn tổng thể? → [architecture.md](architecture.md) — file "đọc trước khi đọc bất kỳ file chi tiết nào".
16
+ 2. Muốn hiểu luồng làm việc end-to-end? → [pipeline.md](pipeline.md).
17
+ 3. Muốn hiểu coverage / drift / Living Docs? → [traceability.md](traceability.md).
18
+
19
+ > Tra cứu chi tiết schema và module thì sang [05 · Reference](../05-reference/) — [trace-schema.md](../05-reference/trace-schema.md) và [modules.md](../05-reference/modules.md).