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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/bin/index.js +12 -1
  2. package/commands/debug.md +436 -436
  3. package/commands/debug.tmpl +111 -111
  4. package/commands/define-product.md +350 -345
  5. package/commands/define-product.tmpl +69 -64
  6. package/commands/dev-gen-test.md +365 -365
  7. package/commands/dev-gen-test.tmpl +63 -63
  8. package/commands/dev-run-test.md +376 -376
  9. package/commands/dev-run-test.tmpl +74 -74
  10. package/commands/dev-smoke-test.md +341 -341
  11. package/commands/dev-smoke-test.tmpl +60 -60
  12. package/commands/fix-bug.md +403 -403
  13. package/commands/fix-bug.tmpl +78 -78
  14. package/commands/generate-bdd.md +513 -513
  15. package/commands/generate-bdd.tmpl +211 -211
  16. package/commands/generate-code.md +481 -483
  17. package/commands/generate-code.tmpl +179 -181
  18. package/commands/generate-design-spec.md +497 -497
  19. package/commands/generate-design-spec.tmpl +220 -220
  20. package/commands/generate-prd.md +452 -400
  21. package/commands/generate-prd.tmpl +50 -200
  22. package/commands/generate-spec-manifest.md +340 -340
  23. package/commands/generate-spec-manifest.tmpl +59 -59
  24. package/commands/generate-tech-docs.md +365 -365
  25. package/commands/generate-tech-docs.tmpl +84 -84
  26. package/commands/learn.md +347 -347
  27. package/commands/learn.tmpl +22 -22
  28. package/commands/map-testids.md +322 -322
  29. package/commands/map-testids.tmpl +41 -41
  30. package/commands/propose-scenario.md +335 -335
  31. package/commands/propose-scenario.tmpl +54 -54
  32. package/commands/qc-analyze.md +323 -324
  33. package/commands/qc-analyze.tmpl +42 -43
  34. package/commands/qc-design-test.md +304 -304
  35. package/commands/qc-design-test.tmpl +23 -23
  36. package/commands/qc-plan.md +297 -297
  37. package/commands/qc-plan.tmpl +16 -16
  38. package/commands/qc-report.md +302 -302
  39. package/commands/qc-report.tmpl +21 -21
  40. package/commands/qc-review.md +298 -298
  41. package/commands/qc-review.tmpl +17 -17
  42. package/commands/qc-run-test.md +337 -337
  43. package/commands/qc-run-test.tmpl +35 -35
  44. package/commands/refine-prd.md +428 -430
  45. package/commands/refine-prd.tmpl +62 -62
  46. package/commands/report-bug.md +351 -351
  47. package/commands/report-bug.tmpl +70 -70
  48. package/commands/review-code.md +364 -364
  49. package/commands/review-code.tmpl +39 -39
  50. package/commands/review-context.md +578 -580
  51. package/commands/review-context.tmpl +212 -212
  52. package/commands/review-tech-docs.md +427 -427
  53. package/commands/review-tech-docs.tmpl +146 -146
  54. package/commands/setup-ai-first.md +239 -239
  55. package/commands/setup-ai-first.tmpl +133 -133
  56. package/commands/sync.md +145 -145
  57. package/commands/sync.tmpl +93 -93
  58. package/commands/update-framework.md +88 -88
  59. package/commands/update-framework.tmpl +36 -36
  60. package/commands/validate-traces.md +381 -381
  61. package/commands/validate-traces.tmpl +100 -100
  62. package/core/FRAMEWORK_VERSION +1 -1
  63. package/core/commands/debug.md +436 -436
  64. package/core/commands/define-product.md +350 -345
  65. package/core/commands/dev-gen-test.md +365 -365
  66. package/core/commands/dev-run-test.md +376 -376
  67. package/core/commands/dev-smoke-test.md +341 -341
  68. package/core/commands/fix-bug.md +403 -403
  69. package/core/commands/generate-bdd.md +513 -513
  70. package/core/commands/generate-code.md +481 -483
  71. package/core/commands/generate-design-spec.md +497 -497
  72. package/core/commands/generate-prd.md +452 -400
  73. package/core/commands/generate-spec-manifest.md +340 -340
  74. package/core/commands/generate-tech-docs.md +365 -365
  75. package/core/commands/learn.md +347 -347
  76. package/core/commands/map-testids.md +322 -322
  77. package/core/commands/propose-scenario.md +335 -335
  78. package/core/commands/qc-analyze.md +323 -324
  79. package/core/commands/qc-design-test.md +304 -304
  80. package/core/commands/qc-plan.md +297 -297
  81. package/core/commands/qc-report.md +302 -302
  82. package/core/commands/qc-review.md +298 -298
  83. package/core/commands/qc-run-test.md +337 -337
  84. package/core/commands/refine-prd.md +428 -430
  85. package/core/commands/report-bug.md +351 -351
  86. package/core/commands/review-code.md +364 -364
  87. package/core/commands/review-context.md +578 -580
  88. package/core/commands/review-tech-docs.md +427 -427
  89. package/core/commands/setup-ai-first.md +239 -239
  90. package/core/commands/sync.md +145 -145
  91. package/core/commands/update-framework.md +88 -88
  92. package/core/commands/validate-traces.md +381 -381
  93. package/core/skills/code/SKILL.md +389 -389
  94. package/core/skills/debug/SKILL.md +391 -391
  95. package/core/skills/design-spec/SKILL.md +318 -318
  96. package/core/skills/discovery/SKILL.md +7 -547
  97. package/core/skills/prd/SKILL.md +298 -394
  98. package/core/skills/setup-ai-first/SKILL.md +80 -80
  99. package/core/skills/spec/SKILL.md +178 -178
  100. package/core/skills/test/SKILL.md +604 -604
  101. package/core/steps/capture-lesson.md +44 -44
  102. package/core/steps/context-loader.md +175 -175
  103. package/core/steps/gate.md +54 -54
  104. package/core/steps/report-footer.md +52 -52
  105. package/core/steps/review-fanout.md +85 -87
  106. package/core/steps/spawn-agent.md +45 -45
  107. package/core/steps/trace-mirror.md +21 -21
  108. package/core/templates/architecture.template.md +37 -37
  109. package/core/templates/design-spec.template.md +77 -77
  110. package/core/templates/platform-guide.template.md +47 -47
  111. package/core/templates/prd.template.md +107 -232
  112. package/core/templates/product-definition.template.md +101 -88
  113. package/core/templates/project-context.yaml +2 -2
  114. package/docs/01-getting-started/core-concepts.md +1 -1
  115. package/docs/01-getting-started/quickstart.md +7 -7
  116. package/docs/02-guides/developer/bdd-and-trace.md +1 -1
  117. package/docs/02-guides/developer/scenarios.md +5 -5
  118. package/docs/02-guides/product-owner/handoff-checklist.md +1 -1
  119. package/docs/02-guides/product-owner/scenarios.md +23 -23
  120. package/docs/02-guides/tester/bug-reporting.md +2 -2
  121. package/docs/02-guides/tester/reading-specs.md +2 -2
  122. package/docs/02-guides/tester/scenarios.md +1 -1
  123. package/docs/02-guides/tester/spec-manifest.md +3 -3
  124. package/docs/02-guides/tester/workflow.md +1 -1
  125. package/docs/03-concepts/architecture.md +3 -3
  126. package/docs/03-concepts/pipeline.md +3 -3
  127. package/docs/04-operations/publishing.md +20 -3
  128. package/docs/04-operations/sync-and-update.md +5 -5
  129. package/docs/05-reference/command-cheatsheet.md +2 -2
  130. package/docs/05-reference/commands.md +8 -8
  131. package/package.json +1 -1
  132. package/scripts/migrate-specs.js +5 -3
  133. package/scripts/rename-prd-files.js +174 -0
  134. package/skills/code/SKILL.md +389 -389
  135. package/skills/code/SKILL.tmpl +56 -56
  136. package/skills/debug/SKILL.md +391 -391
  137. package/skills/debug/SKILL.tmpl +60 -60
  138. package/skills/design-spec/SKILL.md +318 -318
  139. package/skills/design-spec/SKILL.tmpl +37 -37
  140. package/skills/discovery/SKILL.md +7 -547
  141. package/skills/discovery/SKILL.tmpl +7 -140
  142. package/skills/prd/SKILL.md +298 -394
  143. package/skills/prd/SKILL.tmpl +40 -151
  144. package/skills/setup-ai-first/SKILL.md +80 -80
  145. package/skills/setup-ai-first/SKILL.tmpl +28 -28
  146. package/skills/spec/SKILL.md +178 -178
  147. package/skills/spec/SKILL.tmpl +20 -20
  148. package/skills/test/SKILL.md +604 -604
  149. package/skills/test/SKILL.tmpl +44 -44
  150. package/steps/capture-lesson.md +44 -44
  151. package/steps/context-loader.md +175 -175
  152. package/steps/gate.md +54 -54
  153. package/steps/report-footer.md +52 -52
  154. package/steps/review-fanout.md +85 -87
  155. package/steps/spawn-agent.md +45 -45
  156. package/steps/trace-mirror.md +21 -21
  157. package/templates/architecture.template.md +37 -37
  158. package/templates/design-spec.template.md +77 -77
  159. package/templates/platform-guide.template.md +47 -47
  160. package/templates/prd.template.md +107 -232
  161. package/templates/product-definition.template.md +101 -88
  162. package/templates/project-context.yaml +2 -2
@@ -1,27 +1,27 @@
1
- # Sub-Agent Orchestration Pattern
1
+ # Pattern điều phối Sub-Agent
2
2
 
3
- Used by heavy commands when the target exceeds the complexity threshold.
4
- The main session becomes a **lightweight orchestrator**it only coordinates.
5
- Each unit of work runs in its own sub-agent with a fresh context window.
3
+ Dùng bởi các lệnh nặng khi target vượt ngưỡng phức tạp.
4
+ Session chính trở thành một **orchestrator nhẹ** chỉ điều phối.
5
+ Mỗi đơn vị công việc chạy trong sub-agent riêng với context window mới.
6
6
 
7
7
  ---
8
8
 
9
- ## Complexity Thresholds
9
+ ## Ngưỡng phức tạp
10
10
 
11
- | Signal | Threshold | Action |
11
+ | Tín hiệu | Ngưỡng | Hành động |
12
12
  |--------|-----------|--------|
13
- | UC count in PRD | > 3 UCs | spawn 1 agent per UC |
14
- | PRD length | > 300 lines | spawn agents regardless of UC count |
13
+ | Số UC trong PRD | > 3 UC | spawn 1 agent cho mỗi UC |
14
+ | Độ dài PRD | > 300 dòng | spawn agent bất kể số UC |
15
15
 
16
- If **either** threshold is exceededswitch to orchestration mode.
16
+ Nếu vượt **một trong hai** ngưỡngchuyển sang chế độ orchestration.
17
17
 
18
18
  ---
19
19
 
20
- ## Orchestrator Steps (main session)
20
+ ## Các bước của Orchestrator (session chính)
21
21
 
22
- ### Step A — Build slim context
22
+ ### Bước A — Dựng context gọn
23
23
 
24
- Extract only what sub-agents needdo NOT pass full CLAUDE.md or full business-dictionary:
24
+ Chỉ trích xuất những gì sub-agent cầnKHÔNG truyền nguyên CLAUDE.md hay nguyên business-dictionary:
25
25
 
26
26
  ```json
27
27
  {
@@ -43,49 +43,49 @@ Extract only what sub-agents need — do NOT pass full CLAUDE.md or full busines
43
43
  "trace_dir": "{paths.trace_dir}",
44
44
  "tech_docs_dir": "{paths.tech_docs_dir}"
45
45
  },
46
- "architecture_summary": "<3-5 bullet points: layer order + key rules only>",
46
+ "architecture_summary": "<3-5 gạch đầu dòng: thứ tự layer + quy tắc chính>",
47
47
  "domains": ["{domain1}", "{domain2}"],
48
48
  "banned_terms": ["{term1}", "{term2}"]
49
49
  }
50
50
  ```
51
51
 
52
- ### Step B — Extract UC list
52
+ ### Bước B — Trích danh sách UC
53
53
 
54
- Scan the target PRD for `#### {TICKET-ID}-UC{N}:` headings.
55
- Build list: `[ { uc_id, uc_name, line_start, line_end } ]`
54
+ Quét PRD target tìm các heading `#### {TICKET-ID}-UC{N}:`.
55
+ Dựng list: `[ { uc_id, uc_name, line_start, line_end } ]`
56
56
 
57
- ### Step C — Announce plan
57
+ ### Bước C — Công bố kế hoạch
58
58
 
59
59
  ```
60
- High complexity detected — {N} UCs / {L} lines in {prd_file}
61
- Spawning {N} sub-agents (1 per UC)...
62
- Agent 1 → {TICKET-ID}-UC1: {UC name}
63
- Agent 2 → {TICKET-ID}-UC2: {UC name}
60
+ Phát hiện độ phức tạp cao — {N} UC / {L} dòng trong {prd_file}
61
+ Đang spawn {N} sub-agent (1 cho mỗi UC)...
62
+ Agent 1 → {TICKET-ID}-UC1: {tên UC}
63
+ Agent 2 → {TICKET-ID}-UC2: {tên UC}
64
64
  ...
65
65
  ```
66
66
 
67
- ### Step D — Spawn one sub-agent per UC
67
+ ### Bước D — Spawn một sub-agent cho mỗi UC
68
68
 
69
- Build payload and invoke Agent tool for each UC:
69
+ Dựng payload gọi Agent tool cho từng UC:
70
70
 
71
71
  ```json
72
72
  {
73
73
  "_agent_mode": true,
74
74
  "command": "generate-bdd",
75
75
  "uc_id": "{TICKET-ID}-UC{N}",
76
- "target_file": "{absolute path to PRD or feature file}",
76
+ "target_file": "{đường dẫn tuyệt đối tới PRD hoặc feature file}",
77
77
  "uc_section": { "line_start": {N}, "line_end": {N} },
78
- "context": { "<slim context from Step A>" }
78
+ "context": { "<context gọn từ Bước A>" }
79
79
  }
80
80
  ```
81
81
 
82
- > **Command scope**: Only `/generate-bdd` initiates orchestration mode. `/generate-code` and `/dev-gen-test` can run as sub-agents (they respect `_agent_mode: true` from Gate Step 0), but they do not spawn further sub-agentstheir scope is already a single UC.
82
+ > **Phạm vi lệnh**: Chỉ `/generate-bdd` khởi động chế độ orchestration. `/generate-code` `/dev-gen-test` thể chạy như sub-agent (chúng tôn trọng `_agent_mode: true` từ Gate Bước 0), nhưng không spawn thêm sub-agentphạm vi của chúng vốn đã là một UC duy nhất.
83
83
 
84
- Serialize this JSON and pass as `$ARGUMENTS` when invoking the sub-agent command.
84
+ Serialize JSON này truyền làm `$ARGUMENTS` khi gọi lệnh sub-agent.
85
85
 
86
- ### Step E — Collect and merge results
86
+ ### Bước E — Thu thập merge kết quả
87
87
 
88
- Each sub-agent returns:
88
+ Mỗi sub-agent trả về:
89
89
  ```json
90
90
  {
91
91
  "uc_id": "{TICKET-ID}-UC{N}",
@@ -95,30 +95,30 @@ Each sub-agent returns:
95
95
  }
96
96
  ```
97
97
 
98
- Merge into a single report (follow report-footer.md format).
99
- If any sub-agent errorslist them clearly and suggest re-run for that UC only.
98
+ Merge vào một report duy nhất (theo định dạng report-footer.md).
99
+ Nếu sub-agent lỗiliệt ràng đề xuất chạy lại riêng UC đó.
100
100
 
101
101
  ---
102
102
 
103
- ## Sub-Agent Entry Point (called commands)
103
+ ## Điểm vào của Sub-Agent (các lệnh được gọi)
104
104
 
105
- When `gate.md Step 0` detects `_agent_mode: true`:
105
+ Khi `gate.md Bước 0` phát hiện `_agent_mode: true`:
106
106
 
107
- 1. Parse full payload from `$ARGUMENTS`
108
- 2. **Skip context-loader.md** — use `payload.context` directly
109
- 3. **Scope to `payload.uc_id` only** do not process other UCs in the file
110
- 4. Read only the PRD section between `payload.uc_section.line_start` and `line_end`
111
- 5. Execute the command's normal logic for this single UC
112
- 6. Return structured result JSON (Step E format above)
107
+ 1. Parse toàn bộ payload từ `$ARGUMENTS`
108
+ 2. **Bỏ qua context-loader.md** — dùng trực tiếp `payload.context`
109
+ 3. **Chỉ giới hạn ở `payload.uc_id`**không xử các UC khác trong file
110
+ 4. Chỉ đọc section PRD giữa `payload.uc_section.line_start` `line_end`
111
+ 5. Thực thi logic thường của lệnh cho riêng UC này
112
+ 6. Trả về JSON kết quả có cấu trúc (định dạng Bước E trên)
113
113
 
114
114
  ---
115
115
 
116
- ## Context Window Savings
116
+ ## Tiết kiệm Context Window
117
117
 
118
- | Mode | What loads per session |
118
+ | Chế độ | Nạp mỗi session |
119
119
  |------|------------------------|
120
- | Single session (≤ 3 UC) | Full context + full PRD + all UCs |
121
- | Orchestrator | Slim context + UC headings only |
122
- | Each sub-agent | Slim context + **1 UC section only** |
120
+ | Single session (≤ 3 UC) | Full context + full PRD + tất cả UC |
121
+ | Orchestrator | Context gọn + chỉ các heading UC |
122
+ | Mỗi sub-agent | Context gọn + **chỉ 1 section UC** |
123
123
 
124
- The larger the PRD, the bigger the saving per sub-agent.
124
+ PRD càng lớn, mức tiết kiệm trên mỗi sub-agent càng nhiều.
@@ -1,26 +1,26 @@
1
- # Refresh Living Docs panel mirror *(local, umbrella mode)*
1
+ # Làm mới panel mirror của Living Docs *(local, chế độ umbrella)*
2
2
 
3
- *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
4
- the repo's own `.trace/` IS the panel location, so nothing to mirror.*
3
+ *Bỏ qua hoàn toàn ở chế độ single-service (không `services` không `setup.spec_source`) — ở đó
4
+ `.trace/` của chính repo CHÍNH vị trí panel, nên không gì để mirror.*
5
5
 
6
- After updating the authoritative TSV(s) at `{paths.trace_dir}`:
6
+ Sau khi cập nhật TSV authoritative tại `{paths.trace_dir}`:
7
7
 
8
- **When `setup.spec_source` is set (consolidated trace — the common case):**
9
- `{paths.trace_dir}` resolves to `{spec_source}/.trace` — the single authoritative location.
10
- This command runs from `service_root`, so the write is **cross-repo into the spec submodule**;
11
- commit/push the spec submodule for the trace update (same as `feedback/`).
12
- 1. Resolve `panel_mirror = ./.trace` at the **current workspace root**.
13
- 2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
14
- just-updated `{UC-ID}.tsv` → `{panel_mirror}/{UC-ID}.tsv` (create the dir; overwrite).
15
- No per-service namespacing there is one trace set; the owning service is carried in each
16
- row's `@trace.service`.
8
+ **Khi `setup.spec_source` được đặt (trace gộp trường hợp phổ biến):**
9
+ `{paths.trace_dir}` phân giải về `{spec_source}/.trace` — vị trí authoritative duy nhất.
10
+ Lệnh này chạy từ `service_root`, nên thao tác ghi **liên-repo vào spec submodule**;
11
+ commit/push spec submodule cho lần cập nhật trace (giống như `feedback/`).
12
+ 1. Phân giải `panel_mirror = ./.trace` tại **gốc workspace hiện tại**.
13
+ 2. Nếu `panel_mirror` phân giải ra path khác với `{paths.trace_dir}`, copy mỗi
14
+ `{UC-ID}.tsv` vừa cập nhật → `{panel_mirror}/{UC-ID}.tsv` (tạo thư mục; ghi đè).
15
+ Không namespace theo service — chỉ một bộ trace; service sở hữu được mang trong
16
+ `@trace.service` của từng row.
17
17
 
18
- **Legacy (no `spec_source` — per-service trace):**
19
- Copy each just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
20
- (namespaced by `active_service`).
18
+ **Legacy (không `spec_source` — trace theo service):**
19
+ Copy mỗi `{UC-ID}.tsv` vừa cập nhật → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
20
+ (namespace theo `active_service`).
21
21
 
22
- This keeps the open workspace's Living Docs panel current **between syncs** — it is a
23
- **local convenience mirror only**. The merged `trace-report.json` (canonical, in
24
- `{spec_source}/.living-docs/`) is rebuilt by `/sync` or `/validate-traces`. For orchestrated
25
- commands, do this once in the orchestrator after all sub-agents returnnot inside each
26
- sub-agent.
22
+ Cách này giữ panel Living Docs của workspace đang mở luôn mới **giữa các lần sync** — chỉ
23
+ một **mirror tiện lợi cục bộ**. File `trace-report.json` đã merge (canonical, trong
24
+ `{spec_source}/.living-docs/`) được build lại bởi `/sync` hoặc `/validate-traces`. Với các lệnh
25
+ được orchestrate, làm việc này một lần trong orchestrator sau khi tất cả sub-agent trả về không phải
26
+ bên trong từng sub-agent.
@@ -1,56 +1,56 @@
1
1
  # §1. Project Overview
2
2
 
3
3
  Project : {{PROJECT_NAME}}
4
- Language : {{LANGUAGE}} # e.g., Java 17 / TypeScript / C# / Go
5
- Framework : {{FRAMEWORK}} # e.g., Spring Boot 3.2 / Angular 17 / .NET 8
6
- Build : {{BUILD_COMMAND}} # e.g., mvn clean install -DskipTests / dotnet build / ng build
7
- Test : {{TEST_COMMAND}} # e.g., mvn test / dotnet test / ng test
4
+ Language : {{LANGUAGE}} # vd: Java 17 / TypeScript / C# / Go
5
+ Framework : {{FRAMEWORK}} # vd: Spring Boot 3.2 / Angular 17 / .NET 8
6
+ Build : {{BUILD_COMMAND}} # vd: mvn clean install -DskipTests / dotnet build / ng build
7
+ Test : {{TEST_COMMAND}} # vd: mvn test / dotnet test / ng test
8
8
  Domains : {{COMMA_SEPARATED_DOMAINS}}
9
9
 
10
10
  # §2. Architecture
11
11
 
12
- style: "{{ARCH_STYLE}}" # e.g., Layered / Clean / Hexagonal / Component-based
12
+ style: "{{ARCH_STYLE}}" # vd: Layered / Clean / Hexagonal / Component-based
13
13
 
14
14
  layers: "{{LAYER_STACK}}"
15
- # Examples:
15
+ # Ví dụ:
16
16
  # Java/Spring: Controller → Facade → Service → Repository
17
17
  # .NET Clean: Presentation → Application → Domain → Infrastructure
18
18
  # Angular: Component → Service → HTTP Client → Backend API
19
19
  # Go: Handler → UseCase → Repository → Domain
20
20
 
21
21
  rules:
22
- - "{{ARCH_RULE_1}}" # e.g., Controllers must not contain business logic
23
- - "{{ARCH_RULE_2}}" # e.g., Services own transaction boundaries
24
- - "{{ARCH_RULE_3}}" # e.g., Repositories must not call services
22
+ - "{{ARCH_RULE_1}}" # vd: Controller không được chứa business logic
23
+ - "{{ARCH_RULE_2}}" # vd: Service sở hữu ranh giới transaction
24
+ - "{{ARCH_RULE_3}}" # vd: Repository không được gọi service
25
25
 
26
- # Layer dependency direction (inner layers must not depend on outer):
26
+ # Chiều phụ thuộc giữa các layer (layer trong không được phụ thuộc layer ngoài):
27
27
  # {{OUTER_LAYER}} → {{MIDDLE_LAYER}} → {{INNER_LAYER}}
28
28
 
29
29
  # §3. Coding Standards
30
30
 
31
31
  naming:
32
- classes: "{{CLASS_NAMING}}" # e.g., PascalCase / PascalCase+Suffix
33
- methods: "{{METHOD_NAMING}}" # e.g., camelCase / PascalCase
34
- packages: "{{PACKAGE_NAMING}}" # e.g., lowercase / lowercase.snake_case
35
- files: "{{FILE_NAMING}}" # e.g., PascalCase.java / kebab-case.ts
32
+ classes: "{{CLASS_NAMING}}" # vd: PascalCase / PascalCase+Suffix
33
+ methods: "{{METHOD_NAMING}}" # vd: camelCase / PascalCase
34
+ packages: "{{PACKAGE_NAMING}}" # vd: lowercase / lowercase.snake_case
35
+ files: "{{FILE_NAMING}}" # vd: PascalCase.java / kebab-case.ts
36
36
 
37
37
  patterns:
38
- response_wrapper: "{{RESPONSE_WRAPPER}}" # e.g., ApiResponse<T> / Result<T> / IActionResult
39
- mapping: "{{MAPPING_LIBRARY}}" # e.g., MapStruct / AutoMapper / manual
40
- exception_base: "{{BASE_EXCEPTION}}" # e.g., ResourceNotFoundException / DomainException
38
+ response_wrapper: "{{RESPONSE_WRAPPER}}" # vd: ApiResponse<T> / Result<T> / IActionResult
39
+ mapping: "{{MAPPING_LIBRARY}}" # vd: MapStruct / AutoMapper / manual
40
+ exception_base: "{{BASE_EXCEPTION}}" # vd: ResourceNotFoundException / DomainException
41
41
 
42
42
  forbidden:
43
- - "Magic numbersuse named constants"
44
- - "Debug print statements in production code"
43
+ - "Magic numberdùng hằng số có tên"
44
+ - "Lệnh debug print trong code production"
45
45
  - "{{PROJECT_SPECIFIC_FORBIDDEN_PATTERN}}"
46
46
 
47
47
  # §4. API Conventions
48
48
 
49
- versioning: "{{API_VERSIONING}}" # e.g., /v1/ prefix / header-based / query param
50
- auth: "{{AUTH_MECHANISM}}" # e.g., JWT Bearer / OAuth2 / API Key
49
+ versioning: "{{API_VERSIONING}}" # vd: tiền tố /v1/ / theo header / query param
50
+ auth: "{{AUTH_MECHANISM}}" # vd: JWT Bearer / OAuth2 / API Key
51
51
 
52
52
  http_status:
53
- get_list: 200 # paginated or full list
53
+ get_list: 200 # danh sách phân trang hoặc đầy đủ
54
54
  get_single: 200
55
55
  create: 201
56
56
  update: 200
@@ -70,32 +70,32 @@ error_response_format: |
70
70
 
71
71
  # §5. Error Handling
72
72
 
73
- not_found_exception: "{{NOT_FOUND_EXCEPTION_CLASS}}" # e.g., ResourceNotFoundException
74
- validation_exception: "{{VALIDATION_EXCEPTION_CLASS}}" # e.g., ValidationException
75
- domain_exception: "{{DOMAIN_EXCEPTION_CLASS}}" # e.g., DomainException / BusinessRuleViolationException
73
+ not_found_exception: "{{NOT_FOUND_EXCEPTION_CLASS}}" # vd: ResourceNotFoundException
74
+ validation_exception: "{{VALIDATION_EXCEPTION_CLASS}}" # vd: ValidationException
75
+ domain_exception: "{{DOMAIN_EXCEPTION_CLASS}}" # vd: DomainException / BusinessRuleViolationException
76
76
 
77
- global_handler: "{{GLOBAL_EXCEPTION_HANDLER}}" # e.g., @ControllerAdvice / ExceptionHandlerMiddleware
77
+ global_handler: "{{GLOBAL_EXCEPTION_HANDLER}}" # vd: @ControllerAdvice / ExceptionHandlerMiddleware
78
78
 
79
79
  rules:
80
- - "Never swallow exceptions silently"
81
- - "Log at error level with full stack trace for 5xx"
80
+ - "Không bao giờ nuốt exception âm thầm"
81
+ - "Log mức error kèm full stack trace cho lỗi 5xx"
82
82
  - "{{PROJECT_SPECIFIC_ERROR_RULE}}"
83
83
 
84
84
  # §6. Testing Standards
85
85
 
86
- unit_test_framework: "{{UNIT_TEST_FW}}" # e.g., JUnit 5 + Mockito / xUnit + Moq / Jest
87
- integration_test_framework: "{{IT_TEST_FW}}" # e.g., Spring Boot Test / WebApplicationFactory
86
+ unit_test_framework: "{{UNIT_TEST_FW}}" # vd: JUnit 5 + Mockito / xUnit + Moq / Jest
87
+ integration_test_framework: "{{IT_TEST_FW}}" # vd: Spring Boot Test / WebApplicationFactory
88
88
 
89
89
  coverage_targets:
90
- unit: "{{UNIT_COVERAGE_PCT}}%" # e.g., 80%
91
- integration: "{{IT_COVERAGE_PCT}}%" # e.g., key flows covered
90
+ unit: "{{UNIT_COVERAGE_PCT}}%" # vd: 80%
91
+ integration: "{{IT_COVERAGE_PCT}}%" # vd: phủ các flow chính
92
92
 
93
- naming_pattern: "{{TEST_METHOD_NAMING}}" # e.g., methodName_whenCondition_shouldExpectation
93
+ naming_pattern: "{{TEST_METHOD_NAMING}}" # vd: methodName_whenCondition_shouldExpectation
94
94
 
95
95
  rules:
96
- - "Unit tests mock direct dependencies only"
97
- - "Integration tests cover happy path + main error paths"
98
- - "Every scenario in .feature must have a corresponding test"
96
+ - "Unit test chỉ mock các dependency trực tiếp"
97
+ - "Integration test phủ happy path + các luồng lỗi chính"
98
+ - "Mọi scenario trong .feature phải test tương ứng"
99
99
 
100
100
  # §7. Git Conventions
101
101
 
@@ -110,4 +110,4 @@ commit_docs: "docs: {description}"
110
110
 
111
111
  pr_title: "{{TICKET_PREFIX}}-{N}: {feature name}"
112
112
  pr_requires_review: true
113
- pr_branch_protection: "{{BASE_BRANCH}}" # e.g., main / develop
113
+ pr_branch_protection: "{{BASE_BRANCH}}" # vd: main / develop
@@ -41,172 +41,172 @@
41
41
  | **Service** | {active_service} |
42
42
  | **Domain** | {domain} |
43
43
  | **Business PRD** | [{TICKET-ID}](./{TICKET-ID}-slug.md) |
44
- | **Figma** | {feature file link} ({linked}/{N} frames linked) |
45
- | **Author** | {PO name or "AI-assisted"} |
44
+ | **Figma** | {link file feature} ({linked}/{N} frame đã link) |
45
+ | **Author** | {tên PO hoặc "AI-assisted"} |
46
46
  | **Created** | {YYYY-MM-DD} |
47
47
  | **Updated** | {YYYY-MM-DD} |
48
48
 
49
49
  ---
50
50
 
51
- # 1. Screen Inventory
51
+ # 1. Danh mục màn hình (Screen Inventory)
52
52
 
53
- | # | Screen Name | Entry Point | Figma Frame (node-level link) | Notes |
53
+ | # | Tên màn hình | Điểm vào | Figma Frame (link node-level) | Ghi chú |
54
54
  |---|-------------|-------------|-------------------------------|-------|
55
- | 1 | {Screen 1} | {how user arrives} | [Frame]({node-level url}) | |
56
- | 2 | {Screen 2} | {entry point} | ❌ Missing — add node-id link | |
55
+ | 1 | {Màn hình 1} | {người dùng đến từ đâu} | [Frame]({node-level url}) | |
56
+ | 2 | {Màn hình 2} | {điểm vào} | ❌ Missing — thêm link node-id | |
57
57
 
58
58
  ---
59
59
 
60
- # 2. Screen Specs
60
+ # 2. Đặc tả màn hình (Screen Specs)
61
61
 
62
- ## Screen 1: {Screen Name}
62
+ ## Màn hình 1: {Tên màn hình}
63
63
 
64
- **Figma**: [{Frame name}]({figma_frame_url})
64
+ **Figma**: [{Tên frame}]({figma_frame_url})
65
65
 
66
66
  ### Layout
67
67
 
68
- {Grid / max-width / padding / spacing — reference design tokens where applicable}
68
+ {Grid / max-width / padding / spacing — tham chiếu design token nếu áp dụng được}
69
69
 
70
70
  ### Component Inventory
71
71
 
72
- | Component (Figma) | Code Component | Import Path | States | Notes |
72
+ | Component (Figma) | Code Component | Import Path | States | Ghi chú |
73
73
  |------------------------|----------------|------------------------|---------------------------------|---------|
74
74
  | {Figma/Button/Primary} | Button | @/components/ui/Button | default, loading, disabled | |
75
75
  | {Figma/Input/Text} | TextInput | @/components/ui/Input | default, focus, error, disabled | |
76
76
 
77
77
  ### Screen States
78
78
 
79
- | State | Trigger | UI Behavior |
79
+ | State | Trigger | Hành vi UI |
80
80
  |-----------|----------------------------------|----------------------------------------------------------|
81
- | default | Screen loaded, data available | {Describe full rendered appearance} |
82
- | loading | API call in flight | {Skeleton / spinner position and style} |
83
- | error | API failure / validation error | {Toast / inline error / error screen + recovery CTA} |
84
- | empty | No data returned | {Illustration + CTA — e.g., "No items yet. Add one →"} |
85
- | success | Action completed (if applicable) | {Confirmation toast / navigation / visual change} |
81
+ | default | Màn đã load, dữ liệu | { tả toàn bộ giao diện đã render} |
82
+ | loading | API đang gọi | {Vị trí kiểu skeleton / spinner} |
83
+ | error | API thất bại / lỗi validation | {Toast / lỗi inline / màn lỗi + CTA khôi phục} |
84
+ | empty | Không dữ liệu trả về | {Illustration + CTA — vd: "Chưa mục nào. Thêm mới →"} |
85
+ | success | Action hoàn tất (nếu ) | {Toast xác nhận / điều hướng / thay đổi giao diện} |
86
86
 
87
87
  ### Actions & Navigation
88
88
 
89
- | Action | Trigger | Result |
89
+ | Action | Trigger | Kết quả |
90
90
  |-----------------|---------------------------|---------------------------------------------------|
91
- | {Action name} | Tap/click {element} | Navigate to {Screen N} / Open {Modal name} |
92
- | {Back/Cancel} | Back gesture / button | Return to {previous screen} without saving |
91
+ | {Tên action} | Tap/click {phần tử} | Điều hướng tới {Màn hình N} / Mở {Tên modal} |
92
+ | {Back/Cancel} | Cử chỉ back / nút | Quay lại {màn trước} không lưu |
93
93
 
94
94
  ---
95
95
 
96
- <!-- Repeat ## Screen N for each additional screen -->
96
+ <!-- Lặp lại ## Màn hình N cho mỗi màn bổ sung -->
97
97
 
98
98
  ---
99
99
 
100
- # 3. Interaction Patterns
100
+ # 3. Pattern tương tác (Interaction Patterns)
101
101
 
102
- <!-- === WEB ONLY delete this section for app === -->
102
+ <!-- === CHỈ WEB — xóa section này cho app === -->
103
103
 
104
- ## A. Responsive Behavior *(web)*
104
+ ## A. Hành vi Responsive *(web)*
105
105
 
106
- | Breakpoint | Width | Layout Changes |
106
+ | Breakpoint | Width | Thay đổi layout |
107
107
  |------------|------------|---------------------------------------------|
108
- | Mobile | < 768px | {Single column, bottom nav, full-width CTA} |
109
- | Tablet | 768–1279px | {2-col grid, sidebar collapsed} |
110
- | Desktop | ≥ 1280px | {Full layout, max-width 1440px} |
108
+ | Mobile | < 768px | {1 cột, bottom nav, CTA full-width} |
109
+ | Tablet | 768–1279px | {grid 2 cột, sidebar thu gọn} |
110
+ | Desktop | ≥ 1280px | {layout đầy đủ, max-width 1440px} |
111
111
 
112
112
  ## B. Hover / Focus / Keyboard *(web)*
113
113
 
114
- | Element | Hover | Focus | Keyboard |
114
+ | Phần tử | Hover | Focus | Keyboard |
115
115
  |----------------|-------------------------------|---------------------------------|---------------|
116
116
  | Primary button | Background → {color.hover} | Outline 2px {color.focus} | Enter / Space |
117
117
  | Text input | Border → {color.border.hover} | Border → {color.primary} | Tab to focus |
118
118
 
119
- <!-- === APP ONLY delete sections A+B for app === -->
119
+ <!-- === CHỈ APP — xóa section A+B cho app === -->
120
120
 
121
- ## C. Gestures & Navigation *(app)*
121
+ ## C. Cử chỉ & Điều hướng *(app)*
122
122
 
123
- | Gesture | Screen / Element | Behavior |
123
+ | Cử chỉ | Màn / Phần tử | Hành vi |
124
124
  |----------------------|---------------------|---------------------------------------------|
125
- | Back gesture | All screens | {Return / show "Discard changes?" dialog} |
126
- | Pull-to-refresh | {Screen names} | Refresh data, spinner at top |
127
- | Swipe left on row | {List item} | Reveal {Delete / Archive} action |
125
+ | Cử chỉ back | Mọi màn | {Quay lại / hiện dialog "Discard changes?"} |
126
+ | Pull-to-refresh | {Tên màn} | Refresh dữ liệu, spinner trên cùng |
127
+ | Swipe trái trên row | {List item} | Hiện action {Delete / Archive} |
128
128
 
129
129
  ### Navigation Stack *(app)*
130
130
 
131
131
  ```
132
- {e.g., BottomTab(Home) → ListPage → DetailPage → EditPage}
132
+ {vd: BottomTab(Home) → ListPage → DetailPage → EditPage}
133
133
  ```
134
134
 
135
135
  ### Platform Conventions *(app)*
136
136
 
137
- | Aspect | iOS | Android |
137
+ | Khía cạnh | iOS | Android |
138
138
  |------------------|-------------------------------------------|-------------------------------------|
139
- | Navigation bar | Back button top-left, title centered | Up arrow, title left-aligned |
140
- | Bottom sheet | UISheetPresentation, grabber visible | BottomSheet, drag handle |
141
- | Dialog | Actions right-aligned | Actions left-aligned |
139
+ | Navigation bar | Nút back trên-trái, title canh giữa | Mũi tên Up, title canh trái |
140
+ | Bottom sheet | UISheetPresentation, hiện grabber | BottomSheet, drag handle |
141
+ | Dialog | Action canh phải | Action canh trái |
142
142
 
143
143
  ---
144
144
 
145
- # 4. Platform Considerations
145
+ # 4. Cân nhắc theo Platform (Platform Considerations)
146
146
 
147
- <!-- === WEB ONLY === -->
147
+ <!-- === CHỈ WEB === -->
148
148
 
149
149
  ## A. Accessibility *(web)*
150
150
 
151
- - [ ] All interactive elements reachable by Tab key no keyboard traps
152
- - [ ] Focus trap inside modals
153
- - [ ] Icon-only buttons have `aria-label`
154
- - [ ] Dynamic content announces via `aria-live`
155
- - [ ] WCAG AA contrast: text ≥ 4.5:1, large text ≥ 3:1
156
- - [ ] Form inputs have visible labels (not placeholder-only)
151
+ - [ ] Mọi phần tử tương tác đều tới được bằng phím Tab — không keyboard trap
152
+ - [ ] Focus trap bên trong modal
153
+ - [ ] Nút chỉ icon phải có `aria-label`
154
+ - [ ] Nội dung động thông báo qua `aria-live`
155
+ - [ ] Tương phản WCAG AA: text ≥ 4.5:1, text lớn ≥ 3:1
156
+ - [ ] Input form label hiển thị (không chỉ dùng placeholder)
157
157
 
158
- <!-- === APP ONLY === -->
158
+ <!-- === CHỈ APP === -->
159
159
 
160
- ## B. Device & OS *(app)*
160
+ ## B. Thiết bị & OS *(app)*
161
161
 
162
- - [ ] Safe area insets applied (top + bottom) on all screens
163
- - [ ] Minimum touch target: 44×44pt (iOS) / 48×48dp (Android)
164
- - [ ] Tested on 375pt (iPhone SE) and 360dp (small Android)
165
- - [ ] Deep link: `{scheme}://{host}/{path}` → {screen name}
166
- - [ ] Permissions: {Camera / Location / Notification} — rationale copy TBD
167
- - [ ] Offline: {screen name} shows cached data + banner; {action} disabled with tooltip
168
- - [ ] Dark mode tested no hardcoded colors
162
+ - [ ] Áp dụng safe area insets (trên + dưới) mọi màn
163
+ - [ ] Touch target tối thiểu: 44×44pt (iOS) / 48×48dp (Android)
164
+ - [ ] Đã test trên 375pt (iPhone SE) 360dp (Android nhỏ)
165
+ - [ ] Deep link: `{scheme}://{host}/{path}` → {tên màn}
166
+ - [ ] Permission: {Camera / Location / Notification} — nội dung lý do TBD
167
+ - [ ] Offline: {tên màn} hiện dữ liệu cache + banner; {action} bị disable kèm tooltip
168
+ - [ ] Đã test dark mode — không màu hardcode
169
169
 
170
170
  ---
171
171
 
172
- # 5. AC-UI — Design Acceptance Criteria
172
+ # 5. AC-UI — Tiêu chí chấp nhận về Design
173
173
 
174
- > Reviewed and signed off by **PO + Designer** before BDD generation.
175
- > Complements business-level AC in [Business PRD](./{TICKET-ID}-slug.md).
174
+ > Được **PO + Designer** review và sign off trước khi sinh BDD.
175
+ > Bổ sung cho AC mức nghiệp vụ trong [Business PRD](./{TICKET-ID}-slug.md).
176
176
 
177
- | ID | Acceptance Criterion | Verified by |
177
+ | ID | Tiêu chí chấp nhận | Verified by |
178
178
  |--------|--------------------------------------------------------------------------|-----------------|
179
- | AC-UI1 | All screens match approved Figma frames within design-system tolerances | Designer |
180
- | AC-UI2 | Loading state appears within 200ms of any API call initiation | QA |
181
- | AC-UI3 | All error messages are visible, descriptive, and include a recovery CTA | PO |
182
- | AC-UI4 | Empty states include illustration and call-to-action | PO + Designer |
183
- | AC-UI5 | {Platform-specific criterion} | QA |
179
+ | AC-UI1 | Mọi màn khớp với frame Figma đã duyệt trong dung sai design-system | Designer |
180
+ | AC-UI2 | Trạng thái loading xuất hiện trong vòng 200ms kể từ khi gọi API | QA |
181
+ | AC-UI3 | Mọi thông báo lỗi đều hiển thị, rõ ràng, kèm CTA khôi phục | PO |
182
+ | AC-UI4 | Empty state illustration call-to-action | PO + Designer |
183
+ | AC-UI5 | {Tiêu chí riêng theo platform} | QA |
184
184
 
185
185
  ---
186
186
 
187
187
  # Appendix
188
188
 
189
- ## Figma Summary
189
+ ## Tóm tắt Figma
190
190
 
191
- | Screen | Figma Frame (node-level) | Link / Fetch Status |
191
+ | Màn hình | Figma Frame (node-level) | Trạng thái Link / Fetch |
192
192
  |------------|--------------------------|--------------------------------|
193
- | {Screen 1} | [Link]({node-level url}) | ✅ Linked & fetched |
194
- | {Screen 2} | — | ❌ Missing — no node-id link |
193
+ | {Màn hình 1} | [Link]({node-level url}) | ✅ Đã link & fetch |
194
+ | {Màn hình 2} | — | ❌ Missing — không có link node-id |
195
195
 
196
- ## Design Tokens Referenced
196
+ ## Design Token đã tham chiếu
197
197
 
198
- | Token | Value | Used in |
198
+ | Token | Value | Dùng |
199
199
  |-------------------|----------|----------------------------|
200
- | `color.primary` | {#hex} | Buttons, links |
201
- | `spacing.md` | {16px} | Standard vertical gap |
200
+ | `color.primary` | {#hex} | Button, link |
201
+ | `spacing.md` | {16px} | Khoảng cách dọc tiêu chuẩn |
202
202
 
203
- ## References
203
+ ## Tài liệu tham khảo
204
204
 
205
205
  - [{TICKET-ID}](./{TICKET-ID}-slug.md) — Business PRD
206
206
 
207
- ## AI Assumptions
207
+ ## Giả định AI
208
208
 
209
- - {Assumption — [AI DRAFT]}
209
+ - {Giả định — [AI DRAFT]}
210
210
 
211
211
  ---
212
212