@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.
- package/bin/index.js +12 -1
- package/commands/debug.md +436 -436
- package/commands/debug.tmpl +111 -111
- package/commands/define-product.md +350 -345
- package/commands/define-product.tmpl +69 -64
- package/commands/dev-gen-test.md +365 -365
- package/commands/dev-gen-test.tmpl +63 -63
- package/commands/dev-run-test.md +376 -376
- package/commands/dev-run-test.tmpl +74 -74
- package/commands/dev-smoke-test.md +341 -341
- package/commands/dev-smoke-test.tmpl +60 -60
- package/commands/fix-bug.md +403 -403
- package/commands/fix-bug.tmpl +78 -78
- package/commands/generate-bdd.md +513 -513
- package/commands/generate-bdd.tmpl +211 -211
- package/commands/generate-code.md +481 -483
- package/commands/generate-code.tmpl +179 -181
- package/commands/generate-design-spec.md +497 -497
- package/commands/generate-design-spec.tmpl +220 -220
- package/commands/generate-prd.md +452 -400
- package/commands/generate-prd.tmpl +50 -200
- package/commands/generate-spec-manifest.md +340 -340
- package/commands/generate-spec-manifest.tmpl +59 -59
- package/commands/generate-tech-docs.md +365 -365
- package/commands/generate-tech-docs.tmpl +84 -84
- package/commands/learn.md +347 -347
- package/commands/learn.tmpl +22 -22
- package/commands/map-testids.md +322 -322
- package/commands/map-testids.tmpl +41 -41
- package/commands/propose-scenario.md +335 -335
- package/commands/propose-scenario.tmpl +54 -54
- package/commands/qc-analyze.md +323 -324
- package/commands/qc-analyze.tmpl +42 -43
- package/commands/qc-design-test.md +304 -304
- package/commands/qc-design-test.tmpl +23 -23
- package/commands/qc-plan.md +297 -297
- package/commands/qc-plan.tmpl +16 -16
- package/commands/qc-report.md +302 -302
- package/commands/qc-report.tmpl +21 -21
- package/commands/qc-review.md +298 -298
- package/commands/qc-review.tmpl +17 -17
- package/commands/qc-run-test.md +337 -337
- package/commands/qc-run-test.tmpl +35 -35
- package/commands/refine-prd.md +428 -430
- package/commands/refine-prd.tmpl +62 -62
- package/commands/report-bug.md +351 -351
- package/commands/report-bug.tmpl +70 -70
- package/commands/review-code.md +364 -364
- package/commands/review-code.tmpl +39 -39
- package/commands/review-context.md +578 -580
- package/commands/review-context.tmpl +212 -212
- package/commands/review-tech-docs.md +427 -427
- package/commands/review-tech-docs.tmpl +146 -146
- package/commands/setup-ai-first.md +239 -239
- package/commands/setup-ai-first.tmpl +133 -133
- package/commands/sync.md +145 -145
- package/commands/sync.tmpl +93 -93
- package/commands/update-framework.md +88 -88
- package/commands/update-framework.tmpl +36 -36
- package/commands/validate-traces.md +381 -381
- package/commands/validate-traces.tmpl +100 -100
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +436 -436
- package/core/commands/define-product.md +350 -345
- package/core/commands/dev-gen-test.md +365 -365
- package/core/commands/dev-run-test.md +376 -376
- package/core/commands/dev-smoke-test.md +341 -341
- package/core/commands/fix-bug.md +403 -403
- package/core/commands/generate-bdd.md +513 -513
- package/core/commands/generate-code.md +481 -483
- package/core/commands/generate-design-spec.md +497 -497
- package/core/commands/generate-prd.md +452 -400
- package/core/commands/generate-spec-manifest.md +340 -340
- package/core/commands/generate-tech-docs.md +365 -365
- package/core/commands/learn.md +347 -347
- package/core/commands/map-testids.md +322 -322
- package/core/commands/propose-scenario.md +335 -335
- package/core/commands/qc-analyze.md +323 -324
- package/core/commands/qc-design-test.md +304 -304
- package/core/commands/qc-plan.md +297 -297
- package/core/commands/qc-report.md +302 -302
- package/core/commands/qc-review.md +298 -298
- package/core/commands/qc-run-test.md +337 -337
- package/core/commands/refine-prd.md +428 -430
- package/core/commands/report-bug.md +351 -351
- package/core/commands/review-code.md +364 -364
- package/core/commands/review-context.md +578 -580
- package/core/commands/review-tech-docs.md +427 -427
- package/core/commands/setup-ai-first.md +239 -239
- package/core/commands/sync.md +145 -145
- package/core/commands/update-framework.md +88 -88
- package/core/commands/validate-traces.md +381 -381
- package/core/skills/code/SKILL.md +389 -389
- package/core/skills/debug/SKILL.md +391 -391
- package/core/skills/design-spec/SKILL.md +318 -318
- package/core/skills/discovery/SKILL.md +7 -547
- package/core/skills/prd/SKILL.md +298 -394
- package/core/skills/setup-ai-first/SKILL.md +80 -80
- package/core/skills/spec/SKILL.md +178 -178
- package/core/skills/test/SKILL.md +604 -604
- package/core/steps/capture-lesson.md +44 -44
- package/core/steps/context-loader.md +175 -175
- package/core/steps/gate.md +54 -54
- package/core/steps/report-footer.md +52 -52
- package/core/steps/review-fanout.md +85 -87
- package/core/steps/spawn-agent.md +45 -45
- package/core/steps/trace-mirror.md +21 -21
- package/core/templates/architecture.template.md +37 -37
- package/core/templates/design-spec.template.md +77 -77
- package/core/templates/platform-guide.template.md +47 -47
- package/core/templates/prd.template.md +107 -232
- package/core/templates/product-definition.template.md +101 -88
- package/core/templates/project-context.yaml +2 -2
- package/docs/01-getting-started/core-concepts.md +1 -1
- package/docs/01-getting-started/quickstart.md +7 -7
- package/docs/02-guides/developer/bdd-and-trace.md +1 -1
- package/docs/02-guides/developer/scenarios.md +5 -5
- package/docs/02-guides/product-owner/handoff-checklist.md +1 -1
- package/docs/02-guides/product-owner/scenarios.md +23 -23
- package/docs/02-guides/tester/bug-reporting.md +2 -2
- package/docs/02-guides/tester/reading-specs.md +2 -2
- package/docs/02-guides/tester/scenarios.md +1 -1
- package/docs/02-guides/tester/spec-manifest.md +3 -3
- package/docs/02-guides/tester/workflow.md +1 -1
- package/docs/03-concepts/architecture.md +3 -3
- package/docs/03-concepts/pipeline.md +3 -3
- package/docs/04-operations/publishing.md +20 -3
- package/docs/04-operations/sync-and-update.md +5 -5
- package/docs/05-reference/command-cheatsheet.md +2 -2
- package/docs/05-reference/commands.md +8 -8
- package/package.json +1 -1
- package/scripts/migrate-specs.js +5 -3
- package/scripts/rename-prd-files.js +174 -0
- package/skills/code/SKILL.md +389 -389
- package/skills/code/SKILL.tmpl +56 -56
- package/skills/debug/SKILL.md +391 -391
- package/skills/debug/SKILL.tmpl +60 -60
- package/skills/design-spec/SKILL.md +318 -318
- package/skills/design-spec/SKILL.tmpl +37 -37
- package/skills/discovery/SKILL.md +7 -547
- package/skills/discovery/SKILL.tmpl +7 -140
- package/skills/prd/SKILL.md +298 -394
- package/skills/prd/SKILL.tmpl +40 -151
- package/skills/setup-ai-first/SKILL.md +80 -80
- package/skills/setup-ai-first/SKILL.tmpl +28 -28
- package/skills/spec/SKILL.md +178 -178
- package/skills/spec/SKILL.tmpl +20 -20
- package/skills/test/SKILL.md +604 -604
- package/skills/test/SKILL.tmpl +44 -44
- package/steps/capture-lesson.md +44 -44
- package/steps/context-loader.md +175 -175
- package/steps/gate.md +54 -54
- package/steps/report-footer.md +52 -52
- package/steps/review-fanout.md +85 -87
- package/steps/spawn-agent.md +45 -45
- package/steps/trace-mirror.md +21 -21
- package/templates/architecture.template.md +37 -37
- package/templates/design-spec.template.md +77 -77
- package/templates/platform-guide.template.md +47 -47
- package/templates/prd.template.md +107 -232
- package/templates/product-definition.template.md +101 -88
- package/templates/project-context.yaml +2 -2
package/skills/debug/SKILL.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
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 và 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
|
-
|
|
7
|
+
Skill này xử lý: `/fix-bug` (full bug fix workflow), `/debug` (phân tích nhanh), và `/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
|
-
|
|
15
|
+
Nhận: ticket ID (vd `PROJ-123`) hoặc một mô tả bug trực tiếp.
|
|
16
16
|
|
|
17
17
|
### Phase 1 — Gather Information
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
- Fetch ticket
|
|
21
|
-
-
|
|
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
|
-
|
|
24
|
-
**CHECKPOINT** —
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
23
|
+
Nếu không có 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 (
|
|
28
|
+
4. Error log / stack trace (nếu có)?
|
|
29
29
|
|
|
30
30
|
### Phase 2 — Root Cause Analysis
|
|
31
31
|
|
|
32
|
-
# Context Loader —
|
|
32
|
+
# Context Loader — Nạp toàn bộ context dự án
|
|
33
33
|
|
|
34
|
-
|
|
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
|
-
**
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
36
|
+
**Hướng dẫn ưu tiên (chống lost-in-middle):**
|
|
37
|
+
- Bước 1–2 là PROJECT-CONFIG — nạp trước, phân giải mọi path và metadata.
|
|
38
|
+
- Bước 3 là CRITICAL — kiến trúc + coding standards, là các sự thật ưu tiên cao nhất khi sinh nội dung.
|
|
39
|
+
- Bước 4 là 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 là DOMAIN KNOWLEDGE — thuật ngữ và định nghĩa entity.
|
|
41
|
+
- Bước 7 là 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
|
-
##
|
|
45
|
+
## Bước 1 — [PROJECT-CONFIG] Nạp project-context.yaml
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Đọc `.agent/project-context.yaml`. Trích xuất và lưu:
|
|
48
48
|
|
|
49
49
|
**Tech Stack:**
|
|
50
|
-
- `tech_stack.language` →
|
|
51
|
-
- `tech_stack.framework` →
|
|
52
|
-
- `tech_stack.build_tool` → build tool (
|
|
53
|
-
- `tech_stack.test_framework` → test framework (
|
|
54
|
-
- `tech_stack.database` → database (
|
|
55
|
-
- `tech_stack.module` →
|
|
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` →
|
|
59
|
-
- `conventions.test_command` →
|
|
60
|
-
- `conventions.service_run` →
|
|
61
|
-
- `conventions.ticket_prefix` → ticket ID
|
|
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` →
|
|
65
|
-
|
|
66
|
-
**Paths (
|
|
67
|
-
- `paths.specs_dir` → spec
|
|
68
|
-
- `paths.refinement_dir` → findings/review
|
|
69
|
-
- `paths.qc_dir` → QC automation
|
|
70
|
-
- `paths.qc_skills_dir` →
|
|
71
|
-
- `paths.product_definitions_dir` → product
|
|
72
|
-
- `paths.domain_knowledge_dir` → domain knowledge
|
|
73
|
-
- `paths.business_dictionary` → path
|
|
74
|
-
- `paths.core_entities` → path
|
|
75
|
-
- `paths.tech_docs_dir` →
|
|
76
|
-
- `paths.trace_dir` →
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
- `domains` → danh sách các business domain đang hoạt động
|
|
65
|
+
|
|
66
|
+
**Paths (nếu có):**
|
|
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}/{ {TICKET-ID}-{prd-slug}.md | bdd/ | tech-docs/ | design-spec/}` (file PRD đặt tên `{TICKET-ID}-{prd-slug}.md`, là file `.md` duy nhất ở gốc feature folder)
|
|
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
|
-
|
|
90
|
+
Lưu ý: Trong bố cục feature-package, `specs_dir` là 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` là tên folder feature-package, không phải một biến config riêng.
|
|
91
91
|
|
|
92
|
-
**
|
|
93
|
-
- `specs/payment/create-invoice/
|
|
94
|
-
- `specs/payment/create-invoice/bdd/system/PAY-UC1.feature` → `prd_slug = create-invoice` *(
|
|
95
|
-
- `specs/payment/create-invoice/bdd/web/PAY-UC1.feature` → `prd_slug = create-invoice` *(
|
|
96
|
-
- `specs/payment/create-invoice/tech-docs/PAY-UC1-tech-design.md` → `prd_slug = create-invoice` *(
|
|
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, vì 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
|
+
- `specs/payment/create-invoice/PAY01-create-invoice.md` → `prd_slug = create-invoice`
|
|
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
|
-
|
|
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, và 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 mà nó được suy ra từ đó.
|
|
100
100
|
|
|
101
|
-
|
|
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
|
-
##
|
|
105
|
+
## Bước 1.5 — [SERVICE ROUTING] Phân giải path service (chế độ umbrella)
|
|
106
106
|
|
|
107
|
-
*
|
|
107
|
+
*Bỏ qua hoàn toàn bước này nếu `setup.mode` không phải `"umbrella"` và không có section `services` trong project-context.yaml.*
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
Nếu có section `services`:
|
|
110
110
|
|
|
111
|
-
**1.
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
*(
|
|
115
|
-
-
|
|
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/USR01-create-account.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
|
|
118
|
-
- Override `paths.specs_dir` → `services.{domain}.specs_dir` — **
|
|
119
|
-
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
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**) là 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) là artifact liên team và phải nằm trong spec repo dùng chung (xử lý ở 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 có `module` riêng → dùng nó làm `active_module` (override `tech_stack.module`)
|
|
123
123
|
|
|
124
|
-
**3. Fallback** —
|
|
125
|
-
-
|
|
126
|
-
-
|
|
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.
|
|
129
|
-
- Override `paths.specs_dir` → `{spec_source}/specs` — **
|
|
130
|
-
- Override `paths.tech_docs_dir` → `{spec_source}/specs` — **
|
|
128
|
+
**4. Tự động override theo spec source** — nếu `setup.spec_source` được đặt VÀ 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 có `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 LÀ API contract liên team: BE viết ở đây, FE/App đọc nó 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 có 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` — **
|
|
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 có 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 có `spec_source`.)*
|
|
138
138
|
|
|
139
|
-
> **
|
|
139
|
+
> **Vì sao đặt dưới `spec_source`:** PRD, BDD, tech-docs, design-spec, domain knowledge, feedback của tester, **và trạng thái coverage `.trace/`** đều là **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) và 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ự đủ và dễ điều hướng theo feature. Service submodule chỉ chứa **code** (+ tooling build/test). `.trace/` và `feedback/` là khu vực **ghi** của dev/QC trong spec repo. Ở chế độ single-service (không có `spec_source`), mọi thứ mặc định dưới gốc repo — vẫn là một repo.
|
|
140
140
|
|
|
141
141
|
---
|
|
142
142
|
|
|
143
|
-
##
|
|
143
|
+
## Bước 1.6 — [SERVICE CONVENTIONS] Nạp convention riêng của service (chế độ umbrella)
|
|
144
144
|
|
|
145
|
-
*
|
|
145
|
+
*Bỏ qua hoàn toàn bước này nếu `active_service` là `"unresolved"` hoặc context ở chế độ single-service.*
|
|
146
146
|
|
|
147
|
-
|
|
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.
|
|
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.
|
|
153
|
+
**2. Nếu tìm thấy, override bằng giá trị riêng của service:**
|
|
154
154
|
|
|
155
|
-
|
|
|
155
|
+
| Biến | Nguồn |
|
|
156
156
|
|----------|--------|
|
|
157
|
-
| `conventions.test_command` |
|
|
158
|
-
| `conventions.build_command` |
|
|
159
|
-
| `paths.trace_dir` | **
|
|
160
|
-
| `paths.specs_dir` | **
|
|
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 đặt → giữ route spec-repo của bước 4 (`{spec_source}/.trace`); bỏ qua mọi `trace_dir` cấp service.** Chỉ khi không có `spec_source`: `{active_service}/{service paths.trace_dir}` (mặc định `{active_service}/.trace`). |
|
|
160
|
+
| `paths.specs_dir` | **Nếu `spec_source` được đặt → giữ 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 có `spec_source`: `{active_service}/{service paths.specs_dir}` nếu được set, else dùng override ở Bước 1.5. |
|
|
161
161
|
|
|
162
|
-
**3.
|
|
163
|
-
-
|
|
164
|
-
- **
|
|
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}` (là spec repo khi `spec_source` được đặt — một thao tác ghi liên-repo, commit/push vào spec submodule giống như `feedback/`).
|
|
165
165
|
|
|
166
|
-
**4.
|
|
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 có config override).
|
|
167
167
|
|
|
168
168
|
---
|
|
169
169
|
|
|
170
|
-
##
|
|
170
|
+
## Bước 2 — [PROJECT-CONFIG] Nạp module stack profile (có điều kiện)
|
|
171
171
|
|
|
172
|
-
|
|
173
|
-
Merge framework
|
|
174
|
-
|
|
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ại → bỏ qua âm thầm.
|
|
175
175
|
|
|
176
176
|
---
|
|
177
177
|
|
|
178
|
-
##
|
|
178
|
+
## Bước 3 — [CRITICAL] Nạp CLAUDE.md (phân tầng: root + service overlay)
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
*Đây là context ưu tiên cao nhất — nó định nghĩa CÁCH viết code và tài liệu cho dự án này.*
|
|
181
181
|
|
|
182
|
-
CLAUDE.md
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
CLAUDE.md được nạp theo **hai tầng** để các quy tắc toàn-umbrella và 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, và convention RIÊNG của nó — nên CLAUDE.md của
|
|
185
|
+
service phải thắng khi sinh code.
|
|
186
186
|
|
|
187
|
-
**
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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ó là **nền tảng dùng chung** cho cả umbrella —
|
|
189
|
+
git convention, tư thế bảo vệ dữ liệu, quy tắc xuyên suốt, và (ở chế độ single-service) là
|
|
190
|
+
kiến trúc + coding standards duy nhất của dự án.
|
|
191
191
|
|
|
192
|
-
**
|
|
193
|
-
*
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
Overlay
|
|
197
|
-
coding standards,
|
|
198
|
-
(
|
|
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 nó lên trên Tầng 1: **khi có xung đột, giá trị của service THẮNG** cho kiến trúc,
|
|
197
|
+
coding standards, và 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 có hiệu lực.
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
Từ kết quả **đã merge**, trích xuất và lưu:
|
|
201
201
|
|
|
202
|
-
- **§1 Project Overview** →
|
|
203
|
-
- **§2 Architecture** → layer
|
|
204
|
-
- **§3 Coding Standards** →
|
|
205
|
-
- **§5 Error Handling** → exception
|
|
206
|
-
- **§7 Git Conventions** →
|
|
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
|
-
**
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
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ỉ có service overlay (không có 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 và gắn cờ ⚠️ trong recap Bước 7 (service không có định nghĩa kiến trúc/coding-standards — việc sinh code sẽ dùng mặc định umbrella, có thể sai stack).
|
|
212
|
+
- Nếu cả hai đều không tồn tại → ghi nhận CLAUDE.md thiếu và tiếp tục chỉ với dữ liệu từ project-context.yaml.
|
|
213
213
|
|
|
214
214
|
---
|
|
215
215
|
|
|
216
|
-
##
|
|
216
|
+
## Bước 4 — [SAFETY] Nạp quy tắc bảo vệ dữ liệu
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
Đọc `.agent/rules/data-protection.md` (hoặc `rules/data-protection.md` từ bản cài đặt framework).
|
|
219
219
|
|
|
220
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
226
|
+
## Bước 5 — [DOMAIN] Nạp Business Dictionary (có điều kiện)
|
|
227
227
|
|
|
228
|
-
|
|
228
|
+
Kiểm tra file business dictionary có tồn tại không (dùng `paths.business_dictionary` đã phân giải ở Bước 1).
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
- **Canonical Terms** →
|
|
232
|
-
- **Banned Terms** →
|
|
233
|
-
- **Status / Enum Registry** →
|
|
230
|
+
Nếu tồn tại, đọc và 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
|
-
|
|
236
|
-
-
|
|
237
|
-
-
|
|
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
|
-
|
|
239
|
+
Nếu file không tồn tại → bỏ qua âm thầm. Không cảnh báo hay chặn.
|
|
240
240
|
|
|
241
241
|
---
|
|
242
242
|
|
|
243
|
-
##
|
|
243
|
+
## Bước 6 — [DOMAIN] Nạp Core Entities (có điều kiện)
|
|
244
244
|
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
Kiểm tra file core entities có 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
|
-
|
|
249
|
-
- **Entity catalog** →
|
|
250
|
-
- **Field name registry** →
|
|
251
|
-
- **Relationship map** →
|
|
248
|
+
Nếu tồn tại, đọc và 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, và quan hệ
|
|
250
|
+
- **Field name registry** → tên field chuẩn dùng trong code và 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
|
-
**
|
|
254
|
-
-
|
|
255
|
-
-
|
|
256
|
-
-
|
|
253
|
+
**Cách dùng catalog này:**
|
|
254
|
+
- Khi sinh code: dùng tên field, kiểu, và 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
|
-
|
|
258
|
+
Nếu file không tồn tại → bỏ qua âm thầm.
|
|
259
259
|
|
|
260
260
|
---
|
|
261
261
|
|
|
262
|
-
##
|
|
262
|
+
## Bước 6.5 — [PLATFORM] Suy ra active_module và platform_type
|
|
263
263
|
|
|
264
|
-
|
|
264
|
+
Dùng `tech_stack.module` đã nạp ở Bước 1, suy ra và lưu hai biến để mọi lệnh phía sau dùng:
|
|
265
265
|
|
|
266
266
|
```
|
|
267
|
-
active_module = tech_stack.module (
|
|
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
|
-
|
|
276
|
+
Nếu `tech_stack.module` rỗng hoặc không nhận diện được → set `platform_type = "unknown"` và gắn cờ ⚠️ trong recap Bước 7.
|
|
277
277
|
|
|
278
|
-
|
|
278
|
+
Hai biến này (`active_module`, `platform_type`) là 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
|
-
##
|
|
282
|
+
## Bước 6.7 — [GUARDRAILS] Nạp Project Lessons (có điều kiện)
|
|
283
283
|
|
|
284
|
-
*
|
|
285
|
-
|
|
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
|
-
|
|
288
|
-
-
|
|
289
|
-
- Else
|
|
290
|
-
-
|
|
287
|
+
Phân giải path file lessons:
|
|
288
|
+
- Dùng `paths.lessons_file` nếu được set (có 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
|
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
292
|
+
Nếu file tồn tại, đọc và lưu TẤT CẢ lesson làm **GUARDRAIL ĐANG HOẠT ĐỘNG** cho phiên:
|
|
293
|
+
- Coi **Rule** của mỗi lesson là 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 có `category` khớp lệnh hiện tại VÀ `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, và ghi rõ lesson nào (`L-NNN`) đã được áp dụng.
|
|
296
296
|
|
|
297
|
-
|
|
297
|
+
Nếu file không tồn tại → bỏ qua âm thầm (chưa có lesson nào được ghi nhận).
|
|
298
298
|
|
|
299
299
|
---
|
|
300
300
|
|
|
301
|
-
##
|
|
301
|
+
## Bước 7 — [RECAP] Working Memory Recap (chống lost-in-middle)
|
|
302
302
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
(recency
|
|
303
|
+
Sau khi nạp toàn bộ context, tổng hợp và 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
|
-
|
|
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 : {
|
|
313
|
-
CLAUDE.md : {root + {service_root} | {service_root}
|
|
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ẾU — dù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 |
|
|
317
|
+
Lessons : {loaded — N guardrails | chưa có}
|
|
318
318
|
Service : {active_service} ({active_service_module}) | single-service
|
|
319
|
-
Svc Root : {service_root} — conventions + trace_dir
|
|
320
|
-
Status : {FULL | PARTIAL —
|
|
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
|
-
|
|
323
|
+
Nếu bất kỳ file CRITICAL nào thiếu (CLAUDE.md), gắn cờ rõ ràng để người dùng quyết định có tiếp tục hay không.
|
|
324
324
|
|
|
325
325
|
---
|
|
326
326
|
|
|
327
|
-
##
|
|
327
|
+
## Hoàn tất nạp Context
|
|
328
328
|
|
|
329
|
-
|
|
330
|
-
-
|
|
331
|
-
-
|
|
332
|
-
- Coding standards
|
|
333
|
-
-
|
|
334
|
-
-
|
|
335
|
-
- Entity catalog (field
|
|
336
|
-
-
|
|
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 và 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
|
-
|
|
338
|
+
Tiếp tục sang bước kế tiếp của lệnh đang gọi.
|
|
339
339
|
|
|
340
340
|
|
|
341
|
-
Trace
|
|
342
|
-
1.
|
|
343
|
-
2.
|
|
344
|
-
3.
|
|
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 |
|
|
346
|
+
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
347
347
|
|----------|----------------|--------------|
|
|
348
|
-
| Wrong response data | Data mapping layer |
|
|
349
|
-
| 400 Bad Request | Input validation |
|
|
350
|
-
| 403 Forbidden | Auth configuration |
|
|
351
|
-
| 404 Not Found | Repository query |
|
|
352
|
-
| Slow query / N+1 | Data access layer |
|
|
353
|
-
| Null Pointer |
|
|
354
|
-
| Transaction rollback |
|
|
355
|
-
| Stale cache |
|
|
356
|
-
| Type mismatch in query |
|
|
357
|
-
| Cross-service timeout |
|
|
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ử lý | 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
389
|
+
Thêm annotation traceability nếu file có `@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
|
-
|
|
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
|
-
|
|
407
|
+
Chạy test: `{TEST_COMMAND_FOR_CLASS}`
|
|
408
408
|
|
|
409
|
-
|
|
409
|
+
Nếu test fail → debug và 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 —
|
|
444
|
+
# Report Footer — Định dạng output chuẩn cho mọi lệnh
|
|
445
445
|
|
|
446
|
-
|
|
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
|
-
|
|
451
|
-
- `✅ Complete` —
|
|
452
|
-
- `❌ Failed` —
|
|
453
|
-
- `⚠️ Warnings` —
|
|
450
|
+
Chọn một theo kết quả:
|
|
451
|
+
- `✅ Complete` — mọi bước thành công, không có 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 có vấn đề không chặn, nên review lại
|
|
454
454
|
|
|
455
455
|
## Output Artifacts
|
|
456
456
|
|
|
457
|
-
|
|
457
|
+
Liệt kê 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} ({
|
|
461
|
-
{created|updated} {file-path} ({
|
|
460
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
461
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
462
462
|
```
|
|
463
463
|
|
|
464
|
-
|
|
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
|
-
|
|
469
|
-
|
|
468
|
+
In một sơ đồ 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
|
-
|
|
475
|
+
Tìm lệnh hiện tại trong bảng phase dưới đây và đá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
|
-
|
|
489
|
+
Với **lệnh review**, thêm vòng review 3 bước và đá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
|
-
**
|
|
493
|
-
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`)
|
|
494
|
-
**
|
|
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 sơ đồ).
|
|
495
495
|
|
|
496
|
-
##
|
|
496
|
+
## Gợi ý lệnh tiếp theo
|
|
497
497
|
|
|
498
|
-
|
|
498
|
+
Gợi ý lệnh kế tiếp hợp lý theo phase của workflow:
|
|
499
499
|
|
|
500
|
-
|
|
|
500
|
+
| Lệnh hiện tại | Gợi ý lệnh tiếp theo |
|
|
501
501
|
|-------------------------|-----------------------------------------------|
|
|
502
|
-
| /setup-ai-first | `/define-product`
|
|
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}`
|
|
505
|
-
| /refine-prd |
|
|
506
|
-
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (
|
|
507
|
-
| /generate-design-spec | Designer review →
|
|
508
|
-
| /generate-bdd | `/review-context {feature-file}`
|
|
509
|
-
| /review-context (BDD) | `/generate-tech-docs {UC-ID}`
|
|
510
|
-
| /qc-analyze | `/qc-plan {UC-ID}` (
|
|
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ử lý 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
|
|
513
|
-
| /qc-review (test-case) | `/qc-run-test {UC-ID}`
|
|
514
|
-
| /qc-run-test | `/qc-report {UC-ID}`
|
|
515
|
-
| /qc-review (script) | `/qc-report {UC-ID}`
|
|
516
|
-
| /qc-report | `/validate-traces {UC-ID}`
|
|
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}`
|
|
519
|
-
| /generate-code |
|
|
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}`
|
|
523
|
-
| /review-code | `/dev-smoke-test {UC-ID}`
|
|
524
|
-
| /dev-smoke-test |
|
|
525
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`;
|
|
526
|
-
| /fix-bug |
|
|
527
|
-
| /debug | `/fix-bug {ticket-id}`
|
|
528
|
-
| /report-bug |
|
|
529
|
-
| /propose-scenario |
|
|
530
|
-
| /learn |
|
|
531
|
-
| /sync | `/validate-traces`
|
|
532
|
-
| /update-framework | Review `git diff .agent/`, commit; `/sync`
|
|
533
|
-
|
|
534
|
-
|
|
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 và 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 và 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
|
|
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
|
|
541
|
-
Next : {
|
|
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
|
-
*(
|
|
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
|
-
|
|
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 vì sao code làm gì đó.
|
|
551
551
|
|
|
552
|
-
**
|
|
552
|
+
**Khác `/fix-bug`**: Đây chỉ là phân tích, không full workflow, không cần ticket.
|
|
553
553
|
|
|
554
554
|
### Input
|
|
555
555
|
|
|
556
|
-
|
|
556
|
+
Dán một trong:
|
|
557
557
|
1. Stack trace / error log
|
|
558
|
-
2.
|
|
559
|
-
3. File path +
|
|
560
|
-
4.
|
|
558
|
+
2. Output test fail
|
|
559
|
+
3. File path + mô 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
|
-
|
|
564
|
+
Đọc stack trace từ **dưới lên** — dòng `Caused by:` là 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 |
|
|
575
|
+
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
576
576
|
|-------|-------------|---------------|
|
|
577
|
-
| NullPointerException |
|
|
578
|
-
| ClassCastException |
|
|
579
|
-
| OutOfMemoryError |
|
|
580
|
-
| StackOverflowError |
|
|
581
|
-
| Connection refused | Dependency service
|
|
582
|
-
| Authentication/401 | Token
|
|
583
|
-
| Permission denied/403 |
|
|
584
|
-
| Database constraint violation |
|
|
585
|
-
| Serialization error | Circular reference,
|
|
586
|
-
| Test assertion mismatch |
|
|
577
|
+
| NullPointerException | Truy cập field trên object null; Optional chưa xử lý | 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 có 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 và role config |
|
|
584
|
+
| Database constraint violation | Trùng key, thiếu FK, null trong cột NOT NULL | Kiểm tra data và đị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 và 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.
|
|
597
|
-
2. Trace
|
|
598
|
-
3.
|
|
599
|
-
4.
|
|
596
|
+
1. Gap giữa Expected và Actual là gì?
|
|
597
|
+
2. Trace tới đúng dòng test
|
|
598
|
+
3. Mock setup đúng chưa? (`given(...).willReturn(...)`)
|
|
599
|
+
4. Assertion có đú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 —
|
|
628
|
+
# Report Footer — Định dạng output chuẩn cho mọi lệnh
|
|
629
629
|
|
|
630
|
-
|
|
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
|
-
|
|
635
|
-
- `✅ Complete` —
|
|
636
|
-
- `❌ Failed` —
|
|
637
|
-
- `⚠️ Warnings` —
|
|
634
|
+
Chọn một theo kết quả:
|
|
635
|
+
- `✅ Complete` — mọi bước thành công, không có 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 có vấn đề không chặn, nên review lại
|
|
638
638
|
|
|
639
639
|
## Output Artifacts
|
|
640
640
|
|
|
641
|
-
|
|
641
|
+
Liệt kê 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} ({
|
|
645
|
-
{created|updated} {file-path} ({
|
|
644
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
645
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
646
646
|
```
|
|
647
647
|
|
|
648
|
-
|
|
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
|
-
|
|
653
|
-
|
|
652
|
+
In một sơ đồ 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
|
-
|
|
659
|
+
Tìm lệnh hiện tại trong bảng phase dưới đây và đá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
|
-
|
|
673
|
+
Với **lệnh review**, thêm vòng review 3 bước và đá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
|
-
**
|
|
677
|
-
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`)
|
|
678
|
-
**
|
|
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 sơ đồ).
|
|
679
679
|
|
|
680
|
-
##
|
|
680
|
+
## Gợi ý lệnh tiếp theo
|
|
681
681
|
|
|
682
|
-
|
|
682
|
+
Gợi ý lệnh kế tiếp hợp lý theo phase của workflow:
|
|
683
683
|
|
|
684
|
-
|
|
|
684
|
+
| Lệnh hiện tại | Gợi ý lệnh tiếp theo |
|
|
685
685
|
|-------------------------|-----------------------------------------------|
|
|
686
|
-
| /setup-ai-first | `/define-product`
|
|
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}`
|
|
689
|
-
| /refine-prd |
|
|
690
|
-
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (
|
|
691
|
-
| /generate-design-spec | Designer review →
|
|
692
|
-
| /generate-bdd | `/review-context {feature-file}`
|
|
693
|
-
| /review-context (BDD) | `/generate-tech-docs {UC-ID}`
|
|
694
|
-
| /qc-analyze | `/qc-plan {UC-ID}` (
|
|
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ử lý 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
|
|
697
|
-
| /qc-review (test-case) | `/qc-run-test {UC-ID}`
|
|
698
|
-
| /qc-run-test | `/qc-report {UC-ID}`
|
|
699
|
-
| /qc-review (script) | `/qc-report {UC-ID}`
|
|
700
|
-
| /qc-report | `/validate-traces {UC-ID}`
|
|
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}`
|
|
703
|
-
| /generate-code |
|
|
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}`
|
|
707
|
-
| /review-code | `/dev-smoke-test {UC-ID}`
|
|
708
|
-
| /dev-smoke-test |
|
|
709
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`;
|
|
710
|
-
| /fix-bug |
|
|
711
|
-
| /debug | `/fix-bug {ticket-id}`
|
|
712
|
-
| /report-bug |
|
|
713
|
-
| /propose-scenario |
|
|
714
|
-
| /learn |
|
|
715
|
-
| /sync | `/validate-traces`
|
|
716
|
-
| /update-framework | Review `git diff .agent/`, commit; `/sync`
|
|
717
|
-
|
|
718
|
-
|
|
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 và 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 và 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
|
|
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
|
|
725
|
-
Next : {
|
|
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
|
-
*(
|
|
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
|
-
|
|
734
|
+
Check read-only độ phủ giữa spec, code, và test.
|
|
735
735
|
|
|
736
736
|
### Input
|
|
737
737
|
|
|
738
|
-
|
|
738
|
+
Nhận: tên domain hoặc UC-ID cụ thể.
|
|
739
739
|
|
|
740
740
|
### Process
|
|
741
741
|
|
|
742
|
-
1.
|
|
743
|
-
2. **
|
|
744
|
-
3. **
|
|
745
|
-
4.
|
|
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 —
|
|
769
|
+
# Report Footer — Định dạng output chuẩn cho mọi lệnh
|
|
770
770
|
|
|
771
|
-
|
|
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
|
-
|
|
776
|
-
- `✅ Complete` —
|
|
777
|
-
- `❌ Failed` —
|
|
778
|
-
- `⚠️ Warnings` —
|
|
775
|
+
Chọn một theo kết quả:
|
|
776
|
+
- `✅ Complete` — mọi bước thành công, không có 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 có vấn đề không chặn, nên review lại
|
|
779
779
|
|
|
780
780
|
## Output Artifacts
|
|
781
781
|
|
|
782
|
-
|
|
782
|
+
Liệt kê 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} ({
|
|
786
|
-
{created|updated} {file-path} ({
|
|
785
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
786
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
787
787
|
```
|
|
788
788
|
|
|
789
|
-
|
|
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
|
-
|
|
794
|
-
|
|
793
|
+
In một sơ đồ 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
|
-
|
|
800
|
+
Tìm lệnh hiện tại trong bảng phase dưới đây và đá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
|
-
|
|
814
|
+
Với **lệnh review**, thêm vòng review 3 bước và đá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
|
-
**
|
|
818
|
-
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`)
|
|
819
|
-
**
|
|
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 sơ đồ).
|
|
820
820
|
|
|
821
|
-
##
|
|
821
|
+
## Gợi ý lệnh tiếp theo
|
|
822
822
|
|
|
823
|
-
|
|
823
|
+
Gợi ý lệnh kế tiếp hợp lý theo phase của workflow:
|
|
824
824
|
|
|
825
|
-
|
|
|
825
|
+
| Lệnh hiện tại | Gợi ý lệnh tiếp theo |
|
|
826
826
|
|-------------------------|-----------------------------------------------|
|
|
827
|
-
| /setup-ai-first | `/define-product`
|
|
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}`
|
|
830
|
-
| /refine-prd |
|
|
831
|
-
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (
|
|
832
|
-
| /generate-design-spec | Designer review →
|
|
833
|
-
| /generate-bdd | `/review-context {feature-file}`
|
|
834
|
-
| /review-context (BDD) | `/generate-tech-docs {UC-ID}`
|
|
835
|
-
| /qc-analyze | `/qc-plan {UC-ID}` (
|
|
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ử lý 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
|
|
838
|
-
| /qc-review (test-case) | `/qc-run-test {UC-ID}`
|
|
839
|
-
| /qc-run-test | `/qc-report {UC-ID}`
|
|
840
|
-
| /qc-review (script) | `/qc-report {UC-ID}`
|
|
841
|
-
| /qc-report | `/validate-traces {UC-ID}`
|
|
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}`
|
|
844
|
-
| /generate-code |
|
|
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}`
|
|
848
|
-
| /review-code | `/dev-smoke-test {UC-ID}`
|
|
849
|
-
| /dev-smoke-test |
|
|
850
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`;
|
|
851
|
-
| /fix-bug |
|
|
852
|
-
| /debug | `/fix-bug {ticket-id}`
|
|
853
|
-
| /report-bug |
|
|
854
|
-
| /propose-scenario |
|
|
855
|
-
| /learn |
|
|
856
|
-
| /sync | `/validate-traces`
|
|
857
|
-
| /update-framework | Review `git diff .agent/`, commit; `/sync`
|
|
858
|
-
|
|
859
|
-
|
|
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 và 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 và 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
|
|
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
|
|
866
|
-
Next : {
|
|
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
|
-
*(
|
|
868
|
+
*(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
|
|
869
869
|
|