@edupia-tutor/spec-driven-docs 0.14.0 → 0.14.1

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 (141) hide show
  1. package/commands/debug.md +435 -435
  2. package/commands/debug.tmpl +111 -111
  3. package/commands/define-product.md +330 -327
  4. package/commands/define-product.tmpl +50 -47
  5. package/commands/dev-gen-test.md +364 -364
  6. package/commands/dev-gen-test.tmpl +63 -63
  7. package/commands/dev-run-test.md +375 -375
  8. package/commands/dev-run-test.tmpl +74 -74
  9. package/commands/dev-smoke-test.md +340 -340
  10. package/commands/dev-smoke-test.tmpl +60 -60
  11. package/commands/fix-bug.md +402 -402
  12. package/commands/fix-bug.tmpl +78 -78
  13. package/commands/generate-bdd.md +512 -512
  14. package/commands/generate-bdd.tmpl +211 -211
  15. package/commands/generate-code.md +480 -482
  16. package/commands/generate-code.tmpl +179 -181
  17. package/commands/generate-design-spec.md +495 -495
  18. package/commands/generate-design-spec.tmpl +219 -219
  19. package/commands/generate-prd.md +445 -396
  20. package/commands/generate-prd.tmpl +45 -198
  21. package/commands/generate-spec-manifest.md +337 -337
  22. package/commands/generate-spec-manifest.tmpl +57 -57
  23. package/commands/generate-tech-docs.md +364 -364
  24. package/commands/generate-tech-docs.tmpl +84 -84
  25. package/commands/learn.md +346 -346
  26. package/commands/learn.tmpl +22 -22
  27. package/commands/map-testids.md +321 -321
  28. package/commands/map-testids.tmpl +41 -41
  29. package/commands/propose-scenario.md +334 -334
  30. package/commands/propose-scenario.tmpl +54 -54
  31. package/commands/qc-analyze.md +322 -323
  32. package/commands/qc-analyze.tmpl +42 -43
  33. package/commands/qc-design-test.md +303 -303
  34. package/commands/qc-design-test.tmpl +23 -23
  35. package/commands/qc-plan.md +296 -296
  36. package/commands/qc-plan.tmpl +16 -16
  37. package/commands/qc-report.md +301 -301
  38. package/commands/qc-report.tmpl +21 -21
  39. package/commands/qc-review.md +297 -297
  40. package/commands/qc-review.tmpl +17 -17
  41. package/commands/qc-run-test.md +336 -336
  42. package/commands/qc-run-test.tmpl +35 -35
  43. package/commands/refine-prd.md +426 -428
  44. package/commands/refine-prd.tmpl +61 -61
  45. package/commands/report-bug.md +350 -350
  46. package/commands/report-bug.tmpl +70 -70
  47. package/commands/review-code.md +363 -363
  48. package/commands/review-code.tmpl +39 -39
  49. package/commands/review-context.md +577 -579
  50. package/commands/review-context.tmpl +212 -212
  51. package/commands/review-tech-docs.md +426 -426
  52. package/commands/review-tech-docs.tmpl +146 -146
  53. package/commands/setup-ai-first.md +237 -237
  54. package/commands/setup-ai-first.tmpl +131 -131
  55. package/commands/sync.md +145 -145
  56. package/commands/sync.tmpl +93 -93
  57. package/commands/update-framework.md +88 -88
  58. package/commands/update-framework.tmpl +36 -36
  59. package/commands/validate-traces.md +379 -379
  60. package/commands/validate-traces.tmpl +99 -99
  61. package/core/FRAMEWORK_VERSION +1 -1
  62. package/core/commands/debug.md +435 -435
  63. package/core/commands/define-product.md +330 -327
  64. package/core/commands/dev-gen-test.md +364 -364
  65. package/core/commands/dev-run-test.md +375 -375
  66. package/core/commands/dev-smoke-test.md +340 -340
  67. package/core/commands/fix-bug.md +402 -402
  68. package/core/commands/generate-bdd.md +512 -512
  69. package/core/commands/generate-code.md +480 -482
  70. package/core/commands/generate-design-spec.md +495 -495
  71. package/core/commands/generate-prd.md +445 -396
  72. package/core/commands/generate-spec-manifest.md +337 -337
  73. package/core/commands/generate-tech-docs.md +364 -364
  74. package/core/commands/learn.md +346 -346
  75. package/core/commands/map-testids.md +321 -321
  76. package/core/commands/propose-scenario.md +334 -334
  77. package/core/commands/qc-analyze.md +322 -323
  78. package/core/commands/qc-design-test.md +303 -303
  79. package/core/commands/qc-plan.md +296 -296
  80. package/core/commands/qc-report.md +301 -301
  81. package/core/commands/qc-review.md +297 -297
  82. package/core/commands/qc-run-test.md +336 -336
  83. package/core/commands/refine-prd.md +426 -428
  84. package/core/commands/report-bug.md +350 -350
  85. package/core/commands/review-code.md +363 -363
  86. package/core/commands/review-context.md +577 -579
  87. package/core/commands/review-tech-docs.md +426 -426
  88. package/core/commands/setup-ai-first.md +237 -237
  89. package/core/commands/sync.md +145 -145
  90. package/core/commands/update-framework.md +88 -88
  91. package/core/commands/validate-traces.md +379 -379
  92. package/core/skills/code/SKILL.md +388 -388
  93. package/core/skills/debug/SKILL.md +390 -390
  94. package/core/skills/design-spec/SKILL.md +316 -316
  95. package/core/skills/discovery/SKILL.md +7 -547
  96. package/core/skills/prd/SKILL.md +298 -394
  97. package/core/skills/setup-ai-first/SKILL.md +79 -79
  98. package/core/skills/spec/SKILL.md +176 -176
  99. package/core/skills/test/SKILL.md +602 -602
  100. package/core/steps/capture-lesson.md +44 -44
  101. package/core/steps/context-loader.md +174 -174
  102. package/core/steps/gate.md +54 -54
  103. package/core/steps/report-footer.md +52 -52
  104. package/core/steps/review-fanout.md +85 -87
  105. package/core/steps/spawn-agent.md +45 -45
  106. package/core/steps/trace-mirror.md +21 -21
  107. package/core/templates/architecture.template.md +37 -37
  108. package/core/templates/design-spec.template.md +77 -77
  109. package/core/templates/platform-guide.template.md +47 -47
  110. package/core/templates/prd.template.md +106 -231
  111. package/core/templates/product-definition.template.md +101 -88
  112. package/docs/04-operations/publishing.md +20 -3
  113. package/package.json +1 -1
  114. package/skills/code/SKILL.md +388 -388
  115. package/skills/code/SKILL.tmpl +56 -56
  116. package/skills/debug/SKILL.md +390 -390
  117. package/skills/debug/SKILL.tmpl +60 -60
  118. package/skills/design-spec/SKILL.md +316 -316
  119. package/skills/design-spec/SKILL.tmpl +36 -36
  120. package/skills/discovery/SKILL.md +7 -547
  121. package/skills/discovery/SKILL.tmpl +7 -140
  122. package/skills/prd/SKILL.md +298 -394
  123. package/skills/prd/SKILL.tmpl +40 -151
  124. package/skills/setup-ai-first/SKILL.md +79 -79
  125. package/skills/setup-ai-first/SKILL.tmpl +27 -27
  126. package/skills/spec/SKILL.md +176 -176
  127. package/skills/spec/SKILL.tmpl +18 -18
  128. package/skills/test/SKILL.md +602 -602
  129. package/skills/test/SKILL.tmpl +44 -44
  130. package/steps/capture-lesson.md +44 -44
  131. package/steps/context-loader.md +174 -174
  132. package/steps/gate.md +54 -54
  133. package/steps/report-footer.md +52 -52
  134. package/steps/review-fanout.md +85 -87
  135. package/steps/spawn-agent.md +45 -45
  136. package/steps/trace-mirror.md +21 -21
  137. package/templates/architecture.template.md +37 -37
  138. package/templates/design-spec.template.md +77 -77
  139. package/templates/platform-guide.template.md +47 -47
  140. package/templates/prd.template.md +106 -231
  141. package/templates/product-definition.template.md +101 -88
@@ -1,10 +1,10 @@
1
1
  ---
2
- description: Fixes bugs with full workflow (branch, test, commit), performs quick debug analysis of errors or unexpected behavior, or validates traceability coverage between specs and code. Trigger when: "/fix-bug", "/debug", "/validate-traces", "fix bug", "sửa bug", "debug lỗi", "phân tích lỗi", "tại sao lỗi này", "validate traces", "kiểm tra traceability", "coverage matrix", "trace drift".
2
+ description: Fix bug với full workflow (branch, test, commit), phân tích debug nhanh các lỗi hoặc hành vi bất ngờ, hoặc kiểm chứng độ phủ traceability giữa spec code. Trigger when: "/fix-bug", "/debug", "/validate-traces", "fix bug", "sửa bug", "debug lỗi", "phân tích lỗi", "tại sao lỗi này", "validate traces", "kiểm tra traceability", "coverage matrix", "trace drift".
3
3
  ---
4
4
 
5
5
  # Debug & Quality Skills — Fix Bug, Debug, Validate Traces
6
6
 
7
- This skill handles: `/fix-bug` (full bug fix workflow), `/debug` (quick analysis), and `/validate-traces` (traceability coverage check).
7
+ Skill này xử lý: `/fix-bug` (full bug fix workflow), `/debug` (phân tích nhanh), `/validate-traces` (check độ phủ traceability).
8
8
 
9
9
  ---
10
10
 
@@ -12,70 +12,70 @@ This skill handles: `/fix-bug` (full bug fix workflow), `/debug` (quick analysis
12
12
 
13
13
  ### Input
14
14
 
15
- Accept: ticket ID (e.g. `PROJ-123`) or a direct bug description.
15
+ Nhận: ticket ID (vd `PROJ-123`) hoặc một tả bug trực tiếp.
16
16
 
17
17
  ### Phase 1 — Gather Information
18
18
 
19
- If ticket ID provided:
20
- - Fetch ticket details if Jira/issue tracker is connected
21
- - Otherwise ask user to paste: title, steps to reproduce, expected vs actual
19
+ Nếu cho ticket ID:
20
+ - Fetch chi tiết ticket nếu Jira/issue tracker được kết nối
21
+ - Ngược lại nhờ user dán: title, các bước tái hiện, expected vs actual
22
22
 
23
- If no ticket:
24
- **CHECKPOINT** — Ask:
25
- 1. Where does the bug occur? (service, endpoint, flow)
26
- 2. Steps to reproduce?
23
+ Nếu không ticket:
24
+ **CHECKPOINT** — Hỏi:
25
+ 1. Bug xảy ra đâu? (service, endpoint, flow)
26
+ 2. Các bước tái hiện?
27
27
  3. Expected vs Actual behavior?
28
- 4. Error log / stack trace (if any)?
28
+ 4. Error log / stack trace (nếu )?
29
29
 
30
30
  ### Phase 2 — Root Cause Analysis
31
31
 
32
- # Context Loader — Load All Project Context
32
+ # Context Loader — Nạp toàn bộ context dự án
33
33
 
34
- Execute these steps in order. Store everything in memory for the duration of the command session.
34
+ Thực hiện các bước theo đúng thứ tự. Lưu mọi thứ vào bộ nhớ trong suốt phiên làm việc của lệnh.
35
35
 
36
- **Priority guide (anti-lost-in-middle):**
37
- - Steps 1–2 are PROJECT-CONFIG — loaded first, resolve all paths and metadata.
38
- - Step 3 is CRITICAL — architecture + coding standards, the highest-priority facts for generation.
39
- - Step 4 is SAFETY — data protection rules, enforced silently for the entire session.
40
- - Steps 5–6 are DOMAIN KNOWLEDGE — terminology and entity definitions.
41
- - Step 7 is the WORKING MEMORY RECAP — locks critical facts into the top of working memory.
36
+ **Hướng dẫn ưu tiên (chống lost-in-middle):**
37
+ - Bước 1–2 PROJECT-CONFIG — nạp trước, phân giải mọi path metadata.
38
+ - Bước 3 CRITICAL — kiến trúc + coding standards, các sự thật ưu tiên cao nhất khi sinh nội dung.
39
+ - Bước 4 SAFETY — quy tắc bảo vệ dữ liệu, thực thi ngầm suốt cả phiên.
40
+ - Bước 5–6 DOMAIN KNOWLEDGE — thuật ngữ và định nghĩa entity.
41
+ - Bước 7 WORKING MEMORY RECAP — chốt các sự thật quan trọng lên đầu bộ nhớ làm việc.
42
42
 
43
43
  ---
44
44
 
45
- ## Step 1 — [PROJECT-CONFIG] Load project-context.yaml
45
+ ## Bước 1 — [PROJECT-CONFIG] Nạp project-context.yaml
46
46
 
47
- Read `.agent/project-context.yaml`. Extract and store:
47
+ Đọc `.agent/project-context.yaml`. Trích xuất và lưu:
48
48
 
49
49
  **Tech Stack:**
50
- - `tech_stack.language` → active language (e.g., Java 17, TypeScript, C#, Go)
51
- - `tech_stack.framework` → active framework (e.g., Spring Boot 3.2, Angular 17, .NET 8)
52
- - `tech_stack.build_tool` → build tool (e.g., Maven, npm, dotnet, go)
53
- - `tech_stack.test_framework` → test framework (e.g., JUnit 5 + Mockito, Jest, xUnit)
54
- - `tech_stack.database` → database (e.g., PostgreSQL, MySQL, MongoDB)
55
- - `tech_stack.module` → active module profile (e.g., java-spring, angular, dotnet, golang, context-engineering)
50
+ - `tech_stack.language` → ngôn ngữ đang dùng (vd: Java 17, TypeScript, C#, Go)
51
+ - `tech_stack.framework` → framework đang dùng (vd: Spring Boot 3.2, Angular 17, .NET 8)
52
+ - `tech_stack.build_tool` → build tool (vd: Maven, npm, dotnet, go)
53
+ - `tech_stack.test_framework` → test framework (vd: JUnit 5 + Mockito, Jest, xUnit)
54
+ - `tech_stack.database` → database (vd: PostgreSQL, MySQL, MongoDB)
55
+ - `tech_stack.module` → module profile đang dùng (vd: java-spring, angular, dotnet, golang, context-engineering)
56
56
 
57
57
  **Conventions:**
58
- - `conventions.build_command` → how to compile/build
59
- - `conventions.test_command` → how to run tests
60
- - `conventions.service_run` → how to start the service
61
- - `conventions.ticket_prefix` → ticket ID prefix (e.g., PROJ, FEAT, UC)
58
+ - `conventions.build_command` → cách compile/build
59
+ - `conventions.test_command` → cách chạy test
60
+ - `conventions.service_run` → cách khởi động service
61
+ - `conventions.ticket_prefix` → tiền tố ticket ID (vd: PROJ, FEAT, UC)
62
62
 
63
63
  **Domains:**
64
- - `domains` → list of active business domains
65
-
66
- **Paths (if present):**
67
- - `paths.specs_dir` → spec artifacts root — PRD, BDD, tech-docs, design-spec. Structure: `{specs_dir}/{domain}/{prd-slug}/{prd.md | bdd/ | tech-docs/ | design-spec/}`
68
- - `paths.refinement_dir` → findings/review output dir
69
- - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
70
- - `paths.qc_skills_dir` → where qc-* commands load QC skills from (default bundled `.agent/skills/qc`; override to the QC team's own repo/submodule so framework upgrade won't overwrite them)
71
- - `paths.product_definitions_dir` → product definitions root
72
- - `paths.domain_knowledge_dir` → domain knowledge root
73
- - `paths.business_dictionary` → path to business-dictionary.md
74
- - `paths.core_entities` → path to core-entities.md
75
- - `paths.tech_docs_dir` → technical documentation root (merged with specs_dir in feature-package layout — tech-docs live under `{specs_dir}/{domain}/{prd-slug}/tech-docs/`)
76
- - `paths.trace_dir` → trace state directory; structure: `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`
77
-
78
- If `paths` section is absent, use these defaults:
64
+ - `domains` → danh sách các business domain đang hoạt động
65
+
66
+ **Paths (nếu ):**
67
+ - `paths.specs_dir` → gốc của spec artifact — PRD, BDD, tech-docs, design-spec. Cấu trúc: `{specs_dir}/{domain}/{prd-slug}/{prd.md | bdd/ | tech-docs/ | design-spec/}`
68
+ - `paths.refinement_dir` → thư mục output cho findings/review
69
+ - `paths.qc_dir` → gốc artifact QC automation (hiện top-level, mỗi UC một thư mục con: `{qc_dir}/{UC-ID}/`)
70
+ - `paths.qc_skills_dir` → nơi các lệnh qc-* nạp QC skill (mặc định bundled `.agent/skills/qc`; override sang repo/submodule riêng của team QC để bản nâng cấp framework không ghi đè)
71
+ - `paths.product_definitions_dir` → gốc product definition
72
+ - `paths.domain_knowledge_dir` → gốc domain knowledge
73
+ - `paths.business_dictionary` → path tới business-dictionary.md
74
+ - `paths.core_entities` → path tới core-entities.md
75
+ - `paths.tech_docs_dir` → gốc tài liệu kỹ thuật (gộp với specs_dir trong bố cục feature-package — tech-docs nằm dưới `{specs_dir}/{domain}/{prd-slug}/tech-docs/`)
76
+ - `paths.trace_dir` → thư mục trạng thái trace; cấu trúc: `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`
77
+
78
+ Nếu không có section `paths`, dùng các giá trị mặc định:
79
79
  - `specs_dir` = `specs`
80
80
  - `refinement_dir` = `.agent/review`
81
81
  - `qc_dir` = `docs`
@@ -87,184 +87,184 @@ If `paths` section is absent, use these defaults:
87
87
  - `tech_docs_dir` = `specs`
88
88
  - `trace_dir` = `.trace`
89
89
 
90
- Note: In the feature-package layout, `specs_dir` is the unified root. All spec artifact types (PRD, BDD, tech-docs, design-spec) live under `{specs_dir}/{domain}/{prd-slug}/`. The `prd-slug` is the feature-package folder name, not a separate config variable.
90
+ Lưu ý: Trong bố cục feature-package, `specs_dir` gốc thống nhất. Mọi loại spec artifact (PRD, BDD, tech-docs, design-spec) đều nằm dưới `{specs_dir}/{domain}/{prd-slug}/`. `prd-slug` tên folder feature-package, không phải một biến config riêng.
91
91
 
92
- **How to extract `prd_slug` (works for ANY target file, regardless of nesting depth):** given a target path of the form `{specs_dir}/{domain}/{prd-slug}/...`, take the **first path segment after `{specs_dir}/{domain}/`** — i.e. the `{prd-slug}` position. Do NOT use the file's immediate parent folder, because BDD/tech-docs/design-spec artifacts are nested one or two levels deeper inside the package. Examples:
92
+ **Cách trích xuất `prd_slug` (đúng cho MỌI target file, bất kể độ sâu lồng nhau):** với một path target dạng `{specs_dir}/{domain}/{prd-slug}/...`, lấy **segment path đầu tiên sau `{specs_dir}/{domain}/`** — tức vị trí `{prd-slug}`. KHÔNG dùng folder cha trực tiếp của file, artifact BDD/tech-docs/design-spec lồng sâu hơn một hoặc hai cấp bên trong package. Ví dụ:
93
93
  - `specs/payment/create-invoice/prd.md` → `prd_slug = create-invoice`
94
- - `specs/payment/create-invoice/bdd/system/PAY-UC1.feature` → `prd_slug = create-invoice` *(NOT `system`)*
95
- - `specs/payment/create-invoice/bdd/web/PAY-UC1.feature` → `prd_slug = create-invoice` *(NOT `web`)*
96
- - `specs/payment/create-invoice/tech-docs/PAY-UC1-tech-design.md` → `prd_slug = create-invoice` *(NOT `tech-docs`)*
94
+ - `specs/payment/create-invoice/bdd/system/PAY-UC1.feature` → `prd_slug = create-invoice` *(KHÔNG phải `system`)*
95
+ - `specs/payment/create-invoice/bdd/web/PAY-UC1.feature` → `prd_slug = create-invoice` *(KHÔNG phải `web`)*
96
+ - `specs/payment/create-invoice/tech-docs/PAY-UC1-tech-design.md` → `prd_slug = create-invoice` *(KHÔNG phải `tech-docs`)*
97
97
  - `specs/payment/create-invoice/design-spec/PAY-design-spec-web.md` → `prd_slug = create-invoice`
98
98
 
99
- All sibling artifacts of one feature (PRD, every platform's BDD, the BE + FE tech-docs, the design-spec, and the trace TSV) therefore resolve to the **same `prd_slug`** — so a synthesized **system** BDD or **system/BE** tech-doc lands in the same `{specs_dir}/{domain}/{prd-slug}/` package as the web/app artifacts it was derived from.
99
+ Mọi artifact cùng cấp của một feature (PRD, BDD của từng platform, tech-docs BE + FE, design-spec, trace TSV) đều phân giải về **cùng một `prd_slug`** — nên một BDD **system** hay tech-doc **system/BE** được tổng hợp sẽ nằm chung package `{specs_dir}/{domain}/{prd-slug}/` với các artifact web/app được suy ra từ đó.
100
100
 
101
- If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
101
+ Nếu `tech_stack.module` được đặt, đồng thời nạp `.agent/modules/{module}/stack-profile.yaml` nếu file tồn tại.
102
102
 
103
103
  ---
104
104
 
105
- ## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
105
+ ## Bước 1.5 — [SERVICE ROUTING] Phân giải path service (chế độ umbrella)
106
106
 
107
- *Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
107
+ *Bỏ qua hoàn toàn bước này nếu `setup.mode` không phải `"umbrella"` không có section `services` trong project-context.yaml.*
108
108
 
109
- If `services` section is present:
109
+ Nếu section `services`:
110
110
 
111
- **1. Detect active domain** (in priority order):
112
- - Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
113
- - Extract from target file path: `domain` = the first segment after the `specs_dir` base path; `prd_slug` = the next segment (the feature-package folder). This holds for any target depth see the `prd_slug` extraction rule in Step 1.
114
- *(e.g., `specs/user/create-account/prd.md` **and** `specs/user/create-account/bdd/system/UC1.feature` both → domain = `user`, prd_slug = `create-account`)*
115
- - If `$ARGUMENTS` contains a path, extract the domain segment after `specs_dir`
111
+ **1. Phát hiện active domain** (theo thứ tự ưu tiên):
112
+ - Đọc `@trace.domain` từ frontmatter của target file (nếu Gate đã nạp một target file)
113
+ - Trích xuất từ path target file: `domain` = segment đầu tiên sau base path `specs_dir`; `prd_slug` = segment kế tiếp (folder feature-package). Điều này đúng mọi độ sâu target — xem quy tắc trích xuất `prd_slug` Bước 1.
114
+ *(vd: `specs/user/create-account/prd.md` **và** `specs/user/create-account/bdd/system/UC1.feature` đều → domain = `user`, prd_slug = `create-account`)*
115
+ - Nếu `$ARGUMENTS` chứa một path, trích xuất segment domain sau `specs_dir`
116
116
 
117
- **2. Route to service** — if active domain matches a key in `services`:
118
- - Override `paths.specs_dir` → `services.{domain}.specs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, ALL BDD (web/app/**system**) is a shared cross-team artifact leave `specs_dir` for step 4 to route to the spec repo; do NOT pin it per-service here.
119
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
120
- - Store `active_service` = `services.{domain}.path`
121
- - Store `active_service_module` = `services.{domain}.module`
122
- - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
117
+ **2. Route tới service** — nếu active domain khớp với một key trong `services`:
118
+ - Override `paths.specs_dir` → `services.{domain}.specs_dir` — **chỉ khi `setup.spec_source` KHÔNG được đặt.** Khi `spec_source` ĐƯỢC đặt, MỌI BDD (web/app/**system**) artifact dùng chung liên team → để bước 4 route sang spec repo; KHÔNG pin theo service ở đây.
119
+ - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **chỉ khi `setup.spec_source` KHÔNG được đặt.** Khi `spec_source` ĐƯỢC đặt, tech-design (API contract) artifact liên team phải nằm trong spec repo dùng chung (xử bước 4), nên để bước 4 route `tech_docs_dir` KHÔNG pin theo service ở đây.
120
+ - Lưu `active_service` = `services.{domain}.path`
121
+ - Lưu `active_service_module` = `services.{domain}.module`
122
+ - Nếu service `module` riêng dùng làm `active_module` (override `tech_stack.module`)
123
123
 
124
- **3. Fallback** — if domain not detected or no matching service key:
125
- - Keep default paths from Step 1
126
- - Set `active_service = unresolved`
124
+ **3. Fallback** — nếu không phát hiện được domain hoặc không có service key khớp:
125
+ - Giữ path mặc định từ Bước 1
126
+ - Đặt `active_service = unresolved`
127
127
 
128
- **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
129
- - Override `paths.specs_dir` → `{spec_source}/specs` — **always when `spec_source` is set.** All spec artifacts (PRD, BDD, tech-docs, design-spec) live under the unified spec root in the shared spec repo using the feature-package layout: `{spec_source}/specs/{domain}/{prd-slug}/`. Every umbrella (FE/App/BE) reads from here. *(Per-service `specs/` only when there is no `spec_source`.)*
130
- - Override `paths.tech_docs_dir` → `{spec_source}/specs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). Tech-docs live at `{spec_source}/specs/{domain}/{prd-slug}/tech-docs/`. The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
128
+ **4. Tự động override theo spec source** — nếu `setup.spec_source` được đặt path tương ứng chưa được set tường minh trong `paths:`:
129
+ - Override `paths.specs_dir` → `{spec_source}/specs` — **luôn khi `spec_source` được đặt.** Mọi spec artifact (PRD, BDD, tech-docs, design-spec) nằm dưới gốc spec thống nhất trong spec repo dùng chung theo bố cục feature-package: `{spec_source}/specs/{domain}/{prd-slug}/`. Mọi umbrella (FE/App/BE) đều đọc từ đây. *(`specs/` theo service chỉ khi không `spec_source`.)*
130
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs` — **luôn khi `spec_source` được đặt** (bước 2 không còn pin tech-docs theo service trong trường hợp này). Tech-docs nằm tại `{spec_source}/specs/{domain}/{prd-slug}/tech-docs/`. Tech-design CHÍNH API contract liên team: BE viết đây, FE/App đọc từ cùng spec submodule tại `/generate-code --phase=integration`. *(tech-docs theo service chỉ xảy ra khi không có `spec_source` — repo BE thuần đa-service không spec module dùng chung.)*
131
131
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
132
132
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
133
133
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
134
134
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
135
135
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
136
136
  - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
137
- - Override `paths.trace_dir` → `{spec_source}/.trace` — **always when `spec_source` is set.** Trace TSVs are consolidated in the spec repo (single authoritative location, no per-service split) so the PM/PO has one place to manage status. Internal structure: `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`. Code-side commands (`/generate-code`, `/dev-run-test`, `/qc-run-test`) run from `service_root` but **write their trace row into `{spec_source}/.trace/{domain}/{prd-slug}/`** — like they already push `feedback/` there. *(Per-service `.trace` only when there is no `spec_source`.)*
137
+ - Override `paths.trace_dir` → `{spec_source}/.trace` — **luôn khi `spec_source` được đặt.** Trace TSV được gộp vào spec repo (một nơi authoritative duy nhất, không tách theo service) để PM/PO một chỗ duy nhất quản lý trạng thái. Cấu trúc bên trong: `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`. Các lệnh phía code (`/generate-code`, `/dev-run-test`, `/qc-run-test`) chạy từ `service_root` nhưng **ghi trace row của chúng vào `{spec_source}/.trace/{domain}/{prd-slug}/`** — giống như chúng đã push `feedback/` vào đó. *(`.trace` theo service chỉ khi không `spec_source`.)*
138
138
 
139
- > **Why under `spec_source`:** PRD, BDD, tech-docs, design-spec, domain knowledge, tester feedback, **and the `.trace/` coverage state** are all **cross-team artifacts** — they live in the **shared spec repo** using the feature-package layout so every umbrella (FE/App/BE) and the PM read one source via `/sync`. In the feature-package layout, a single `specs/{domain}/{prd-slug}/` folder groups all artifact types for one PRD, making the spec repo self-contained and navigable by feature. The service submodule holds only **code** (+ build/test tooling). `.trace/` and `feedback/` are the dev/QC **write areas** in the spec repo. In single-service mode (no `spec_source`), everything defaults under the repo root still one repo.
139
+ > ** sao đặt dưới `spec_source`:** PRD, BDD, tech-docs, design-spec, domain knowledge, feedback của tester, ** trạng thái coverage `.trace/`** đều **artifact liên team** — chúng nằm trong **spec repo dùng chung** theo bố cục feature-package để mọi umbrella (FE/App/BE) PM đọc từ một nguồn qua `/sync`. Trong bố cục feature-package, một folder `specs/{domain}/{prd-slug}/` gom tất cả loại artifact của một PRD, giúp spec repo tự đủ dễ điều hướng theo feature. Service submodule chỉ chứa **code** (+ tooling build/test). `.trace/` `feedback/` khu vực **ghi** của dev/QC trong spec repo. chế độ single-service (không `spec_source`), mọi thứ mặc định dưới gốc repo — vẫn một repo.
140
140
 
141
141
  ---
142
142
 
143
- ## Step 1.6 — [SERVICE CONVENTIONS] Load service-specific conventions (umbrella mode)
143
+ ## Bước 1.6 — [SERVICE CONVENTIONS] Nạp convention riêng của service (chế độ umbrella)
144
144
 
145
- *Skip this step entirely if `active_service` is `"unresolved"` or context is single-service mode.*
145
+ *Bỏ qua hoàn toàn bước này nếu `active_service` `"unresolved"` hoặc context chế độ single-service.*
146
146
 
147
- When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-service/`):
147
+ Khi `active_service` đã được phân giải thành một path thật Bước 1.5 (vd: `user-service/`):
148
148
 
149
- **1. Locate service config** — try in priority order:
149
+ **1. Định vị config của service** — thử theo thứ tự ưu tiên:
150
150
  - `{active_service}/.agent/project-context.yaml`
151
151
  - `{active_service}/project-context.yaml`
152
152
 
153
- **2. If found, override with service-specific values:**
153
+ **2. Nếu tìm thấy, override bằng giá trị riêng của service:**
154
154
 
155
- | Variable | Source |
155
+ | Biến | Nguồn |
156
156
  |----------|--------|
157
- | `conventions.test_command` | service's `conventions.test_command` |
158
- | `conventions.build_command` | service's `conventions.build_command` |
159
- | `paths.trace_dir` | **If `spec_source` is setkeep the Step 4 spec-repo route (`{spec_source}/.trace`); ignore any service-level `trace_dir`.** Only when there is no `spec_source`: `{active_service}/{service paths.trace_dir}` (default `{active_service}/.trace`). |
160
- | `paths.specs_dir` | **If `spec_source` is setkeep the Step 4 spec-repo route (`{spec_source}/specs`); ignore any service-level `specs_dir`** (all spec artifacts are cross-team, never per-service in this mode). Only when there is no `spec_source`: `{active_service}/{service paths.specs_dir}` if set, else the Step 1.5 override. |
157
+ | `conventions.test_command` | `conventions.test_command` của service |
158
+ | `conventions.build_command` | `conventions.build_command` của service |
159
+ | `paths.trace_dir` | **Nếu `spec_source` được đặtgiữ route spec-repo của bước 4 (`{spec_source}/.trace`); bỏ qua mọi `trace_dir` cấp service.** Chỉ khi không `spec_source`: `{active_service}/{service paths.trace_dir}` (mặc định `{active_service}/.trace`). |
160
+ | `paths.specs_dir` | **Nếu `spec_source` được đặtgiữ route spec-repo của bước 4 (`{spec_source}/specs`); bỏ qua mọi `specs_dir` cấp service** (mọi spec artifact đều liên team, không bao giờ theo service chế độ này). Chỉ khi không `spec_source`: `{active_service}/{service paths.specs_dir}` nếu được set, else dùng override ở Bước 1.5. |
161
161
 
162
- **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
163
- - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
164
- - **Source/test files** are written relative to `service_root`; **trace TSVs** are written to `{paths.trace_dir}` (the spec repo when `spec_source` is seta cross-repo write, committed/pushed to the spec submodule like `feedback/`).
162
+ **3. Lưu** `service_root = {active_service}` làm mốc thư mục làm việc cho mọi lệnh phía sau:
163
+ - Các lệnh shell (`/dev-run-test`, `/dev-gen-test`) chạy **bên trong** `service_root`
164
+ - **File source/test** được ghi tương đối với `service_root`; **trace TSV** được ghi vào `{paths.trace_dir}` ( spec repo khi `spec_source` được đặtmột thao tác ghi liên-repo, commit/push vào spec submodule giống như `feedback/`).
165
165
 
166
- **4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
166
+ **4. Nếu không tìm thấy config của service** — giữ mặc định umbrella, vẫn set `service_root = {active_service}` (luôn cần mốc path kể cả khi không config override).
167
167
 
168
168
  ---
169
169
 
170
- ## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
170
+ ## Bước 2 — [PROJECT-CONFIG] Nạp module stack profile (có điều kiện)
171
171
 
172
- If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
173
- Merge framework-specific conventions (layer patterns, test patterns, naming rules) into the loaded context.
174
- If the file does not existskip silently.
172
+ Nếu `tech_stack.module` được đặt, đọc `.agent/modules/{module}/stack-profile.yaml`.
173
+ Merge các convention riêng của framework (layer pattern, test pattern, quy tắc đặt tên) vào context đã nạp.
174
+ Nếu file không tồn tạibỏ qua âm thầm.
175
175
 
176
176
  ---
177
177
 
178
- ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
178
+ ## Bước 3 — [CRITICAL] Nạp CLAUDE.md (phân tầng: root + service overlay)
179
179
 
180
- *This is the highest-priority contextit defines HOW to write code and documents for this project.*
180
+ *Đây context ưu tiên cao nhất định nghĩa CÁCH viết code tài liệu cho dự án này.*
181
181
 
182
- CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
183
- architecture/coding standards compose correctly. The agent always sits at the umbrella
184
- root, but the implementation code lives in a service submodule with its OWN stack,
185
- architecture, and conventions — so the service's CLAUDE.md must win for code generation.
182
+ CLAUDE.md được nạp theo **hai tầng** để các quy tắc toàn-umbrella kiến trúc/coding standards
183
+ riêng của service kết hợp đúng cách. Agent luôn đứng gốc umbrella, nhưng code triển khai nằm
184
+ trong một service submodule với stack, kiến trúc, convention RIÊNG của — nên CLAUDE.md của
185
+ service phải thắng khi sinh code.
186
186
 
187
- **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
188
- Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
189
- whole umbrella git conventions, data-protection posture, cross-cutting rules, and (in
190
- single-service mode) the project's only architecture + coding standards.
187
+ **Tầng 1 — [BASE] Root CLAUDE.md (toàn umbrella).**
188
+ Đọc `CLAUDE.md` gốc repo. Coi nội dung của **nền tảng dùng chung** cho cả umbrella —
189
+ git convention, thế bảo vệ dữ liệu, quy tắc xuyên suốt, (ở chế độ single-service) là
190
+ kiến trúc + coding standards duy nhất của dự án.
191
191
 
192
- **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
193
- *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
194
- Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
195
- the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
196
- Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
197
- coding standards, and error handling. Layer-1 values that the service does not redefine
198
- (e.g. git conventions, banned patterns shared org-wide) remain in effect.
192
+ **Tầng 2 — [OVERLAY] Service CLAUDE.md (chỉ chế độ umbrella).**
193
+ *Chỉ chạy nếu `service_root` đã được set Bước 1.6 (tức đã route tới một service thật).*
194
+ Đọc `{service_root}/CLAUDE.md`. File này định nghĩa kiến trúc + coding standards của **stack
195
+ thực sự đang được triển khai** (vd: `user-service` = java-spring, `web` = nextjs).
196
+ Overlay lên trên Tầng 1: **khi xung đột, giá trị của service THẮNG** cho kiến trúc,
197
+ coding standards, error handling. Các giá trị Tầng 1 mà service không định nghĩa lại
198
+ (vd: git convention, banned pattern dùng chung toàn tổ chức) vẫn hiệu lực.
199
199
 
200
- From the **merged** result, extract and store:
200
+ Từ kết quả **đã merge**, trích xuất và lưu:
201
201
 
202
- - **§1 Project Overview** → project name, language, framework, build/test commands, domains
203
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
204
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
205
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
206
- - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
202
+ - **§1 Project Overview** → tên dự án, ngôn ngữ, framework, lệnh build/test, domains
203
+ - **§2 Architecture** → thứ tự layer (vd: Controller → Facade → Service → Repository), quy tắc kiến trúc — *service overlay thắng*
204
+ - **§3 Coding Standards** → quy tắc đặt tên (class, method), kiểu response wrapper, pattern bị cấm — *service overlay thắng*
205
+ - **§5 Error Handling** → kiểu exception, mapping HTTP status code, tên class not-found exception — *service overlay thắng*
206
+ - **§7 Git Conventions** → pattern đặt tên branch, format commit message — *lấy theo root trừ khi service định nghĩa lại*
207
207
 
208
- **Resolution rules:**
209
- - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
210
- - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
211
- - If `service_root` is set but `{service_root}/CLAUDE.md` is **missing** → fall back to root CLAUDE.md and flag ⚠️ in the Step 7 recap (the service has no architecture/coding-standards definition — code generation will use umbrella defaults, which may be the wrong stack).
212
- - If neither existsnote CLAUDE.md as missing and continue with project-context.yaml data only.
208
+ **Quy tắc phân giải:**
209
+ - Nếu cả hai tầng tồn tại → merge như trên; ghi `claude_md_source = root + {service_root}`.
210
+ - Nếu chỉ service overlay (không root CLAUDE.md) → dùng file service một mình; `claude_md_source = {service_root}`.
211
+ - Nếu `service_root` được set nhưng `{service_root}/CLAUDE.md` **thiếu** → fallback về root CLAUDE.md gắn cờ ⚠️ trong recap Bước 7 (service không định nghĩa kiến trúc/coding-standards — việc sinh code sẽ dùng mặc định umbrella, thể sai stack).
212
+ - Nếu cả hai đều không tồn tại ghi nhận CLAUDE.md thiếu tiếp tục chỉ với dữ liệu từ project-context.yaml.
213
213
 
214
214
  ---
215
215
 
216
- ## Step 4 — [SAFETY] Load Data Protection Rules
216
+ ## Bước 4 — [SAFETY] Nạp quy tắc bảo vệ dữ liệu
217
217
 
218
- Read `.agent/rules/data-protection.md` (or `rules/data-protection.md` from the framework installation).
218
+ Đọc `.agent/rules/data-protection.md` (hoặc `rules/data-protection.md` từ bản cài đặt framework).
219
219
 
220
- Store the sensitive file patternsyou must **never** read, write, display, or reference content from files matching those patterns for the entire session.
220
+ Lưu các pattern file nhạy cảm bạn **tuyệt đối không** đọc, ghi, hiển thị, hay tham chiếu nội dung từ các file khớp những pattern đó trong suốt cả phiên.
221
221
 
222
- If neither file existsapply built-in defaults: never access `.env*`, `*.key`, `*.pem`, `*secret*`, `*password*`, `*credential*`.
222
+ Nếu cả hai file đều không tồn tại áp dụng mặc định built-in: không bao giờ truy cập `.env*`, `*.key`, `*.pem`, `*secret*`, `*password*`, `*credential*`.
223
223
 
224
224
  ---
225
225
 
226
- ## Step 5 — [DOMAIN] Load Business Dictionary (conditional)
226
+ ## Bước 5 — [DOMAIN] Nạp Business Dictionary (có điều kiện)
227
227
 
228
- Check if the business dictionary file exists (use `paths.business_dictionary` resolved in Step 1).
228
+ Kiểm tra file business dictionary tồn tại không (dùng `paths.business_dictionary` đã phân giải ở Bước 1).
229
229
 
230
- If it exists, read it and extract:
231
- - **Canonical Terms** → complete list of approved terms and their definitions
232
- - **Banned Terms** → complete list of banned terms and their canonical replacements
233
- - **Status / Enum Registry** → allowed enum values per entity
230
+ Nếu tồn tại, đọc trích xuất:
231
+ - **Canonical Terms** → danh sách đầy đủ các thuật ngữ chuẩn và định nghĩa
232
+ - **Banned Terms** → danh sách đầy đủ các thuật ngữ bị cấm và bản thay thế chuẩn
233
+ - **Status / Enum Registry** → các giá trị enum được phép theo từng entity
234
234
 
235
- Store the banned terms list for **active enforcement** throughout the command session:
236
- - When generating any text (PRD, BDD, code comments, tech docs), verify no banned terms appear
237
- - Replace banned terms with their canonical equivalents automatically
235
+ Lưu danh sách banned term để **thực thi chủ động** suốt phiên làm việc của lệnh:
236
+ - Khi sinh bất kỳ văn bản nào (PRD, BDD, comment code, tech docs), kiểm tra không có banned term nào xuất hiện
237
+ - Tự động thay banned term bằng bản chuẩn tương đương
238
238
 
239
- If the file does not existskip silently. Do not warn or block.
239
+ Nếu file không tồn tạibỏ qua âm thầm. Không cảnh báo hay chặn.
240
240
 
241
241
  ---
242
242
 
243
- ## Step 6 — [DOMAIN] Load Core Entities (conditional)
243
+ ## Bước 6 — [DOMAIN] Nạp Core Entities (có điều kiện)
244
244
 
245
- Check if the core entities file exists at `paths.core_entities` (resolved in Step 1).
246
- Default path: `specs/domain-knowledge/core-entities.md`.
245
+ Kiểm tra file core entities tồn tại tại `paths.core_entities` không (đã phân giải ở Bước 1).
246
+ Path mặc định: `specs/domain-knowledge/core-entities.md`.
247
247
 
248
- If it exists, read it and store:
249
- - **Entity catalog** → for each entity: its name, purpose, owner service, key fields (name + type), business invariants, and relationships
250
- - **Field name registry** → canonical field names to use in generated code and documents
251
- - **Relationship map** → how entities relate to each other (1:N, N:N, embedded, etc.)
248
+ Nếu tồn tại, đọc lưu:
249
+ - **Entity catalog** → với mỗi entity: tên, mục đích, service sở hữu, các field chính (tên + kiểu), business invariant, quan hệ
250
+ - **Field name registry** → tên field chuẩn dùng trong code tài liệu được sinh ra
251
+ - **Relationship map** → cách các entity liên hệ với nhau (1:N, N:N, embedded, v.v.)
252
252
 
253
- **How to use this catalog:**
254
- - When generating code: use the field names, types, and relationships defined heredo NOT infer from existing code
255
- - When generating PRD/BDD: reference entity names from this catalog for consistency
256
- - When generating tech-docs: use this catalog as the source-of-truth for entity definitions
253
+ **Cách dùng catalog này:**
254
+ - Khi sinh code: dùng tên field, kiểu, quan hệ định nghĩa ở đây KHÔNG suy đoán từ code có sẵn
255
+ - Khi sinh PRD/BDD: tham chiếu tên entity từ catalog này để nhất quán
256
+ - Khi sinh tech-docs: dùng catalog này làm nguồn chân lý cho định nghĩa entity
257
257
 
258
- If the file does not existskip silently.
258
+ Nếu file không tồn tạibỏ qua âm thầm.
259
259
 
260
260
  ---
261
261
 
262
- ## Step 6.5 — [PLATFORM] Derive active_module and platform_type
262
+ ## Bước 6.5 — [PLATFORM] Suy ra active_module platform_type
263
263
 
264
- Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
264
+ Dùng `tech_stack.module` đã nạp Bước 1, suy ra lưu hai biến để mọi lệnh phía sau dùng:
265
265
 
266
266
  ```
267
- active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
267
+ active_module = tech_stack.module (vd: "java-spring", "react", "flutter")
268
268
  ```
269
269
 
270
270
  | `platform_type` | Modules |
@@ -273,88 +273,88 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
273
273
  | `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
274
274
  | `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
275
275
 
276
- If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
276
+ Nếu `tech_stack.module` rỗng hoặc không nhận diện được → set `platform_type = "unknown"` gắn cờ ⚠️ trong recap Bước 7.
277
277
 
278
- These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (dev-gen-test, debug, fix-bug, dev-smoke-test).
278
+ Hai biến này (`active_module`, `platform_type`) nguồn chuẩn cho mọi logic rẽ nhánh trong các lệnh cần hành vi riêng theo platform (dev-gen-test, debug, fix-bug, dev-smoke-test).
279
279
 
280
280
  ---
281
281
 
282
- ## Step 6.7 — [GUARDRAILS] Load Project Lessons (conditional)
282
+ ## Bước 6.7 — [GUARDRAILS] Nạp Project Lessons (có điều kiện)
283
283
 
284
- *Accumulated mistakes the AI must not repeat in this project. These are added over time via `/learn`
285
- or accepted during `/review-code`, `/fix-bug`, `/debug`.*
284
+ *Các lỗi tích luỹ mà AI không được lặp lại trong dự án này. Chúng được bổ sung dần qua `/learn`
285
+ hoặc được chấp nhận trong `/review-code`, `/fix-bug`, `/debug`.*
286
286
 
287
- Resolve the lessons file path:
288
- - Use `paths.lessons_file` if set (may be service-overridden in umbrella mode, Step 1.6)
289
- - Else default `specs/domain-knowledge/lessons-learned.md`
290
- - In umbrella/service mode (when `service_root` is set), if `paths.lessons_file` is unset, default to `{service_root}/.agent/project-lessons.md`
287
+ Phân giải path file lessons:
288
+ - Dùng `paths.lessons_file` nếu được set ( thể bị service override ở chế độ umbrella, Bước 1.6)
289
+ - Else mặc định `specs/domain-knowledge/lessons-learned.md`
290
+ - chế độ umbrella/service (khi `service_root` được set), nếu `paths.lessons_file` chưa set, mặc định `{service_root}/.agent/project-lessons.md`
291
291
 
292
- If the file exists, read it and store ALL lessons as **ACTIVE GUARDRAILS** for the session:
293
- - Treat each lesson's **Rule** as a hard constraintsame priority as CLAUDE.md coding standards (Step 3).
294
- - Before generating or modifying any artifact (PRD, BDD, tech-doc, code, test), check the output against every lesson whose `category` matches the current command AND whose `scope` matches the target (domain / file).
295
- - If a generated output would violate a lesson → correct it **before** presenting, and note which lesson (`L-NNN`) was applied.
292
+ Nếu file tồn tại, đọc lưu TẤT CẢ lesson làm **GUARDRAIL ĐANG HOẠT ĐỘNG** cho phiên:
293
+ - Coi **Rule** của mỗi lesson ràng buộc cứng cùng mức ưu tiên với coding standards trong CLAUDE.md (Bước 3).
294
+ - Trước khi sinh hoặc sửa bất kỳ artifact nào (PRD, BDD, tech-doc, code, test), đối chiếu output với mọi lesson `category` khớp lệnh hiện tại `scope` khớp target (domain / file).
295
+ - Nếu output sinh ra vi phạm một lesson → sửa **trước khi** trình bày, ghi lesson nào (`L-NNN`) đã được áp dụng.
296
296
 
297
- If the file does not existskip silently (no lessons captured yet).
297
+ Nếu file không tồn tạibỏ qua âm thầm (chưa lesson nào được ghi nhận).
298
298
 
299
299
  ---
300
300
 
301
- ## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
301
+ ## Bước 7 — [RECAP] Working Memory Recap (chống lost-in-middle)
302
302
 
303
- After loading all context, synthesize and output a compact summary block.
304
- This recap ensures the most critical facts are stated at the END of context loading
305
- (recency effect freshest in working memory when the task begins).
303
+ Sau khi nạp toàn bộ context, tổng hợp xuất một khối tóm tắt gọn.
304
+ Recap này đảm bảo các sự thật quan trọng nhất được nêu CUỐI quá trình nạp context
305
+ (hiệu ứng recency — tươi mới nhất trong bộ nhớ làm việc khi bắt đầu task).
306
306
 
307
- Output exactly this block:
307
+ Xuất đúng khối này:
308
308
  ```
309
309
  [CTX LOADED]
310
310
  Stack : {language} / {framework} / {database}
311
311
  Platform : {active_module} ({platform_type})
312
- Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
313
- CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSINGusing root | missing}
312
+ Layers : {thứ tự layer từ CLAUDE.md §2 đã merge, vd: Controller → Facade → Service → Repository}
313
+ CLAUDE.md : {root + {service_root} | chỉ {service_root} | chỉ root | ⚠️ service overlay THIẾUdùng root | missing}
314
314
  Ticket : {ticket_prefix}-
315
315
  Dict : {loaded — N canonical terms, M banned terms | missing}
316
316
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
317
- Lessons : {loaded — N guardrails | none yet}
317
+ Lessons : {loaded — N guardrails | chưa }
318
318
  Service : {active_service} ({active_service_module}) | single-service
319
- Svc Root : {service_root} — conventions + trace_dir loaded from service config | —
320
- Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
319
+ Svc Root : {service_root} — đã nạp conventions + trace_dir từ config service | —
320
+ Status : {FULL | PARTIAL — thiếu: CLAUDE.md / business-dict / core-entities | MINIMAL}
321
321
  ```
322
322
 
323
- If any CRITICAL file is missing (CLAUDE.md), flag it clearly so the user can decide whether to proceed.
323
+ Nếu bất kỳ file CRITICAL nào thiếu (CLAUDE.md), gắn cờ ràng để người dùng quyết định tiếp tục hay không.
324
324
 
325
325
  ---
326
326
 
327
- ## Context Load Complete
327
+ ## Hoàn tất nạp Context
328
328
 
329
- After completing all steps, you have loaded:
330
- - Project identity, tech stack, module conventions
331
- - Architecture rules and layer order ← **[CRITICAL — hold in working memory]**
332
- - Coding standards and naming conventions ← **[CRITICAL — hold in working memory]**
333
- - Data protection rules (sensitive file patterns to never access)
334
- - Terminology rules with banned-term list ← **[DOMAIN — apply to every generated word]**
335
- - Entity catalog (field names, types, invariants) ← **[DOMAIN — use for code generation]**
336
- - All configured paths
329
+ Sau khi hoàn thành tất cả các bước, bạn đã nạp:
330
+ - Định danh dự án, tech stack, convention module
331
+ - Quy tắc kiến trúc và thứ tự layer ← **[CRITICAL — giữ trong bộ nhớ làm việc]**
332
+ - Coding standards quy tắc đặt tên ← **[CRITICAL — giữ trong bộ nhớ làm việc]**
333
+ - Quy tắc bảo vệ dữ liệu (pattern file nhạy cảm không bao giờ truy cập)
334
+ - Quy tắc thuật ngữ kèm danh sách banned term ← **[DOMAIN — áp dụng cho mọi từ được sinh ra]**
335
+ - Entity catalog (tên field, kiểu, invariant) ← **[DOMAIN — dùng khi sinh code]**
336
+ - Toàn bộ path đã cấu hình
337
337
 
338
- Proceed to the next step of the calling command.
338
+ Tiếp tục sang bước kế tiếp của lệnh đang gọi.
339
339
 
340
340
 
341
- Trace through layers (from CLAUDE.md architecture):
342
- 1. Identify the service/module from the failing endpoint/feature
343
- 2. Read relevant code files, layer by layer
344
- 3. Match against common bug patterns:
341
+ Trace qua các layer (từ kiến trúc CLAUDE.md):
342
+ 1. Xác định service/module từ endpoint/feature đang lỗi
343
+ 2. Đọc các file code liên quan, từng layer
344
+ 3. Đối chiếu với các bug pattern thường gặp:
345
345
 
346
- | Bug Type | Common Location | How to Check |
346
+ | Bug Type | Vị trí thường gặp | Cách kiểm tra |
347
347
  |----------|----------------|--------------|
348
- | Wrong response data | Data mapping layer | Check field mapping, DTO conversions |
349
- | 400 Bad Request | Input validation | Check DTO constraints, required fields |
350
- | 403 Forbidden | Auth configuration | Check role-based access rules |
351
- | 404 Not Found | Repository query | Check find method, ID types |
352
- | Slow query / N+1 | Data access layer | Check for missing JOIN FETCH or batch loading |
353
- | Null Pointer | Missing null checks, optional not handled | Check Optional.orElseThrow usage |
354
- | Transaction rollback | Missing/wrong transaction scope | Check @Transactional on service methods |
355
- | Stale cache | Missing cache eviction after write | Check cache invalidation on write operations |
356
- | Type mismatch in query | Filter/specification code | Check field types in query predicates |
357
- | Cross-service timeout | External service call | Check URL config, fallback behavior |
348
+ | Wrong response data | Data mapping layer | Kiểm tra field mapping, DTO conversion |
349
+ | 400 Bad Request | Input validation | Kiểm tra DTO constraint, field bắt buộc |
350
+ | 403 Forbidden | Auth configuration | Kiểm tra rule role-based access |
351
+ | 404 Not Found | Repository query | Kiểm tra find method, kiểu ID |
352
+ | Slow query / N+1 | Data access layer | Kiểm tra thiếu JOIN FETCH hoặc batch loading |
353
+ | Null Pointer | Thiếu null check, Optional chưa xử | Kiểm tra dùng Optional.orElseThrow |
354
+ | Transaction rollback | Thiếu/sai transaction scope | Kiểm tra @Transactional trên service method |
355
+ | Stale cache | Thiếu cache eviction sau write | Kiểm tra cache invalidation khi write |
356
+ | Type mismatch in query | Code filter/specification | Kiểm tra kiểu field trong query predicate |
357
+ | Cross-service timeout | Lời gọi external service | Kiểm tra URL config, hành vi fallback |
358
358
 
359
359
  **CHECKPOINT — Root Cause Report:**
360
360
 
@@ -376,7 +376,7 @@ Regression risk: Low / Medium / High
376
376
  Proceed with fix? (Y/N)
377
377
  ```
378
378
 
379
- Wait for user confirmation.
379
+ Chờ user xác nhận.
380
380
 
381
381
  ### Phase 3 — Implement Fix
382
382
 
@@ -384,9 +384,9 @@ Wait for user confirmation.
384
384
  git checkout -b fix/{TICKET_ID}-{short-description}
385
385
  ```
386
386
 
387
- Apply the fix exactly as analyzed. Follow CLAUDE.md coding standards — do not introduce new violations.
387
+ Áp dụng fix đúng như đã phân tích. Theo coding standards CLAUDE.md đừng đưa thêm vi phạm mới.
388
388
 
389
- Add traceability annotation if the file has `@trace.implements`:
389
+ Thêm annotation traceability nếu file `@trace.implements`:
390
390
  ```
391
391
  // @trace.implements={UC-ID}-SC{N}
392
392
  // @trace.fixes={TICKET_ID}
@@ -395,7 +395,7 @@ Add traceability annotation if the file has `@trace.implements`:
395
395
 
396
396
  ### Phase 4 — Regression Test
397
397
 
398
- Generate a regression test if one doesn't exist:
398
+ Sinh một regression test nếu chưa có:
399
399
  ```
400
400
  // @trace.verifies={UC-ID}
401
401
  // @trace.regression={TICKET_ID}
@@ -404,9 +404,9 @@ Test: "Regression {TICKET_ID}: {bug description}"
404
404
  → Assert the fix works correctly
405
405
  ```
406
406
 
407
- Run the test: `{TEST_COMMAND_FOR_CLASS}`
407
+ Chạy test: `{TEST_COMMAND_FOR_CLASS}`
408
408
 
409
- If test fails → debug and fix (max 3 iterations).
409
+ Nếu test fail → debug fix (tối đa 3 vòng).
410
410
 
411
411
  ### Phase 5 — Build Verify
412
412
 
@@ -441,38 +441,38 @@ git push -u origin fix/{TICKET_ID}-{slug}
441
441
  fix/{TICKET_ID}-{slug}
442
442
  ```
443
443
 
444
- # Report Footer — Standard Command Output Format
444
+ # Report Footer — Định dạng output chuẩn cho mọi lệnh
445
445
 
446
- Every command report must end with this standard footer section.
446
+ Mọi report của lệnh phải kết thúc bằng section footer chuẩn này.
447
447
 
448
448
  ## Status Badge
449
449
 
450
- Choose one based on outcome:
451
- - `✅ Complete` — all steps succeeded, no issues found
452
- - `❌ Failed` — command could not complete due to a blocking error
453
- - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
450
+ Chọn một theo kết quả:
451
+ - `✅ Complete` — mọi bước thành công, không vấn đề
452
+ - `❌ Failed` — lệnh không hoàn thành được do lỗi chặn
453
+ - `⚠️ Warnings` — hoàn thành nhưng vấn đề không chặn, nên review lại
454
454
 
455
455
  ## Output Artifacts
456
456
 
457
- List every file created or modified by this command:
457
+ Liệt mọi file được tạo hoặc sửa bởi lệnh này:
458
458
  ```
459
459
  Output Artifacts:
460
- {created|updated} {file-path} ({brief description})
461
- {created|updated} {file-path} ({brief description})
460
+ {created|updated} {file-path} ({ tả ngắn})
461
+ {created|updated} {file-path} ({ tả ngắn})
462
462
  ```
463
463
 
464
- If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
464
+ Nếu không ghi file nào (vd: lệnh review hoặc phân tích) → ghi `Output Artifacts: none (read-only)`.
465
465
 
466
466
  ## Pipeline Position
467
467
 
468
- Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
469
- so the user always sees where this command sits in the end-to-end flow:
468
+ In một đồ pipeline một dòng, đánh dấu phase của lệnh HIỆN TẠI bằng `◀ bạn ở đây`,
469
+ để người dùng luôn thấy lệnh này nằm đâu trong luồng end-to-end:
470
470
 
471
471
  ```
472
472
  Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
473
473
  ```
474
474
 
475
- Find the current command in this phase legend and mark **its** phase in the map above:
475
+ Tìm lệnh hiện tại trong bảng phase dưới đây đánh dấu **phase của nó** trong sơ đồ trên:
476
476
 
477
477
  | Phase | Commands |
478
478
  |-------|----------|
@@ -486,82 +486,82 @@ Find the current command in this phase legend and mark **its** phase in the map
486
486
  | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
487
487
  | Trace Audit | `/validate-traces` |
488
488
 
489
- For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
489
+ Với **lệnh review**, thêm vòng review 3 bước đánh dấu bước hiện tại, vd:
490
490
  `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
491
491
 
492
- **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
493
- `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline
494
- **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
492
+ **Lệnh xuyên suốt** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
493
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) nằm ngoài pipeline tuyến tính
494
+ **bỏ hẳn dòng Pipeline** cho các lệnh này (đừng cố nhét chúng vào đồ).
495
495
 
496
- ## Next Command Suggestion
496
+ ## Gợi ý lệnh tiếp theo
497
497
 
498
- Suggest the logical next command based on workflow phase:
498
+ Gợi ý lệnh kế tiếp hợp theo phase của workflow:
499
499
 
500
- | Current command | Suggest next |
500
+ | Lệnh hiện tại | Gợi ý lệnh tiếp theo |
501
501
  |-------------------------|-----------------------------------------------|
502
- | /setup-ai-first | `/define-product` to start your first feature |
502
+ | /setup-ai-first | `/define-product` để bắt đầu feature đầu tiên |
503
503
  | /define-product | `/generate-prd {product-definition-file}` |
504
- | /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
505
- | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
506
- | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
507
- | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
508
- | /generate-bdd | `/review-context {feature-file}` to verify coverage |
509
- | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
510
- | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
504
+ | /generate-prd | `/refine-prd {prd-file}` rồi `/review-context {prd-file}` |
505
+ | /refine-prd | Mở Review Board → cập nhật PRD → `/review-context {prd-file}` |
506
+ | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (rồi BDD sau khi sign-off); BE: `/generate-bdd {prd-file}` trực tiếp; sửa PRD nếu NEEDS_FIX |
507
+ | /generate-design-spec | Designer review → xác nhận link Figma → PO + Designer sign-off → `/generate-bdd {prd-file}` |
508
+ | /generate-bdd | `/review-context {feature-file}` để kiểm tra độ phủ |
509
+ | /review-context (BDD) | `/generate-tech-docs {UC-ID}` nếu APPROVED; sinh lại nếu NEEDS_FIX |
510
+ | /qc-analyze | `/qc-plan {UC-ID}` (xử các gap blocker 🔴 trước) |
511
511
  | /qc-plan | `/qc-design-test {UC-ID}` |
512
- | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
513
- | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
514
- | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
515
- | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
516
- | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
512
+ | /qc-design-test | `/qc-review {UC-ID}` (review test-case) |
513
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` nếu APPROVED; sửa TC nếu NEEDS_FIX |
514
+ | /qc-run-test | `/qc-report {UC-ID}` rồi `/qc-review {UC-ID}` (review script) |
515
+ | /qc-review (script) | `/qc-report {UC-ID}` rồi tạo PR nếu APPROVED |
516
+ | /qc-report | `/validate-traces {UC-ID}` để làm mới Living Docs (qc_status) |
517
517
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
518
- | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
519
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
518
+ | /review-tech-docs | `/generate-code {feature-file}` nếu APPROVED; sửa doc nếu NEEDS_FIX |
519
+ | /generate-code | Lần gen đầu → `/review-code {UC-ID}`; gen lại → `/dev-gen-test {UC-ID}` |
520
520
  | /dev-gen-test | `/dev-run-test {UC-ID}` |
521
521
  | /dev-run-test (passing) | `/review-code {UC-ID}` |
522
- | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
523
- | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
524
- | /dev-smoke-test | Create PR and link to ticket |
525
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
526
- | /fix-bug | Create PR and link to ticket |
527
- | /debug | `/fix-bug {ticket-id}` if fix needed |
528
- | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
529
- | /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
530
- | /learn | Continue working — lesson applies on next command |
531
- | /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
532
- | /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
533
-
534
- Format the footer as:
522
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` hoặc `/debug {error}` |
523
+ | /review-code | `/dev-smoke-test {UC-ID}` hoặc tạo PR |
524
+ | /dev-smoke-test | Tạo PR link tới ticket |
525
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; tất cả OK → tạo PR |
526
+ | /fix-bug | Tạo PR link tới ticket |
527
+ | /debug | `/fix-bug {ticket-id}` nếu cần sửa |
528
+ | /report-bug | Gửi cho dev (`/fix-bug {BUG-ID}`); nếu thiếu coverage → `/propose-scenario {UC-ID}` |
529
+ | /propose-scenario | Báo PO/Dev review proposal trong `feedback/bdd-proposals/` |
530
+ | /learn | Tiếp tục làm việc — lesson áp dụng lệnh kế tiếp |
531
+ | /sync | `/validate-traces` để xem độ phủ đầy đủ; xử lý mọi `📥 tester feedback` được nêu |
532
+ | /update-framework | Review `git diff .agent/`, commit; `/sync` để đồng bộ nội dung dự án |
533
+
534
+ Định dạng footer như sau:
535
535
  ```
536
536
  ---
537
537
  Status : {badge}
538
- {Output Artifacts block}
538
+ {khối Output Artifacts}
539
539
  Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
540
- (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
541
- Next : {suggested command with example arguments}
540
+ (lệnh review) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
541
+ Next : {lệnh gợi ý kèm ví dụ tham số}
542
542
  ```
543
- *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
543
+ *(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
544
544
 
545
545
 
546
546
  ---
547
547
 
548
548
  ## /debug — Quick Debug Analysis
549
549
 
550
- Use when: IDE shows an error, test fails unexpectedly, behavior is strange, or you need to understand why code does something.
550
+ Dùng khi: IDE hiện lỗi, test fail bất ngờ, hành vi lạ, hoặc bạn cần hiểu sao code làm gì đó.
551
551
 
552
- **Different from `/fix-bug`**: This is analysis only, no full workflow, no ticket required.
552
+ **Khác `/fix-bug`**: Đây chỉ phân tích, không full workflow, không cần ticket.
553
553
 
554
554
  ### Input
555
555
 
556
- Paste one of:
556
+ Dán một trong:
557
557
  1. Stack trace / error log
558
- 2. Test failure output
559
- 3. File path + description of unexpected behavior
560
- 4. A specific question about a code snippet
558
+ 2. Output test fail
559
+ 3. File path + tả hành vi bất ngờ
560
+ 4. Một câu hỏi cụ thể về code snippet
561
561
 
562
562
  ### Stack Trace Analysis
563
563
 
564
- Read stack trace from **bottom up** — the `Caused by:` line is the real root cause.
564
+ Đọc stack trace từ **dưới lên** — dòng `Caused by:` root cause thật.
565
565
 
566
566
  ```
567
567
  Caused by: {RealException} ← start here
@@ -572,18 +572,18 @@ Caused by: {RealException} ← start here
572
572
 
573
573
  ### Common Error Patterns
574
574
 
575
- | Error | Likely Cause | Fix Direction |
575
+ | Error | Nguyên nhân khả nghi | Hướng fix |
576
576
  |-------|-------------|---------------|
577
- | NullPointerException | Accessing field on null object; Optional not handled | Check Optional.orElseThrow, null guards |
578
- | ClassCastException | Wrong type assumption; incorrect generic usage | Check type at assignment/return point |
579
- | OutOfMemoryError | Loading too much data; memory leak | Add pagination, check collection sizes |
580
- | StackOverflowError | Infinite recursion | Find recursive call with no base case |
581
- | Connection refused | Dependency service not running | Check config URLs, start dependent service |
582
- | Authentication/401 | Token expired, wrong config, missing header | Verify token, check auth config |
583
- | Permission denied/403 | Wrong role in request or misconfigured access rules | Check auth annotations and role config |
584
- | Database constraint violation | Duplicate key, missing FK, null in NOT NULL column | Check data and constraint definitions |
585
- | Serialization error | Circular reference, unmapped field | Check DTO/mapper configuration |
586
- | Test assertion mismatch | Wrong mock setup or wrong expected value | Re-read mock setup and assertion logic |
577
+ | NullPointerException | Truy cập field trên object null; Optional chưa xử | Kiểm tra Optional.orElseThrow, null guard |
578
+ | ClassCastException | Giả định sai kiểu; dùng generic không đúng | Kiểm tra type điểm assignment/return |
579
+ | OutOfMemoryError | Load quá nhiều data; memory leak | Thêm pagination, kiểm tra kích thước collection |
580
+ | StackOverflowError | Đệ quy vô hạn | Tìm recursive call không base case |
581
+ | Connection refused | Dependency service chưa chạy | Kiểm tra config URL, khởi động service phụ thuộc |
582
+ | Authentication/401 | Token hết hạn, sai config, thiếu header | Verify token, kiểm tra auth config |
583
+ | Permission denied/403 | Sai role trong request hoặc access rule cấu hình sai | Kiểm tra auth annotation role config |
584
+ | Database constraint violation | Trùng key, thiếu FK, null trong cột NOT NULL | Kiểm tra data định nghĩa constraint |
585
+ | Serialization error | Circular reference, field chưa map | Kiểm tra config DTO/mapper |
586
+ | Test assertion mismatch | Sai mock setup hoặc sai giá trị expected | Đọc lại mock setup logic assertion |
587
587
 
588
588
  ### Test Failure Analysis
589
589
 
@@ -593,10 +593,10 @@ Actual : {actual value}
593
593
  at {test class}.{method}(line {N})
594
594
  ```
595
595
 
596
- 1. What is the gap between Expected and Actual?
597
- 2. Trace to the exact test line
598
- 3. Is the mock setup correct? (`given(...).willReturn(...)`)
599
- 4. Is the assertion logically correct?
596
+ 1. Gap giữa Expected Actual gì?
597
+ 2. Trace tới đúng dòng test
598
+ 3. Mock setup đúng chưa? (`given(...).willReturn(...)`)
599
+ 4. Assertion đúng logic không?
600
600
 
601
601
  ### Output
602
602
 
@@ -625,38 +625,38 @@ See CLAUDE.md §{section} — {section name}
625
625
  - Just needed analysis → done here
626
626
  ```
627
627
 
628
- # Report Footer — Standard Command Output Format
628
+ # Report Footer — Định dạng output chuẩn cho mọi lệnh
629
629
 
630
- Every command report must end with this standard footer section.
630
+ Mọi report của lệnh phải kết thúc bằng section footer chuẩn này.
631
631
 
632
632
  ## Status Badge
633
633
 
634
- Choose one based on outcome:
635
- - `✅ Complete` — all steps succeeded, no issues found
636
- - `❌ Failed` — command could not complete due to a blocking error
637
- - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
634
+ Chọn một theo kết quả:
635
+ - `✅ Complete` — mọi bước thành công, không vấn đề
636
+ - `❌ Failed` — lệnh không hoàn thành được do lỗi chặn
637
+ - `⚠️ Warnings` — hoàn thành nhưng vấn đề không chặn, nên review lại
638
638
 
639
639
  ## Output Artifacts
640
640
 
641
- List every file created or modified by this command:
641
+ Liệt mọi file được tạo hoặc sửa bởi lệnh này:
642
642
  ```
643
643
  Output Artifacts:
644
- {created|updated} {file-path} ({brief description})
645
- {created|updated} {file-path} ({brief description})
644
+ {created|updated} {file-path} ({ tả ngắn})
645
+ {created|updated} {file-path} ({ tả ngắn})
646
646
  ```
647
647
 
648
- If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
648
+ Nếu không ghi file nào (vd: lệnh review hoặc phân tích) → ghi `Output Artifacts: none (read-only)`.
649
649
 
650
650
  ## Pipeline Position
651
651
 
652
- Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
653
- so the user always sees where this command sits in the end-to-end flow:
652
+ In một đồ pipeline một dòng, đánh dấu phase của lệnh HIỆN TẠI bằng `◀ bạn ở đây`,
653
+ để người dùng luôn thấy lệnh này nằm đâu trong luồng end-to-end:
654
654
 
655
655
  ```
656
656
  Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
657
657
  ```
658
658
 
659
- Find the current command in this phase legend and mark **its** phase in the map above:
659
+ Tìm lệnh hiện tại trong bảng phase dưới đây đánh dấu **phase của nó** trong sơ đồ trên:
660
660
 
661
661
  | Phase | Commands |
662
662
  |-------|----------|
@@ -670,79 +670,79 @@ Find the current command in this phase legend and mark **its** phase in the map
670
670
  | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
671
671
  | Trace Audit | `/validate-traces` |
672
672
 
673
- For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
673
+ Với **lệnh review**, thêm vòng review 3 bước đánh dấu bước hiện tại, vd:
674
674
  `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
675
675
 
676
- **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
677
- `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline
678
- **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
676
+ **Lệnh xuyên suốt** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
677
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) nằm ngoài pipeline tuyến tính
678
+ **bỏ hẳn dòng Pipeline** cho các lệnh này (đừng cố nhét chúng vào đồ).
679
679
 
680
- ## Next Command Suggestion
680
+ ## Gợi ý lệnh tiếp theo
681
681
 
682
- Suggest the logical next command based on workflow phase:
682
+ Gợi ý lệnh kế tiếp hợp theo phase của workflow:
683
683
 
684
- | Current command | Suggest next |
684
+ | Lệnh hiện tại | Gợi ý lệnh tiếp theo |
685
685
  |-------------------------|-----------------------------------------------|
686
- | /setup-ai-first | `/define-product` to start your first feature |
686
+ | /setup-ai-first | `/define-product` để bắt đầu feature đầu tiên |
687
687
  | /define-product | `/generate-prd {product-definition-file}` |
688
- | /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
689
- | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
690
- | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
691
- | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
692
- | /generate-bdd | `/review-context {feature-file}` to verify coverage |
693
- | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
694
- | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
688
+ | /generate-prd | `/refine-prd {prd-file}` rồi `/review-context {prd-file}` |
689
+ | /refine-prd | Mở Review Board → cập nhật PRD → `/review-context {prd-file}` |
690
+ | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (rồi BDD sau khi sign-off); BE: `/generate-bdd {prd-file}` trực tiếp; sửa PRD nếu NEEDS_FIX |
691
+ | /generate-design-spec | Designer review → xác nhận link Figma → PO + Designer sign-off → `/generate-bdd {prd-file}` |
692
+ | /generate-bdd | `/review-context {feature-file}` để kiểm tra độ phủ |
693
+ | /review-context (BDD) | `/generate-tech-docs {UC-ID}` nếu APPROVED; sinh lại nếu NEEDS_FIX |
694
+ | /qc-analyze | `/qc-plan {UC-ID}` (xử các gap blocker 🔴 trước) |
695
695
  | /qc-plan | `/qc-design-test {UC-ID}` |
696
- | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
697
- | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
698
- | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
699
- | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
700
- | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
696
+ | /qc-design-test | `/qc-review {UC-ID}` (review test-case) |
697
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` nếu APPROVED; sửa TC nếu NEEDS_FIX |
698
+ | /qc-run-test | `/qc-report {UC-ID}` rồi `/qc-review {UC-ID}` (review script) |
699
+ | /qc-review (script) | `/qc-report {UC-ID}` rồi tạo PR nếu APPROVED |
700
+ | /qc-report | `/validate-traces {UC-ID}` để làm mới Living Docs (qc_status) |
701
701
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
702
- | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
703
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
702
+ | /review-tech-docs | `/generate-code {feature-file}` nếu APPROVED; sửa doc nếu NEEDS_FIX |
703
+ | /generate-code | Lần gen đầu → `/review-code {UC-ID}`; gen lại → `/dev-gen-test {UC-ID}` |
704
704
  | /dev-gen-test | `/dev-run-test {UC-ID}` |
705
705
  | /dev-run-test (passing) | `/review-code {UC-ID}` |
706
- | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
707
- | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
708
- | /dev-smoke-test | Create PR and link to ticket |
709
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
710
- | /fix-bug | Create PR and link to ticket |
711
- | /debug | `/fix-bug {ticket-id}` if fix needed |
712
- | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
713
- | /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
714
- | /learn | Continue working — lesson applies on next command |
715
- | /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
716
- | /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
717
-
718
- Format the footer as:
706
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` hoặc `/debug {error}` |
707
+ | /review-code | `/dev-smoke-test {UC-ID}` hoặc tạo PR |
708
+ | /dev-smoke-test | Tạo PR link tới ticket |
709
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; tất cả OK → tạo PR |
710
+ | /fix-bug | Tạo PR link tới ticket |
711
+ | /debug | `/fix-bug {ticket-id}` nếu cần sửa |
712
+ | /report-bug | Gửi cho dev (`/fix-bug {BUG-ID}`); nếu thiếu coverage → `/propose-scenario {UC-ID}` |
713
+ | /propose-scenario | Báo PO/Dev review proposal trong `feedback/bdd-proposals/` |
714
+ | /learn | Tiếp tục làm việc — lesson áp dụng lệnh kế tiếp |
715
+ | /sync | `/validate-traces` để xem độ phủ đầy đủ; xử lý mọi `📥 tester feedback` được nêu |
716
+ | /update-framework | Review `git diff .agent/`, commit; `/sync` để đồng bộ nội dung dự án |
717
+
718
+ Định dạng footer như sau:
719
719
  ```
720
720
  ---
721
721
  Status : {badge}
722
- {Output Artifacts block}
722
+ {khối Output Artifacts}
723
723
  Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
724
- (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
725
- Next : {suggested command with example arguments}
724
+ (lệnh review) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
725
+ Next : {lệnh gợi ý kèm ví dụ tham số}
726
726
  ```
727
- *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
727
+ *(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
728
728
 
729
729
 
730
730
  ---
731
731
 
732
732
  ## /validate-traces — Traceability Coverage Matrix
733
733
 
734
- Read-only check of coverage between specs, code, and tests.
734
+ Check read-only độ phủ giữa spec, code, test.
735
735
 
736
736
  ### Input
737
737
 
738
- Accept: domain name or specific UC-ID.
738
+ Nhận: tên domain hoặc UC-ID cụ thể.
739
739
 
740
740
  ### Process
741
741
 
742
- 1. **Read .feature files** → collect all SC-IDs for the domain/UC
743
- 2. **Scan controller files** → find `@trace.implements` tags
744
- 3. **Scan test files** → find `@trace.verifies` tags
745
- 4. **Read `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`** → check for drift (scenario text changed since last code gen)
742
+ 1. **Đọc file .feature** → gom tất cả SC-ID cho domain/UC
743
+ 2. **Quét file controller** → tìm tag `@trace.implements`
744
+ 3. **Quét file test** → tìm tag `@trace.verifies`
745
+ 4. **Đọc `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`** → check drift (text scenario đổi từ lần gen code trước)
746
746
 
747
747
  ### Output
748
748
 
@@ -766,38 +766,38 @@ Recommendations:
766
766
  - Re-run /generate-code {UC-ID} for drifted scenarios
767
767
  ```
768
768
 
769
- # Report Footer — Standard Command Output Format
769
+ # Report Footer — Định dạng output chuẩn cho mọi lệnh
770
770
 
771
- Every command report must end with this standard footer section.
771
+ Mọi report của lệnh phải kết thúc bằng section footer chuẩn này.
772
772
 
773
773
  ## Status Badge
774
774
 
775
- Choose one based on outcome:
776
- - `✅ Complete` — all steps succeeded, no issues found
777
- - `❌ Failed` — command could not complete due to a blocking error
778
- - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
775
+ Chọn một theo kết quả:
776
+ - `✅ Complete` — mọi bước thành công, không vấn đề
777
+ - `❌ Failed` — lệnh không hoàn thành được do lỗi chặn
778
+ - `⚠️ Warnings` — hoàn thành nhưng vấn đề không chặn, nên review lại
779
779
 
780
780
  ## Output Artifacts
781
781
 
782
- List every file created or modified by this command:
782
+ Liệt mọi file được tạo hoặc sửa bởi lệnh này:
783
783
  ```
784
784
  Output Artifacts:
785
- {created|updated} {file-path} ({brief description})
786
- {created|updated} {file-path} ({brief description})
785
+ {created|updated} {file-path} ({ tả ngắn})
786
+ {created|updated} {file-path} ({ tả ngắn})
787
787
  ```
788
788
 
789
- If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
789
+ Nếu không ghi file nào (vd: lệnh review hoặc phân tích) → ghi `Output Artifacts: none (read-only)`.
790
790
 
791
791
  ## Pipeline Position
792
792
 
793
- Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
794
- so the user always sees where this command sits in the end-to-end flow:
793
+ In một đồ pipeline một dòng, đánh dấu phase của lệnh HIỆN TẠI bằng `◀ bạn ở đây`,
794
+ để người dùng luôn thấy lệnh này nằm đâu trong luồng end-to-end:
795
795
 
796
796
  ```
797
797
  Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
798
798
  ```
799
799
 
800
- Find the current command in this phase legend and mark **its** phase in the map above:
800
+ Tìm lệnh hiện tại trong bảng phase dưới đây đánh dấu **phase của nó** trong sơ đồ trên:
801
801
 
802
802
  | Phase | Commands |
803
803
  |-------|----------|
@@ -811,59 +811,59 @@ Find the current command in this phase legend and mark **its** phase in the map
811
811
  | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
812
812
  | Trace Audit | `/validate-traces` |
813
813
 
814
- For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
814
+ Với **lệnh review**, thêm vòng review 3 bước đánh dấu bước hiện tại, vd:
815
815
  `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
816
816
 
817
- **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
818
- `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline
819
- **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
817
+ **Lệnh xuyên suốt** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
818
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) nằm ngoài pipeline tuyến tính
819
+ **bỏ hẳn dòng Pipeline** cho các lệnh này (đừng cố nhét chúng vào đồ).
820
820
 
821
- ## Next Command Suggestion
821
+ ## Gợi ý lệnh tiếp theo
822
822
 
823
- Suggest the logical next command based on workflow phase:
823
+ Gợi ý lệnh kế tiếp hợp theo phase của workflow:
824
824
 
825
- | Current command | Suggest next |
825
+ | Lệnh hiện tại | Gợi ý lệnh tiếp theo |
826
826
  |-------------------------|-----------------------------------------------|
827
- | /setup-ai-first | `/define-product` to start your first feature |
827
+ | /setup-ai-first | `/define-product` để bắt đầu feature đầu tiên |
828
828
  | /define-product | `/generate-prd {product-definition-file}` |
829
- | /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
830
- | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
831
- | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
832
- | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
833
- | /generate-bdd | `/review-context {feature-file}` to verify coverage |
834
- | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
835
- | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
829
+ | /generate-prd | `/refine-prd {prd-file}` rồi `/review-context {prd-file}` |
830
+ | /refine-prd | Mở Review Board → cập nhật PRD → `/review-context {prd-file}` |
831
+ | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (rồi BDD sau khi sign-off); BE: `/generate-bdd {prd-file}` trực tiếp; sửa PRD nếu NEEDS_FIX |
832
+ | /generate-design-spec | Designer review → xác nhận link Figma → PO + Designer sign-off → `/generate-bdd {prd-file}` |
833
+ | /generate-bdd | `/review-context {feature-file}` để kiểm tra độ phủ |
834
+ | /review-context (BDD) | `/generate-tech-docs {UC-ID}` nếu APPROVED; sinh lại nếu NEEDS_FIX |
835
+ | /qc-analyze | `/qc-plan {UC-ID}` (xử các gap blocker 🔴 trước) |
836
836
  | /qc-plan | `/qc-design-test {UC-ID}` |
837
- | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
838
- | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
839
- | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
840
- | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
841
- | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
837
+ | /qc-design-test | `/qc-review {UC-ID}` (review test-case) |
838
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` nếu APPROVED; sửa TC nếu NEEDS_FIX |
839
+ | /qc-run-test | `/qc-report {UC-ID}` rồi `/qc-review {UC-ID}` (review script) |
840
+ | /qc-review (script) | `/qc-report {UC-ID}` rồi tạo PR nếu APPROVED |
841
+ | /qc-report | `/validate-traces {UC-ID}` để làm mới Living Docs (qc_status) |
842
842
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
843
- | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
844
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
843
+ | /review-tech-docs | `/generate-code {feature-file}` nếu APPROVED; sửa doc nếu NEEDS_FIX |
844
+ | /generate-code | Lần gen đầu → `/review-code {UC-ID}`; gen lại → `/dev-gen-test {UC-ID}` |
845
845
  | /dev-gen-test | `/dev-run-test {UC-ID}` |
846
846
  | /dev-run-test (passing) | `/review-code {UC-ID}` |
847
- | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
848
- | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
849
- | /dev-smoke-test | Create PR and link to ticket |
850
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
851
- | /fix-bug | Create PR and link to ticket |
852
- | /debug | `/fix-bug {ticket-id}` if fix needed |
853
- | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
854
- | /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
855
- | /learn | Continue working — lesson applies on next command |
856
- | /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
857
- | /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
858
-
859
- Format the footer as:
847
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` hoặc `/debug {error}` |
848
+ | /review-code | `/dev-smoke-test {UC-ID}` hoặc tạo PR |
849
+ | /dev-smoke-test | Tạo PR link tới ticket |
850
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; tất cả OK → tạo PR |
851
+ | /fix-bug | Tạo PR link tới ticket |
852
+ | /debug | `/fix-bug {ticket-id}` nếu cần sửa |
853
+ | /report-bug | Gửi cho dev (`/fix-bug {BUG-ID}`); nếu thiếu coverage → `/propose-scenario {UC-ID}` |
854
+ | /propose-scenario | Báo PO/Dev review proposal trong `feedback/bdd-proposals/` |
855
+ | /learn | Tiếp tục làm việc — lesson áp dụng lệnh kế tiếp |
856
+ | /sync | `/validate-traces` để xem độ phủ đầy đủ; xử lý mọi `📥 tester feedback` được nêu |
857
+ | /update-framework | Review `git diff .agent/`, commit; `/sync` để đồng bộ nội dung dự án |
858
+
859
+ Định dạng footer như sau:
860
860
  ```
861
861
  ---
862
862
  Status : {badge}
863
- {Output Artifacts block}
863
+ {khối Output Artifacts}
864
864
  Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
865
- (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
866
- Next : {suggested command with example arguments}
865
+ (lệnh review) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
866
+ Next : {lệnh gợi ý kèm ví dụ tham số}
867
867
  ```
868
- *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
868
+ *(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
869
869