@longph2102/v-flow 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +265 -0
- package/CHANGELOG.md +318 -0
- package/LICENSE +21 -0
- package/README.md +326 -0
- package/agents/ba-agent.md +437 -0
- package/agents/ba-critic-agent.md +156 -0
- package/agents/ba-to-ptyc-agent.md +112 -0
- package/agents/bugfix-analyst-agent.md +221 -0
- package/agents/constitute-agent.md +155 -0
- package/agents/help-agent.md +168 -0
- package/agents/implement-agent.md +220 -0
- package/agents/import-ba-docs-agent.md +164 -0
- package/agents/master-check-agent.md +228 -0
- package/agents/metrics-agent.md +180 -0
- package/agents/operations-agent.md +123 -0
- package/agents/plan-agent.md +218 -0
- package/agents/prototype-agent.md +191 -0
- package/agents/retrospective-agent.md +196 -0
- package/agents/review-agent.md +210 -0
- package/agents/sprint-agent.md +191 -0
- package/agents/status-agent.md +186 -0
- package/agents/sync-agent.md +201 -0
- package/agents/test-agent.md +166 -0
- package/agents/understand-agent.md +339 -0
- package/cli/commands/check.js +96 -0
- package/cli/commands/dev-quiz.js +107 -0
- package/cli/commands/doctor.js +348 -0
- package/cli/commands/feature.js +259 -0
- package/cli/commands/hooks.js +163 -0
- package/cli/commands/init.js +189 -0
- package/cli/commands/log.js +199 -0
- package/cli/commands/plugin.js +230 -0
- package/cli/commands/score-card.js +203 -0
- package/cli/commands/status.js +269 -0
- package/cli/commands/sync.js +59 -0
- package/cli/commands/upgrade.js +150 -0
- package/cli/commands/validate.js +1259 -0
- package/cli/commands/watch.js +151 -0
- package/cli/index.js +46 -0
- package/cli/lib/ac-test-gate.js +89 -0
- package/cli/lib/activity-log.js +209 -0
- package/cli/lib/cli-error.js +183 -0
- package/cli/lib/constitution-lint.js +561 -0
- package/cli/lib/dev-quiz-grade.js +127 -0
- package/cli/lib/governance.js +78 -0
- package/cli/lib/hook-targets.js +167 -0
- package/cli/lib/i18n.js +375 -0
- package/cli/lib/knowledge-oracle.js +379 -0
- package/cli/lib/logger.js +203 -0
- package/cli/lib/module-card-lint.js +304 -0
- package/cli/lib/module-card-score.js +223 -0
- package/cli/lib/plugins.js +481 -0
- package/cli/lib/scanner.js +692 -0
- package/cli/lib/sync-core.js +232 -0
- package/cli/lib/sync-targets.js +84 -0
- package/cli/lib/templates.js +268 -0
- package/cli/lib/yaml-parser.js +203 -0
- package/commands/v.ba-critic.md +101 -0
- package/commands/v.ba-to-ptyc.md +71 -0
- package/commands/v.bugfix.md +86 -0
- package/commands/v.check.md +131 -0
- package/commands/v.constitute.md +87 -0
- package/commands/v.constitution.md +84 -0
- package/commands/v.fork.md +127 -0
- package/commands/v.help.md +73 -0
- package/commands/v.hotfix.md +200 -0
- package/commands/v.implement.md +92 -0
- package/commands/v.import-ba-docs.md +222 -0
- package/commands/v.metrics.md +74 -0
- package/commands/v.operations.md +70 -0
- package/commands/v.plan.md +78 -0
- package/commands/v.prototype.md +121 -0
- package/commands/v.quickfix.md +169 -0
- package/commands/v.retrospective.md +80 -0
- package/commands/v.review.md +78 -0
- package/commands/v.rewind.md +127 -0
- package/commands/v.specify.md +118 -0
- package/commands/v.sprint.md +75 -0
- package/commands/v.status.md +62 -0
- package/commands/v.sync.md +81 -0
- package/commands/v.test.md +67 -0
- package/commands/v.understand.md +112 -0
- package/package.json +65 -0
- package/skills/_shared/constitution-reader/SKILL.md +109 -0
- package/skills/_shared/constitution-reader/config.json +52 -0
- package/skills/_shared/constitution-reader/examples/good/b1-phase-output.md +48 -0
- package/skills/_shared/constitution-reader/gotchas.md +46 -0
- package/skills/_shared/context-reader/SKILL.md +111 -0
- package/skills/_shared/context-reader/config.json +54 -0
- package/skills/_shared/context-reader/examples/good/legacy-nodejs-output.md +35 -0
- package/skills/_shared/context-reader/gotchas.md +49 -0
- package/skills/_shared/ears-notation/SKILL.md +63 -0
- package/skills/_shared/ears-notation/config.json +55 -0
- package/skills/_shared/ears-notation/examples/good/plan-test-interpretation.md +29 -0
- package/skills/_shared/ears-notation/gotchas.md +43 -0
- package/skills/check/cross-validator/SKILL.md +206 -0
- package/skills/check/cross-validator/config.json +33 -0
- package/skills/check/cross-validator/examples/good/validation-report-pass-with-concerns.md +105 -0
- package/skills/check/cross-validator/gotchas.md +43 -0
- package/skills/implement/constitution-enforcer/SKILL.md +134 -0
- package/skills/implement/constitution-enforcer/config.json +16 -0
- package/skills/implement/constitution-enforcer/examples/bad/vague-report.md +42 -0
- package/skills/implement/constitution-enforcer/examples/good/compliance-report.md +57 -0
- package/skills/implement/constitution-enforcer/gotchas.md +26 -0
- package/skills/implement/constitution-enforcer/scripts/check-constitution.sh +88 -0
- package/skills/implement/no-go-zone-guard/SKILL.md +173 -0
- package/skills/implement/no-go-zone-guard/config.json +28 -0
- package/skills/implement/no-go-zone-guard/examples/good/adapter-workaround.md +46 -0
- package/skills/implement/no-go-zone-guard/gotchas.md +27 -0
- package/skills/implement/no-go-zone-guard/scripts/check-nogo-zones.sh +148 -0
- package/skills/implement/no-go-zone-guard/scripts/nogo-precommit.sh +96 -0
- package/skills/implement/tdd-driver/SKILL.md +159 -0
- package/skills/implement/tdd-driver/config.json +33 -0
- package/skills/implement/tdd-driver/examples/good/tdd-cycle-product-repo.md +81 -0
- package/skills/implement/tdd-driver/gotchas.md +34 -0
- package/skills/metrics/metrics-collector/SKILL.md +133 -0
- package/skills/metrics/metrics-collector/config.json +16 -0
- package/skills/metrics/metrics-collector/examples/bad/incomplete-report.md +48 -0
- package/skills/metrics/metrics-collector/examples/good/full-metrics-report.md +101 -0
- package/skills/metrics/metrics-collector/gotchas.md +26 -0
- package/skills/operations/incident-runbook/SKILL.md +167 -0
- package/skills/operations/incident-runbook/config.json +21 -0
- package/skills/operations/incident-runbook/examples/bad/vague-incident-report.md +48 -0
- package/skills/operations/incident-runbook/examples/good/p1-hotfix-response.md +119 -0
- package/skills/operations/incident-runbook/gotchas.md +26 -0
- package/skills/plan/architecture-designer/SKILL.md +228 -0
- package/skills/plan/architecture-designer/config.json +32 -0
- package/skills/plan/architecture-designer/examples/bad/vague-plan.md +62 -0
- package/skills/plan/architecture-designer/examples/good/expand-contract-migration.md +56 -0
- package/skills/plan/architecture-designer/examples/good/plan-structure.md +58 -0
- package/skills/plan/architecture-designer/gotchas.md +45 -0
- package/skills/plan/task-breakdown/SKILL.md +208 -0
- package/skills/plan/task-breakdown/config.json +26 -0
- package/skills/plan/task-breakdown/examples/bad/vague-tasks.md +77 -0
- package/skills/plan/task-breakdown/examples/good/spike-clarify-tasks.md +66 -0
- package/skills/plan/task-breakdown/examples/good/tasks-login-feature.md +111 -0
- package/skills/plan/task-breakdown/gotchas.md +39 -0
- package/skills/prototype/LOGIC.md +240 -0
- package/skills/prototype/SKILL.md +185 -0
- package/skills/prototype/UI.md +407 -0
- package/skills/prototype/config.json +104 -0
- package/skills/prototype/examples/bad/prototype-notes.md +68 -0
- package/skills/prototype/examples/good/prototype-notes-ui.md +109 -0
- package/skills/prototype/examples/good/prototype-notes.md +67 -0
- package/skills/prototype/gotchas.md +128 -0
- package/skills/prototype/scripts/check-flow-state.ps1 +112 -0
- package/skills/prototype/scripts/check-flow-state.sh +104 -0
- package/skills/prototype/scripts/check-prototype-cleanup.ps1 +124 -0
- package/skills/prototype/scripts/check-prototype-cleanup.sh +109 -0
- package/skills/prototype/scripts/check-prototype-notes.ps1 +107 -0
- package/skills/prototype/scripts/check-prototype-notes.sh +102 -0
- package/skills/review/adversarial-reviewer/SKILL.md +137 -0
- package/skills/review/adversarial-reviewer/config.json +32 -0
- package/skills/review/adversarial-reviewer/examples/good/review-report-template.md +56 -0
- package/skills/review/adversarial-reviewer/gotchas.md +46 -0
- package/skills/review/adversarial-reviewer/scripts/quick-security-scan.sh +52 -0
- package/skills/specify/ba-bpmn-doc-gen/SKILL.md +108 -0
- package/skills/specify/ba-bpmn-doc-gen/reference/reference-bpmn-generation.md +528 -0
- package/skills/specify/ba-bpmn-doc-gen/reference/reference-drawio-flowchart.md +466 -0
- package/skills/specify/ba-critic/SKILL.md +172 -0
- package/skills/specify/ba-critic/config.json +32 -0
- package/skills/specify/ba-critic/examples/good/critic-report-round1.md +51 -0
- package/skills/specify/ba-critic/gotchas.md +40 -0
- package/skills/specify/ba-critic/scripts/check-spec-quality.sh +72 -0
- package/skills/specify/ba-doc-generator/SKILL.md +102 -0
- package/skills/specify/ba-doc-generator/references/template-clevel.md +84 -0
- package/skills/specify/ba-doc-generator/references/template-compliance.md +83 -0
- package/skills/specify/ba-doc-generator/references/template-dev.md +138 -0
- package/skills/specify/ba-doc-generator/references/template-partner.md +167 -0
- package/skills/specify/ba-doc-generator/references/template-pm.md +92 -0
- package/skills/specify/ba-doc-generator/references/template-review.md +114 -0
- package/skills/specify/ba-doc-generator/references/template-tester.md +108 -0
- package/skills/specify/ba-doc-generator/references/template-user.md +98 -0
- package/skills/specify/bugfix-analyst/SKILL.md +296 -0
- package/skills/specify/bugfix-analyst/config.json +41 -0
- package/skills/specify/bugfix-analyst/examples/bad/common-mistakes.md +71 -0
- package/skills/specify/bugfix-analyst/examples/good/email-validation-bugfix.md +53 -0
- package/skills/specify/bugfix-analyst/gotchas.md +51 -0
- package/skills/specify/ears-writer/SKILL.md +129 -0
- package/skills/specify/ears-writer/config.json +20 -0
- package/skills/specify/ears-writer/examples/bad/common-mistakes.md +17 -0
- package/skills/specify/ears-writer/examples/good/login-requirements.md +41 -0
- package/skills/specify/ears-writer/gotchas.md +43 -0
- package/skills/specify/ears-writer/scripts/check-ears-compliance.sh +51 -0
- package/skills/test/test-case-generator/SKILL.md +161 -0
- package/skills/test/test-case-generator/config.json +33 -0
- package/skills/test/test-case-generator/examples/good/test-cases-login.md +104 -0
- package/skills/test/test-case-generator/gotchas.md +43 -0
- package/skills/understand/ba-docs-scanner/SKILL.md +239 -0
- package/skills/understand/ba-docs-scanner/config.json +47 -0
- package/skills/understand/ba-docs-scanner/examples/good/work-order-br-extract.md +28 -0
- package/skills/understand/ba-docs-scanner/gotchas.md +44 -0
- package/skills/understand/ba-docs-scanner/merge-rules.md +47 -0
- package/skills/understand/codebase-scanner/SKILL.md +260 -0
- package/skills/understand/codebase-scanner/config.json +56 -0
- package/skills/understand/codebase-scanner/examples/good/menu-module-output.md +44 -0
- package/skills/understand/codebase-scanner/gotchas.md +42 -0
- package/skills/understand/codebase-scanner/scripts/scan-project-structure.sh +64 -0
- package/templates/DESIGN.md +456 -0
- package/templates/agent-command-template.yaml +240 -0
- package/templates/agent-config-template.md +170 -0
- package/templates/agent-definition-template.md +145 -0
- package/templates/agent-metrics-template.md +150 -0
- package/templates/api-contract-template.md +72 -0
- package/templates/bugfix-report-template.md +195 -0
- package/templates/bugfix-spec-template.md +134 -0
- package/templates/code-review-report-template.md +119 -0
- package/templates/constitution-template.md +234 -0
- package/templates/context-template.md +94 -0
- package/templates/data-model-template.md +95 -0
- package/templates/decision-log-template.md +92 -0
- package/templates/flow-state-template.yaml +208 -0
- package/templates/github/workflows/v-flow-validate.yml +30 -0
- package/templates/knowledge/adr-template.md +70 -0
- package/templates/knowledge/api-contract-template.md +140 -0
- package/templates/knowledge/domain-glossary.md +29 -0
- package/templates/knowledge/golden-tests-readme.md +115 -0
- package/templates/knowledge/lessons-learned.md +41 -0
- package/templates/knowledge/patterns.md +103 -0
- package/templates/module-card/SKILL.md +85 -0
- package/templates/module-card/api-specs.md +96 -0
- package/templates/module-card/business-quiz.md +119 -0
- package/templates/module-card/cross-service.md +125 -0
- package/templates/module-card/db.md +85 -0
- package/templates/module-card/dev-quiz.md +62 -0
- package/templates/module-card/permissions.md +83 -0
- package/templates/module-card/state-diagram.md +64 -0
- package/templates/module-card/tech-context.md +90 -0
- package/templates/module-card/ui-flows.md +91 -0
- package/templates/module-card/use-cases.md +142 -0
- package/templates/module-template.yaml +161 -0
- package/templates/operations-report-template.md +108 -0
- package/templates/plan-template.md +308 -0
- package/templates/prototype-notes-template.md +116 -0
- package/templates/ptyc/PTYC.template.docx +0 -0
- package/templates/ptyc/ptyc.meta.example.yaml +44 -0
- package/templates/retrospective-report-template.md +136 -0
- package/templates/security-review-template.md +84 -0
- package/templates/session-template.md +167 -0
- package/templates/spec-review-log-template.md +75 -0
- package/templates/spec-template.md +229 -0
- package/templates/sprint-status-template.md +101 -0
- package/templates/tasks-template.md +275 -0
- package/templates/test-cases-template.md +124 -0
- package/templates/ux-checklist-template.md +79 -0
- package/templates/validation-report-template.md +125 -0
- package/templates/vflow-config-template.yaml +22 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# Template: Bugfix Report — Báo cáo tổng kết Bug Fix
|
|
2
|
+
|
|
3
|
+
> Được tạo sau khi fix hoàn tất và review APPROVED — Phase R.1
|
|
4
|
+
> Mục đích: Trả lời 6 câu hỏi để check và review lại bất kỳ lúc nào
|
|
5
|
+
> Bug ID: [BUG-ID]
|
|
6
|
+
> Ngày fix: [YYYY-MM-DD]
|
|
7
|
+
> Người fix: [Agent/Dev]
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Bug là gì?
|
|
12
|
+
|
|
13
|
+
### Mô tả bug
|
|
14
|
+
<!-- 2-3 câu tóm tắt bug -->
|
|
15
|
+
|
|
16
|
+
### Reproduction Steps
|
|
17
|
+
1. [Step 1]
|
|
18
|
+
2. [Step 2]
|
|
19
|
+
3. [Step 3]
|
|
20
|
+
|
|
21
|
+
### Severity & Impact
|
|
22
|
+
| | Giá trị |
|
|
23
|
+
|---|---|
|
|
24
|
+
| **Severity** | P1 / P2 / P3 / P4 |
|
|
25
|
+
| **Affected Users** | [mô tả ảnh hưởng] |
|
|
26
|
+
| **Affected Module** | [tên module/domain] |
|
|
27
|
+
|
|
28
|
+
### Behavior cũ (lỗi)
|
|
29
|
+
- **BUG-B01**: Khi [điều kiện], hệ thống [hành vi sai]
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. Nguyên nhân gốc là gì?
|
|
34
|
+
|
|
35
|
+
### Root Cause
|
|
36
|
+
<!-- Mô tả nguyên nhân GỐC — KHÔNG phải symptom -->
|
|
37
|
+
<!-- "API trả 500" là symptom. "SQL không escape ký tự đặc biệt" là root cause -->
|
|
38
|
+
|
|
39
|
+
| | Giá trị |
|
|
40
|
+
|---|---|
|
|
41
|
+
| **Root Cause** | [Mô tả nguyên nhân gốc — cụ thể] |
|
|
42
|
+
| **Confidence** | high / medium / low |
|
|
43
|
+
| **Bug Location** | [file:line — vị trí chính xác code gây bug] |
|
|
44
|
+
|
|
45
|
+
### Why It Happened
|
|
46
|
+
<!-- Tại sao bug xuất hiện — thiếu validation, logic error, race condition, missing test, v.v. -->
|
|
47
|
+
|
|
48
|
+
### Contributing Factors
|
|
49
|
+
<!-- Yếu tố góp phần — nếu có: thiếu test, code review miss, spec không rõ, v.v. -->
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 3. Giải pháp sửa là gì?
|
|
54
|
+
|
|
55
|
+
### Fix Approach
|
|
56
|
+
<!-- Mô tả APPROACH tổng thể — không chi tiết code -->
|
|
57
|
+
|
|
58
|
+
### Behavior mới (đúng)
|
|
59
|
+
- **BUG-E01**: Khi [điều kiện], hệ thống phải [hành vi đúng]
|
|
60
|
+
|
|
61
|
+
### Behavior giữ nguyên (không thay đổi)
|
|
62
|
+
- **BUG-U01**: Khi [điều kiện], hệ thống phải TIẾP TỤC [behavior giữ nguyên]
|
|
63
|
+
- **BUG-U02**: Khi [điều kiện], hệ thống phải TIẾP TỤC [behavior giữ nguyên]
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 4. Đã sửa như thế nào?
|
|
68
|
+
|
|
69
|
+
### Thay đổi chi tiết
|
|
70
|
+
|
|
71
|
+
| # | Thay đổi | Lý do |
|
|
72
|
+
|---|----------|-------|
|
|
73
|
+
| 1 | [Mô tả thay đổi cụ thể 1] | [Tại sao cần thay đổi này] |
|
|
74
|
+
| 2 | [Mô tả thay đổi cụ thể 2] | [Tại sao] |
|
|
75
|
+
|
|
76
|
+
### Code Changes Summary
|
|
77
|
+
<!-- Tóm tắt thay đổi logic chính — không paste full code -->
|
|
78
|
+
```
|
|
79
|
+
Trước: [logic cũ — 1-2 dòng tóm tắt]
|
|
80
|
+
Sau: [logic mới — 1-2 dòng tóm tắt]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Tests đã viết
|
|
84
|
+
|
|
85
|
+
| Tier | Test ID | Mô tả | Kết quả |
|
|
86
|
+
|------|---------|--------|---------|
|
|
87
|
+
| T1 🔴 | TC-R01 | [Test reproduce bug] | ✅ PASS (sau fix) |
|
|
88
|
+
| T2 🟢 | TC-G01 | [Test verify fix] | ✅ PASS |
|
|
89
|
+
| T3 🛡️ | TC-P01 | [Test regression prevention] | ✅ PASS |
|
|
90
|
+
| T3 🛡️ | TC-P02 | [Test regression prevention] | ✅ PASS |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 5. File nào đã sửa?
|
|
95
|
+
|
|
96
|
+
### Files Modified (Implementation)
|
|
97
|
+
|
|
98
|
+
| # | File | Loại thay đổi | Lines changed |
|
|
99
|
+
|---|------|---------------|---------------|
|
|
100
|
+
| 1 | [path/to/file1] | Modified | [+N, -N] |
|
|
101
|
+
| 2 | [path/to/file2] | Modified | [+N, -N] |
|
|
102
|
+
|
|
103
|
+
### Files Created (Tests)
|
|
104
|
+
|
|
105
|
+
| # | File | Mô tả |
|
|
106
|
+
|---|------|-------|
|
|
107
|
+
| 1 | [path/to/test1] | [Test gì] |
|
|
108
|
+
|
|
109
|
+
### Files NOT Modified (Confirmed unchanged)
|
|
110
|
+
|
|
111
|
+
| # | File | Lý do giữ nguyên |
|
|
112
|
+
|---|------|-------------------|
|
|
113
|
+
| 1 | [path/to/file3] | [Nằm trong BUG-U scope, không cần thay đổi] |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 6. File nào bị ảnh hưởng?
|
|
118
|
+
|
|
119
|
+
### Direct Impact (files sửa trực tiếp)
|
|
120
|
+
|
|
121
|
+
| File | Ảnh hưởng | Đã test? |
|
|
122
|
+
|------|-----------|----------|
|
|
123
|
+
| [file1] | [mô tả ảnh hưởng] | ✅ T2 |
|
|
124
|
+
| [file2] | [mô tả ảnh hưởng] | ✅ T2 |
|
|
125
|
+
|
|
126
|
+
### Indirect Impact (files phụ thuộc / callers)
|
|
127
|
+
|
|
128
|
+
| File | Quan hệ | Ảnh hưởng | Đã test? |
|
|
129
|
+
|------|---------|-----------|----------|
|
|
130
|
+
| [file3] | Calls [function đã sửa] | [mô tả ảnh hưởng] | ✅ T3 |
|
|
131
|
+
| [file4] | Imports [module đã sửa] | [mô tả ảnh hưởng] | ✅ T3 |
|
|
132
|
+
|
|
133
|
+
### No Impact (confirmed safe)
|
|
134
|
+
|
|
135
|
+
| File/Module | Lý do không ảnh hưởng |
|
|
136
|
+
|-------------|----------------------|
|
|
137
|
+
| [module X] | Không depend vào code đã sửa |
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 7. Verification Summary
|
|
142
|
+
|
|
143
|
+
### Test Results
|
|
144
|
+
|
|
145
|
+
| Loại | Passed | Total | Coverage |
|
|
146
|
+
|------|--------|-------|----------|
|
|
147
|
+
| T1 (Red → Green) | [N] | [N] | 100% |
|
|
148
|
+
| T2 (Verify fix) | [N] | [N] | 100% |
|
|
149
|
+
| T3 (No regression) | [N] | [N] | 100% |
|
|
150
|
+
| Full test suite | [N] | [N] | [XX]% |
|
|
151
|
+
|
|
152
|
+
### Acceptance Criteria
|
|
153
|
+
|
|
154
|
+
| AC | Mô tả | Kết quả |
|
|
155
|
+
|----|-------|---------|
|
|
156
|
+
| AC-1 | Bug behavior không còn xảy ra | ✅ / ❌ |
|
|
157
|
+
| AC-2 | Expected behavior hoạt động đúng | ✅ / ❌ |
|
|
158
|
+
| AC-3 | Unchanged behaviors vẫn hoạt động | ✅ / ❌ |
|
|
159
|
+
| AC-4 | Tất cả 3-tier tests pass | ✅ / ❌ |
|
|
160
|
+
| AC-5 | Full test suite pass | ✅ / ❌ |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 8. Review Decision
|
|
165
|
+
|
|
166
|
+
| | Kết quả |
|
|
167
|
+
|---|---|
|
|
168
|
+
| **Review Verdict** | ✅ APPROVED / ⚠️ APPROVED WITH NOTES / ❌ CHANGES REQUIRED |
|
|
169
|
+
| **Reviewed by** | [Agent/Human] |
|
|
170
|
+
| **Review date** | [YYYY-MM-DD] |
|
|
171
|
+
|
|
172
|
+
### Notes (nếu APPROVED WITH NOTES)
|
|
173
|
+
<!-- Tech debt, follow-up tasks, monitoring needed -->
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 9. Lessons Learned (Optional)
|
|
178
|
+
|
|
179
|
+
### Cần cải thiện
|
|
180
|
+
<!-- Nếu bug có thể tránh được — làm sao? -->
|
|
181
|
+
|
|
182
|
+
| Cải thiện | Loại | Action |
|
|
183
|
+
|-----------|------|--------|
|
|
184
|
+
| [Thêm validation cho input X] | Prevention | [tạo task / update constitution] |
|
|
185
|
+
| [Thêm test cho case Y] | Detection | [tạo test / update test suite] |
|
|
186
|
+
|
|
187
|
+
### Cập nhật Knowledge Base
|
|
188
|
+
- [ ] Thêm vào `knowledge/lessons-learned/` nếu có pattern mới
|
|
189
|
+
- [ ] Cập nhật `constitution.md` nếu cần rule mới
|
|
190
|
+
- [ ] Cập nhật `context.md` nếu phát hiện No-Go Zone mới
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
> **Generated by**: Bugfix Flow (`/v.bugfix`)
|
|
195
|
+
> **Template**: `templates/bugfix-report-template.md`
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Template: Bugfix Spec — Phân tích Bug có cấu trúc
|
|
2
|
+
|
|
3
|
+
> 📌 **Lấy cảm hứng từ Kiro Bugfix Specs** — 3-behavior model + root cause analysis
|
|
4
|
+
> Được tạo bởi **Bugfix Analyst Agent** — Phase S.1
|
|
5
|
+
> Bug ID: [BUG-ID]
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Bug Report
|
|
10
|
+
|
|
11
|
+
### 1.1 Mô tả ngắn
|
|
12
|
+
<!-- 1-2 câu mô tả bug -->
|
|
13
|
+
|
|
14
|
+
### 1.2 Reproduction Steps
|
|
15
|
+
1. [Step 1]
|
|
16
|
+
2. [Step 2]
|
|
17
|
+
3. [Step 3]
|
|
18
|
+
|
|
19
|
+
### 1.3 Environment
|
|
20
|
+
- **OS/Browser/Device**: [...]
|
|
21
|
+
- **App version/commit**: [...]
|
|
22
|
+
- **Reproduced?**: ✅ Có / ❌ Chưa reproduce được
|
|
23
|
+
|
|
24
|
+
### 1.4 Evidence
|
|
25
|
+
<!-- Screenshots, logs, error messages -->
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Bugfix Analysis (3-Behavior Model)
|
|
30
|
+
|
|
31
|
+
### 2.1 Current Behavior (Defect) 🔴
|
|
32
|
+
<!-- EARS notation: Khi [điều kiện], hệ thống [hành vi sai hiện tại] -->
|
|
33
|
+
|
|
34
|
+
- **BUG-B01**: Khi [điều kiện cụ thể], hệ thống [hành vi sai]
|
|
35
|
+
- **BUG-B02**: [nếu có thêm defect — optional]
|
|
36
|
+
|
|
37
|
+
### 2.2 Expected Behavior (Correct) 🟢
|
|
38
|
+
<!-- EARS notation: Khi [điều kiện], hệ thống phải [hành vi đúng] -->
|
|
39
|
+
<!-- BUG-E phải mapping 1:1 với BUG-B -->
|
|
40
|
+
|
|
41
|
+
- **BUG-E01**: Khi [điều kiện cụ thể], hệ thống phải [hành vi đúng]
|
|
42
|
+
- **BUG-E02**: [mapping với BUG-B02 — nếu có]
|
|
43
|
+
|
|
44
|
+
### 2.3 Unchanged Behavior (Regression Prevention) 🛡️
|
|
45
|
+
<!-- EARS notation: Khi [điều kiện], hệ thống phải TIẾP TỤC [hành vi giữ nguyên] -->
|
|
46
|
+
<!-- Tối thiểu 2 BUG-U -->
|
|
47
|
+
|
|
48
|
+
- **BUG-U01**: Khi [điều kiện liên quan], hệ thống phải TIẾP TỤC [behavior phải giữ nguyên]
|
|
49
|
+
- **BUG-U02**: Khi [điều kiện khác], hệ thống phải TIẾP TỤC [behavior phải giữ nguyên]
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 3. Root Cause Analysis
|
|
54
|
+
|
|
55
|
+
### 3.1 Root Cause Hypothesis
|
|
56
|
+
- **Nguyên nhân gốc**: [Mô tả tại sao bug xảy ra — KHÔNG phải symptom]
|
|
57
|
+
- **Confidence**: high | medium | low
|
|
58
|
+
- **Evidence**: [Dẫn chứng cụ thể — log, code trace, test result]
|
|
59
|
+
|
|
60
|
+
### 3.2 Affected Code
|
|
61
|
+
| File | Line(s) | Mô tả vấn đề |
|
|
62
|
+
|------|---------|---------------|
|
|
63
|
+
| [path/to/file] | [L-xx] | [vấn đề cụ thể trong code] |
|
|
64
|
+
|
|
65
|
+
### 3.3 Why It Happened
|
|
66
|
+
<!-- Giải thích nguyên nhân sâu: thiếu validation, logic sai, race condition, v.v. -->
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 4. Scope
|
|
71
|
+
|
|
72
|
+
### 4.1 Files cần thay đổi
|
|
73
|
+
- [ ] [file 1] — [mô tả change]
|
|
74
|
+
- [ ] [file 2] — [mô tả change]
|
|
75
|
+
|
|
76
|
+
### 4.2 Files KHÔNG được đụng (Constraints)
|
|
77
|
+
- [file/module] — [lý do không đụng]
|
|
78
|
+
|
|
79
|
+
### 4.3 No-Go Check
|
|
80
|
+
- [ ] Đã đọc `context.md`, không đụng No-Go Zones ✅
|
|
81
|
+
- [ ] Scope không lan rộng sang module không liên quan ✅
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 5. Test Plan (3-Tier)
|
|
86
|
+
|
|
87
|
+
### T1: Bug Reproducible (Red 🔴)
|
|
88
|
+
<!-- Test phải FAIL trước fix, PASS sau fix -->
|
|
89
|
+
- [ ] **TC-R01**: [Test reproduce BUG-B01]
|
|
90
|
+
- [ ] **TC-R02**: [Test reproduce BUG-B02 — nếu có]
|
|
91
|
+
|
|
92
|
+
### T2: Bug Fixed (Green 🟢)
|
|
93
|
+
<!-- Test phải PASS sau fix -->
|
|
94
|
+
- [ ] **TC-G01**: [Test verify BUG-E01]
|
|
95
|
+
- [ ] **TC-G02**: [Test verify BUG-E02 — nếu có]
|
|
96
|
+
|
|
97
|
+
### T3: No Regression (Protect 🛡️)
|
|
98
|
+
<!-- Test phải PASS cả trước VÀ sau fix -->
|
|
99
|
+
- [ ] **TC-P01**: [Test verify BUG-U01 vẫn đúng]
|
|
100
|
+
- [ ] **TC-P02**: [Test verify BUG-U02 vẫn đúng]
|
|
101
|
+
|
|
102
|
+
### Mapping Matrix
|
|
103
|
+
|
|
104
|
+
| Behavior | Test Tier | Test ID | Trước fix | Sau fix |
|
|
105
|
+
|----------|-----------|---------|-----------|---------|
|
|
106
|
+
| BUG-B01 | T1 (Red) | TC-R01 | ❌ FAIL | ✅ PASS |
|
|
107
|
+
| BUG-E01 | T2 (Green) | TC-G01 | ❌ FAIL | ✅ PASS |
|
|
108
|
+
| BUG-U01 | T3 (Protect) | TC-P01 | ✅ PASS | ✅ PASS |
|
|
109
|
+
| BUG-U02 | T3 (Protect) | TC-P02 | ✅ PASS | ✅ PASS |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 6. Acceptance Criteria
|
|
114
|
+
|
|
115
|
+
- [ ] **AC-1**: Current behavior (BUG-B*) không còn xảy ra
|
|
116
|
+
- [ ] **AC-2**: Expected behavior (BUG-E*) hoạt động đúng
|
|
117
|
+
- [ ] **AC-3**: Unchanged behaviors (BUG-U*) vẫn hoạt động
|
|
118
|
+
- [ ] **AC-4**: Tất cả tests 3-tier pass (T1 + T2 + T3)
|
|
119
|
+
- [ ] **AC-5**: Full test suite pass (no regression bên ngoài)
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 7. Status
|
|
124
|
+
|
|
125
|
+
| Thông tin | Giá trị |
|
|
126
|
+
|-----------|--------|
|
|
127
|
+
| **Severity** | P1 / P2 / P3 / P4 |
|
|
128
|
+
| **Spec Version** | v1.0 |
|
|
129
|
+
| **Trạng thái** | `Draft` / `Approved` |
|
|
130
|
+
| **Người approve** | [Tên] |
|
|
131
|
+
| **Ngày approve** | [YYYY-MM-DD] |
|
|
132
|
+
|
|
133
|
+
### Routing
|
|
134
|
+
- Human approve → Phase tiếp theo (Design hoặc Implement)
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Template: Code Review Report — Báo cáo Adversarial Review
|
|
2
|
+
|
|
3
|
+
> Được tạo bởi **Review Agent** — Phase R.1
|
|
4
|
+
> Feature: [TÊN FEATURE]
|
|
5
|
+
> Spec Version: [vX.Y]
|
|
6
|
+
> Ngày review: [YYYY-MM-DD]
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Kết quả tổng hợp
|
|
11
|
+
|
|
12
|
+
| | Kết quả |
|
|
13
|
+
|---|---|
|
|
14
|
+
| **PHÁN QUYẾT** | ✅ **APPROVED** / ⚠️ **APPROVED WITH NOTES** / ❌ **CHANGES REQUIRED** |
|
|
15
|
+
| **Spec Version** | vX.Y |
|
|
16
|
+
| **Issues tìm được** | [N] (bắt buộc ≥ 3) |
|
|
17
|
+
| **Concerns từ R.0 verified** | [N]/[N] |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 1. Spec Compliance — Code có đúng spec không?
|
|
22
|
+
|
|
23
|
+
| Requirement | Implemented? | Test? | Ghi chú |
|
|
24
|
+
|------------|:-----------:|:-----:|---------|
|
|
25
|
+
| REQ-U01 | ✅ / ❌ | ✅ / ❌ | |
|
|
26
|
+
| REQ-E01 | ✅ / ❌ | ✅ / ❌ | |
|
|
27
|
+
|
|
28
|
+
**Coverage**: [X/Y] requirements implemented → [XX]%
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 2. Architecture Compliance — Đúng plan không?
|
|
33
|
+
|
|
34
|
+
| Kiểm tra | Kết quả | Ghi chú |
|
|
35
|
+
|---------|---------|---------|
|
|
36
|
+
| Code theo architecture trong plan.md | ✅ / ❌ | |
|
|
37
|
+
| File paths khớp với plan.md | ✅ / ❌ | |
|
|
38
|
+
| Dependencies đúng plan | ✅ / ❌ | |
|
|
39
|
+
| Không có code ngoài scope | ✅ / ❌ | |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 3. Constitution Compliance
|
|
44
|
+
|
|
45
|
+
| Nguyên tắc | Tuân thủ? | Ghi chú |
|
|
46
|
+
|-----------|:--------:|---------|
|
|
47
|
+
| Naming convention | ✅ / ❌ | |
|
|
48
|
+
| Error handling pattern | ✅ / ❌ | |
|
|
49
|
+
| Testing standards | ✅ / ❌ | |
|
|
50
|
+
| Code documentation | ✅ / ❌ | |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 4. Code Quality
|
|
55
|
+
|
|
56
|
+
| Kiểm tra | Kết quả | Ghi chú |
|
|
57
|
+
|---------|---------|---------|
|
|
58
|
+
| No hardcoded values | ✅ / ❌ | |
|
|
59
|
+
| Proper error handling | ✅ / ❌ | |
|
|
60
|
+
| No code duplication | ✅ / ❌ | |
|
|
61
|
+
| Edge cases handled | ✅ / ❌ | |
|
|
62
|
+
| Performance acceptable | ✅ / ❌ | |
|
|
63
|
+
| Security concerns | ✅ / ❌ | |
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 5. Concerns Verification (từ R.0)
|
|
68
|
+
|
|
69
|
+
> Kiểm tra tất cả concerns từ `validation-report.md`
|
|
70
|
+
|
|
71
|
+
| Concern ID | Mô tả | Resolved? | Cách resolve |
|
|
72
|
+
|-----------|-------|:---------:|-------------|
|
|
73
|
+
| W-001 | [mô tả] | ✅ / ❌ | [cách giải quyết] |
|
|
74
|
+
| W-002 | [mô tả] | ✅ / ❌ | [cách giải quyết] |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 6. Issues Found (≥ 3 bắt buộc)
|
|
79
|
+
|
|
80
|
+
### 🔴 Critical — Block merge
|
|
81
|
+
*(Không có)* / Liệt kê nếu có:
|
|
82
|
+
- **[CR-001]** `file:line` — [Mô tả] → Fix: [Đề xuất]
|
|
83
|
+
|
|
84
|
+
### 🟠 Major — Block merge
|
|
85
|
+
*(Không có)* / Liệt kê nếu có:
|
|
86
|
+
- **[MJ-001]** `file:line` — [Mô tả] → Fix: [Đề xuất]
|
|
87
|
+
|
|
88
|
+
### 🟡 Minor — Nên fix
|
|
89
|
+
- **[MN-001]** `file:line` — [Mô tả] → Suggestion: [Đề xuất]
|
|
90
|
+
|
|
91
|
+
### 🔵 Suggestions — Nice to have
|
|
92
|
+
- **[SG-001]** [Gợi ý cải thiện]
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 7. Routing Decision
|
|
97
|
+
|
|
98
|
+
**PHÁN QUYẾT**: ✅ APPROVED / ⚠️ APPROVED WITH NOTES / ❌ CHANGES REQUIRED
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
# Dùng để cập nhật .flow-state.yaml
|
|
102
|
+
verdict: "APPROVED"
|
|
103
|
+
route_decision: "deploy" # deploy | fix_and_re_review | escalate
|
|
104
|
+
concerns_all_resolved: true
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Route cụ thể**:
|
|
108
|
+
|
|
109
|
+
| Verdict | → Làm gì tiếp |
|
|
110
|
+
|---------|---------------|
|
|
111
|
+
| APPROVED | 🚀 Deploy → `/v.retrospective` → `/v.metrics` |
|
|
112
|
+
| APPROVED_WITH_NOTES | 🚀 Deploy + track notes → `/v.retrospective` |
|
|
113
|
+
| CHANGES_REQUIRED | Fix issues → `/v.review` lại |
|
|
114
|
+
| CHANGES_REQUIRED (lần 3+) | Escalate → human review toàn bộ |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
> **Reviewer**: Review Agent
|
|
119
|
+
> **Principle**: ≥ 3 issues bắt buộc — không bao giờ "LGTM"
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Template: Constitution — Hiến pháp Dự án
|
|
2
|
+
|
|
3
|
+
> Tài liệu này thiết lập các nguyên tắc BẤT DI BẤT DỊCH cho dự án.
|
|
4
|
+
> Mọi Agent và thành viên đều phải tuân thủ.
|
|
5
|
+
|
|
6
|
+
## Thông tin dự án
|
|
7
|
+
|
|
8
|
+
| Mục | Giá trị |
|
|
9
|
+
|-----|--------|
|
|
10
|
+
| **Tên dự án** | [TÊN DỰ ÁN] |
|
|
11
|
+
| **Ngày tạo** | [YYYY-MM-DD] |
|
|
12
|
+
| **Phiên bản** | 1.0 |
|
|
13
|
+
| **Người tạo** | [Tech Lead / Architect] |
|
|
14
|
+
| **Lần cập nhật cuối** | [YYYY-MM-DD] |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 1. Nguyên tắc Kiến trúc
|
|
19
|
+
|
|
20
|
+
### 1.1 Architecture Pattern
|
|
21
|
+
<!-- Ví dụ: Clean Architecture, MVVM, MVC, Microservices... -->
|
|
22
|
+
- [ ] Mô tả architecture pattern được sử dụng
|
|
23
|
+
- [ ] Định nghĩa layer structure và dependency rules
|
|
24
|
+
|
|
25
|
+
### 1.2 State Management
|
|
26
|
+
<!-- Ví dụ: Riverpod, BLoC, Redux, Vuex... -->
|
|
27
|
+
- [ ] Framework/library quản lý state
|
|
28
|
+
|
|
29
|
+
### 1.3 Module Structure
|
|
30
|
+
<!-- Ví dụ: Feature-first, Layer-first... -->
|
|
31
|
+
- [ ] Cách tổ chức module/package
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 2. Quy chuẩn Code
|
|
36
|
+
|
|
37
|
+
### 2.1 Naming Convention
|
|
38
|
+
<!-- Ví dụ: camelCase cho biến, PascalCase cho class... -->
|
|
39
|
+
<!-- Thêm [LINT:naming] tag để tự động enforce: v-flow validate --constitution -->
|
|
40
|
+
- [ ] Quy tắc đặt tên biến, hàm, class
|
|
41
|
+
- [ ] Ngôn ngữ dùng cho naming (Tiếng Anh bắt buộc?)
|
|
42
|
+
<!-- Ví dụ lintable rule:
|
|
43
|
+
- [LINT:naming] Tất cả files phải dùng kebab-case: `my-component.js`
|
|
44
|
+
- [LINT:naming] Components phải dùng PascalCase
|
|
45
|
+
-->
|
|
46
|
+
|
|
47
|
+
### 2.2 Testing
|
|
48
|
+
<!-- Ví dụ: Unit test coverage ≥ 80%, mọi API phải có integration test... -->
|
|
49
|
+
<!-- Thêm [LINT:test] tag để tự động kiểm tra test coverage -->
|
|
50
|
+
- [ ] Yêu cầu test coverage tối thiểu
|
|
51
|
+
- [ ] Loại test bắt buộc
|
|
52
|
+
<!-- Ví dụ lintable rule:
|
|
53
|
+
- [LINT:test:warn] Mỗi module trong src/ phải có test file tương ứng
|
|
54
|
+
-->
|
|
55
|
+
|
|
56
|
+
### 2.3 Linting & Formatting
|
|
57
|
+
<!-- Ví dụ: ESLint, Prettier, dart analyze... -->
|
|
58
|
+
- [ ] Tool linting
|
|
59
|
+
- [ ] Quy tắc format
|
|
60
|
+
|
|
61
|
+
### 2.4 Documentation
|
|
62
|
+
<!-- Ví dụ: JSDoc cho public API, README cho mỗi module... -->
|
|
63
|
+
- [ ] Yêu cầu documentation
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 3. Quy chuẩn UI/UX
|
|
68
|
+
|
|
69
|
+
### 3.1 Design System
|
|
70
|
+
<!-- Ví dụ: Material Design, Custom Design Kit... -->
|
|
71
|
+
- [ ] Design system / Component library
|
|
72
|
+
|
|
73
|
+
### 3.2 Spacing & Layout
|
|
74
|
+
<!-- Ví dụ: Bội số 4px, Grid 12 columns... -->
|
|
75
|
+
- [ ] Hệ thống spacing
|
|
76
|
+
- [ ] Layout grid
|
|
77
|
+
|
|
78
|
+
### 3.3 Typography
|
|
79
|
+
<!-- Ví dụ: Font Inter, 5 cấp heading... -->
|
|
80
|
+
- [ ] Font family
|
|
81
|
+
- [ ] Heading hierarchy
|
|
82
|
+
|
|
83
|
+
### 3.4 Color Palette
|
|
84
|
+
<!-- Ví dụ: Primary #1A73E8, Secondary #34A853... -->
|
|
85
|
+
- [ ] Bảng màu chính
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 4. Quy chuẩn API & Backend
|
|
90
|
+
|
|
91
|
+
### 4.1 API Design
|
|
92
|
+
<!-- Ví dụ: RESTful, GraphQL, gRPC... -->
|
|
93
|
+
- [ ] Kiểu API
|
|
94
|
+
- [ ] Format request/response
|
|
95
|
+
|
|
96
|
+
### 4.2 Error Handling
|
|
97
|
+
<!-- Ví dụ: RFC 7807, custom error codes... -->
|
|
98
|
+
- [ ] Chuẩn error response
|
|
99
|
+
|
|
100
|
+
### 4.3 Authentication & Security
|
|
101
|
+
<!-- Ví dụ: JWT, OAuth2, mã hóa bcrypt... -->
|
|
102
|
+
- [ ] Cơ chế authentication
|
|
103
|
+
- [ ] Quy tắc bảo mật
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 5. Quy chuẩn DevOps
|
|
108
|
+
|
|
109
|
+
### 5.1 Version Control
|
|
110
|
+
<!-- Ví dụ: Git Flow, Trunk-based... -->
|
|
111
|
+
- [ ] Branching strategy
|
|
112
|
+
- [ ] Commit message convention
|
|
113
|
+
|
|
114
|
+
### 5.2 CI/CD
|
|
115
|
+
<!-- Ví dụ: GitHub Actions, Jenkins... -->
|
|
116
|
+
- [ ] Pipeline CI/CD
|
|
117
|
+
|
|
118
|
+
### 5.3 Environments
|
|
119
|
+
<!-- Ví dụ: dev, staging, production... -->
|
|
120
|
+
- [ ] Các môi trường và quy tắc deploy
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 6. Quy tắc đặc biệt
|
|
125
|
+
|
|
126
|
+
<!-- Các quy tắc riêng của tổ chức/dự án không nằm trong các mục trên -->
|
|
127
|
+
- [ ] [Thêm quy tắc đặc biệt nếu có]
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 7. AI Agent Configuration Defaults
|
|
132
|
+
|
|
133
|
+
### 7.1 Preferred Models
|
|
134
|
+
<!-- Ví dụ: GPT-4o cho reasoning, Claude 3.5 cho coding... -->
|
|
135
|
+
- [ ] Model mặc định cho pipeline
|
|
136
|
+
- [ ] Có cần on-premise/private deployment không?
|
|
137
|
+
|
|
138
|
+
### 7.2 Agent Guidelines
|
|
139
|
+
<!-- Ví dụ: Output phải bằng tiếng Việt, dùng template bắt buộc... -->
|
|
140
|
+
- [ ] Ngôn ngữ output cho agents
|
|
141
|
+
- [ ] Yêu cầu format output đặc biệt
|
|
142
|
+
|
|
143
|
+
### 7.3 Privacy & Security
|
|
144
|
+
<!-- Ví dụ: Không gửi source code lên cloud API, dùng API key riêng... -->
|
|
145
|
+
- [ ] Dữ liệu nhạy cảm — cần model on-premise?
|
|
146
|
+
- [ ] API key management
|
|
147
|
+
|
|
148
|
+
> 📎 Xem chi tiết cấu hình Agent: [agent-config-template.md](agent-config-template.md)
|
|
149
|
+
> 📎 Xem hướng dẫn chọn model: [model-selection-guide.md](../docs/model-selection-guide.md)
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 8. AI Compliance & Model Risk
|
|
154
|
+
|
|
155
|
+
### 8.1 Model Risk Policy
|
|
156
|
+
<!-- Ví dụ: Chỉ dùng models đã được approved, không dùng models mới chưa evaluate... -->
|
|
157
|
+
- [ ] Danh sách models được phép sử dụng (approved list)
|
|
158
|
+
- [ ] Quy trình evaluate model mới trước khi đưa vào pipeline
|
|
159
|
+
- [ ] Yêu cầu tối thiểu: model phải pass golden test dataset
|
|
160
|
+
|
|
161
|
+
### 8.2 Data Handling
|
|
162
|
+
<!-- Ví dụ: Không gửi customer data lên cloud API... -->
|
|
163
|
+
- [ ] Loại dữ liệu nào KHÔNG được gửi cho AI model?
|
|
164
|
+
- [ ] Yêu cầu anonymize/mask data trước khi gửi?
|
|
165
|
+
- [ ] Data retention policy cho AI interactions?
|
|
166
|
+
|
|
167
|
+
### 8.3 Audit Trail
|
|
168
|
+
<!-- Ví dụ: Lưu lại tất cả AI interactions cho compliance review... -->
|
|
169
|
+
- [ ] Lưu decision logs cho mỗi Agent run?
|
|
170
|
+
- [ ] Retention period cho logs?
|
|
171
|
+
- [ ] Ai có quyền access audit logs?
|
|
172
|
+
|
|
173
|
+
### 8.4 Responsible AI
|
|
174
|
+
- [ ] Bias testing — kiểm tra output có bias không?
|
|
175
|
+
- [ ] Fairness requirements cụ thể?
|
|
176
|
+
- [ ] Transparency — agent phải giải thích reasoning?
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 9. Spec Change Policy (Double-texting)
|
|
181
|
+
|
|
182
|
+
> Quy tắc xử lý khi spec thay đổi trong lúc pipeline đang hoạt động.
|
|
183
|
+
> Lấy cảm hứng từ LangGraph's concurrency policies: Enqueue, Reject, Interrupt, Rollback.
|
|
184
|
+
|
|
185
|
+
### 9.1 Policy theo Phase
|
|
186
|
+
|
|
187
|
+
| Phase đang chạy | Spec thay đổi loại | Policy | Hành động |
|
|
188
|
+
|---|---|---|---|
|
|
189
|
+
| **S.1** Specify | Bất kỳ | **Accept** | Spec đang draft — tự do sửa |
|
|
190
|
+
| **B.0** Plan + Test | Minor (typo, clarification) | **Enqueue** | Kết thúc Plan/Test → `/v.sync` |
|
|
191
|
+
| **B.0** Plan + Test | Major (requirement mới/xóa) | **Interrupt** | Dừng Plan/Test → bump version → `/v.sync` → restart B.0 |
|
|
192
|
+
| **R.0** Master Check | Bất kỳ | **Rollback** | Hủy Check → `/v.sync` → restart `/v.check` |
|
|
193
|
+
| **B.1** Implement | Minor (clarification, wording) | **Enqueue** | Hoàn thành task đang làm → `/v.sync` → tiếp tục implement |
|
|
194
|
+
| **B.1** Implement | Major (requirement thay đổi) | **Interrupt** | Dừng implement → ghi chú task đang dang dở → `/v.sync` → re-evaluate impacts |
|
|
195
|
+
| **B.1** Implement | Critical (requirement xóa) | **Rollback** | Dừng implement → `/v.sync` → `/v.check` → có thể cần re-plan |
|
|
196
|
+
| **R.1** Review | Bất kỳ | **Reject** | KHÔNG ĐỔI spec khi đang review — hoàn thành review trước |
|
|
197
|
+
|
|
198
|
+
### 9.2 Phân loại Spec Change
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
Minor:
|
|
202
|
+
- Typo, wording, clarification của requirement hiện có
|
|
203
|
+
- Thêm/sửa acceptance criteria mà không đổi intent
|
|
204
|
+
- → Chỉ cần /v.sync
|
|
205
|
+
|
|
206
|
+
Major:
|
|
207
|
+
- Thêm requirement mới
|
|
208
|
+
- Thay đổi behavior của requirement hiện có
|
|
209
|
+
- Thay đổi scope đáng kể
|
|
210
|
+
- → /v.sync + có thể cần re-plan hoặc re-check
|
|
211
|
+
|
|
212
|
+
Critical:
|
|
213
|
+
- Xóa requirement đang được implement
|
|
214
|
+
- Thay đổi kiến trúc (e.g., REST → GraphQL)
|
|
215
|
+
- → /v.sync + /v.check + có thể cần re-plan
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 9.3 Conflict Detection
|
|
219
|
+
|
|
220
|
+
Khi spec thay đổi, ghi vào `_session.md`:
|
|
221
|
+
|
|
222
|
+
```markdown
|
|
223
|
+
## ⚠️ Spec Change Detected
|
|
224
|
+
- **Spec version**: v1.2 → v1.3
|
|
225
|
+
- **Phase khi thay đổi**: B.1 (Implement, task T-007)
|
|
226
|
+
- **Change type**: Major — thêm REQ-E05 (email verification)
|
|
227
|
+
- **Policy áp dụng**: Interrupt
|
|
228
|
+
- **Impact**: T-007 (đang làm) + T-008 bị ảnh hưởng
|
|
229
|
+
- **Action**: Pause implement → /v.sync → re-evaluate
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
> **Lưu ý**: Constitution được tạo 1 lần và hiếm khi thay đổi. Mọi thay đổi phải được team review và đồng thuận.
|