@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.
Files changed (247) hide show
  1. package/AGENTS.md +265 -0
  2. package/CHANGELOG.md +318 -0
  3. package/LICENSE +21 -0
  4. package/README.md +326 -0
  5. package/agents/ba-agent.md +437 -0
  6. package/agents/ba-critic-agent.md +156 -0
  7. package/agents/ba-to-ptyc-agent.md +112 -0
  8. package/agents/bugfix-analyst-agent.md +221 -0
  9. package/agents/constitute-agent.md +155 -0
  10. package/agents/help-agent.md +168 -0
  11. package/agents/implement-agent.md +220 -0
  12. package/agents/import-ba-docs-agent.md +164 -0
  13. package/agents/master-check-agent.md +228 -0
  14. package/agents/metrics-agent.md +180 -0
  15. package/agents/operations-agent.md +123 -0
  16. package/agents/plan-agent.md +218 -0
  17. package/agents/prototype-agent.md +191 -0
  18. package/agents/retrospective-agent.md +196 -0
  19. package/agents/review-agent.md +210 -0
  20. package/agents/sprint-agent.md +191 -0
  21. package/agents/status-agent.md +186 -0
  22. package/agents/sync-agent.md +201 -0
  23. package/agents/test-agent.md +166 -0
  24. package/agents/understand-agent.md +339 -0
  25. package/cli/commands/check.js +96 -0
  26. package/cli/commands/dev-quiz.js +107 -0
  27. package/cli/commands/doctor.js +348 -0
  28. package/cli/commands/feature.js +259 -0
  29. package/cli/commands/hooks.js +163 -0
  30. package/cli/commands/init.js +189 -0
  31. package/cli/commands/log.js +199 -0
  32. package/cli/commands/plugin.js +230 -0
  33. package/cli/commands/score-card.js +203 -0
  34. package/cli/commands/status.js +269 -0
  35. package/cli/commands/sync.js +59 -0
  36. package/cli/commands/upgrade.js +150 -0
  37. package/cli/commands/validate.js +1259 -0
  38. package/cli/commands/watch.js +151 -0
  39. package/cli/index.js +46 -0
  40. package/cli/lib/ac-test-gate.js +89 -0
  41. package/cli/lib/activity-log.js +209 -0
  42. package/cli/lib/cli-error.js +183 -0
  43. package/cli/lib/constitution-lint.js +561 -0
  44. package/cli/lib/dev-quiz-grade.js +127 -0
  45. package/cli/lib/governance.js +78 -0
  46. package/cli/lib/hook-targets.js +167 -0
  47. package/cli/lib/i18n.js +375 -0
  48. package/cli/lib/knowledge-oracle.js +379 -0
  49. package/cli/lib/logger.js +203 -0
  50. package/cli/lib/module-card-lint.js +304 -0
  51. package/cli/lib/module-card-score.js +223 -0
  52. package/cli/lib/plugins.js +481 -0
  53. package/cli/lib/scanner.js +692 -0
  54. package/cli/lib/sync-core.js +232 -0
  55. package/cli/lib/sync-targets.js +84 -0
  56. package/cli/lib/templates.js +268 -0
  57. package/cli/lib/yaml-parser.js +203 -0
  58. package/commands/v.ba-critic.md +101 -0
  59. package/commands/v.ba-to-ptyc.md +71 -0
  60. package/commands/v.bugfix.md +86 -0
  61. package/commands/v.check.md +131 -0
  62. package/commands/v.constitute.md +87 -0
  63. package/commands/v.constitution.md +84 -0
  64. package/commands/v.fork.md +127 -0
  65. package/commands/v.help.md +73 -0
  66. package/commands/v.hotfix.md +200 -0
  67. package/commands/v.implement.md +92 -0
  68. package/commands/v.import-ba-docs.md +222 -0
  69. package/commands/v.metrics.md +74 -0
  70. package/commands/v.operations.md +70 -0
  71. package/commands/v.plan.md +78 -0
  72. package/commands/v.prototype.md +121 -0
  73. package/commands/v.quickfix.md +169 -0
  74. package/commands/v.retrospective.md +80 -0
  75. package/commands/v.review.md +78 -0
  76. package/commands/v.rewind.md +127 -0
  77. package/commands/v.specify.md +118 -0
  78. package/commands/v.sprint.md +75 -0
  79. package/commands/v.status.md +62 -0
  80. package/commands/v.sync.md +81 -0
  81. package/commands/v.test.md +67 -0
  82. package/commands/v.understand.md +112 -0
  83. package/package.json +65 -0
  84. package/skills/_shared/constitution-reader/SKILL.md +109 -0
  85. package/skills/_shared/constitution-reader/config.json +52 -0
  86. package/skills/_shared/constitution-reader/examples/good/b1-phase-output.md +48 -0
  87. package/skills/_shared/constitution-reader/gotchas.md +46 -0
  88. package/skills/_shared/context-reader/SKILL.md +111 -0
  89. package/skills/_shared/context-reader/config.json +54 -0
  90. package/skills/_shared/context-reader/examples/good/legacy-nodejs-output.md +35 -0
  91. package/skills/_shared/context-reader/gotchas.md +49 -0
  92. package/skills/_shared/ears-notation/SKILL.md +63 -0
  93. package/skills/_shared/ears-notation/config.json +55 -0
  94. package/skills/_shared/ears-notation/examples/good/plan-test-interpretation.md +29 -0
  95. package/skills/_shared/ears-notation/gotchas.md +43 -0
  96. package/skills/check/cross-validator/SKILL.md +206 -0
  97. package/skills/check/cross-validator/config.json +33 -0
  98. package/skills/check/cross-validator/examples/good/validation-report-pass-with-concerns.md +105 -0
  99. package/skills/check/cross-validator/gotchas.md +43 -0
  100. package/skills/implement/constitution-enforcer/SKILL.md +134 -0
  101. package/skills/implement/constitution-enforcer/config.json +16 -0
  102. package/skills/implement/constitution-enforcer/examples/bad/vague-report.md +42 -0
  103. package/skills/implement/constitution-enforcer/examples/good/compliance-report.md +57 -0
  104. package/skills/implement/constitution-enforcer/gotchas.md +26 -0
  105. package/skills/implement/constitution-enforcer/scripts/check-constitution.sh +88 -0
  106. package/skills/implement/no-go-zone-guard/SKILL.md +173 -0
  107. package/skills/implement/no-go-zone-guard/config.json +28 -0
  108. package/skills/implement/no-go-zone-guard/examples/good/adapter-workaround.md +46 -0
  109. package/skills/implement/no-go-zone-guard/gotchas.md +27 -0
  110. package/skills/implement/no-go-zone-guard/scripts/check-nogo-zones.sh +148 -0
  111. package/skills/implement/no-go-zone-guard/scripts/nogo-precommit.sh +96 -0
  112. package/skills/implement/tdd-driver/SKILL.md +159 -0
  113. package/skills/implement/tdd-driver/config.json +33 -0
  114. package/skills/implement/tdd-driver/examples/good/tdd-cycle-product-repo.md +81 -0
  115. package/skills/implement/tdd-driver/gotchas.md +34 -0
  116. package/skills/metrics/metrics-collector/SKILL.md +133 -0
  117. package/skills/metrics/metrics-collector/config.json +16 -0
  118. package/skills/metrics/metrics-collector/examples/bad/incomplete-report.md +48 -0
  119. package/skills/metrics/metrics-collector/examples/good/full-metrics-report.md +101 -0
  120. package/skills/metrics/metrics-collector/gotchas.md +26 -0
  121. package/skills/operations/incident-runbook/SKILL.md +167 -0
  122. package/skills/operations/incident-runbook/config.json +21 -0
  123. package/skills/operations/incident-runbook/examples/bad/vague-incident-report.md +48 -0
  124. package/skills/operations/incident-runbook/examples/good/p1-hotfix-response.md +119 -0
  125. package/skills/operations/incident-runbook/gotchas.md +26 -0
  126. package/skills/plan/architecture-designer/SKILL.md +228 -0
  127. package/skills/plan/architecture-designer/config.json +32 -0
  128. package/skills/plan/architecture-designer/examples/bad/vague-plan.md +62 -0
  129. package/skills/plan/architecture-designer/examples/good/expand-contract-migration.md +56 -0
  130. package/skills/plan/architecture-designer/examples/good/plan-structure.md +58 -0
  131. package/skills/plan/architecture-designer/gotchas.md +45 -0
  132. package/skills/plan/task-breakdown/SKILL.md +208 -0
  133. package/skills/plan/task-breakdown/config.json +26 -0
  134. package/skills/plan/task-breakdown/examples/bad/vague-tasks.md +77 -0
  135. package/skills/plan/task-breakdown/examples/good/spike-clarify-tasks.md +66 -0
  136. package/skills/plan/task-breakdown/examples/good/tasks-login-feature.md +111 -0
  137. package/skills/plan/task-breakdown/gotchas.md +39 -0
  138. package/skills/prototype/LOGIC.md +240 -0
  139. package/skills/prototype/SKILL.md +185 -0
  140. package/skills/prototype/UI.md +407 -0
  141. package/skills/prototype/config.json +104 -0
  142. package/skills/prototype/examples/bad/prototype-notes.md +68 -0
  143. package/skills/prototype/examples/good/prototype-notes-ui.md +109 -0
  144. package/skills/prototype/examples/good/prototype-notes.md +67 -0
  145. package/skills/prototype/gotchas.md +128 -0
  146. package/skills/prototype/scripts/check-flow-state.ps1 +112 -0
  147. package/skills/prototype/scripts/check-flow-state.sh +104 -0
  148. package/skills/prototype/scripts/check-prototype-cleanup.ps1 +124 -0
  149. package/skills/prototype/scripts/check-prototype-cleanup.sh +109 -0
  150. package/skills/prototype/scripts/check-prototype-notes.ps1 +107 -0
  151. package/skills/prototype/scripts/check-prototype-notes.sh +102 -0
  152. package/skills/review/adversarial-reviewer/SKILL.md +137 -0
  153. package/skills/review/adversarial-reviewer/config.json +32 -0
  154. package/skills/review/adversarial-reviewer/examples/good/review-report-template.md +56 -0
  155. package/skills/review/adversarial-reviewer/gotchas.md +46 -0
  156. package/skills/review/adversarial-reviewer/scripts/quick-security-scan.sh +52 -0
  157. package/skills/specify/ba-bpmn-doc-gen/SKILL.md +108 -0
  158. package/skills/specify/ba-bpmn-doc-gen/reference/reference-bpmn-generation.md +528 -0
  159. package/skills/specify/ba-bpmn-doc-gen/reference/reference-drawio-flowchart.md +466 -0
  160. package/skills/specify/ba-critic/SKILL.md +172 -0
  161. package/skills/specify/ba-critic/config.json +32 -0
  162. package/skills/specify/ba-critic/examples/good/critic-report-round1.md +51 -0
  163. package/skills/specify/ba-critic/gotchas.md +40 -0
  164. package/skills/specify/ba-critic/scripts/check-spec-quality.sh +72 -0
  165. package/skills/specify/ba-doc-generator/SKILL.md +102 -0
  166. package/skills/specify/ba-doc-generator/references/template-clevel.md +84 -0
  167. package/skills/specify/ba-doc-generator/references/template-compliance.md +83 -0
  168. package/skills/specify/ba-doc-generator/references/template-dev.md +138 -0
  169. package/skills/specify/ba-doc-generator/references/template-partner.md +167 -0
  170. package/skills/specify/ba-doc-generator/references/template-pm.md +92 -0
  171. package/skills/specify/ba-doc-generator/references/template-review.md +114 -0
  172. package/skills/specify/ba-doc-generator/references/template-tester.md +108 -0
  173. package/skills/specify/ba-doc-generator/references/template-user.md +98 -0
  174. package/skills/specify/bugfix-analyst/SKILL.md +296 -0
  175. package/skills/specify/bugfix-analyst/config.json +41 -0
  176. package/skills/specify/bugfix-analyst/examples/bad/common-mistakes.md +71 -0
  177. package/skills/specify/bugfix-analyst/examples/good/email-validation-bugfix.md +53 -0
  178. package/skills/specify/bugfix-analyst/gotchas.md +51 -0
  179. package/skills/specify/ears-writer/SKILL.md +129 -0
  180. package/skills/specify/ears-writer/config.json +20 -0
  181. package/skills/specify/ears-writer/examples/bad/common-mistakes.md +17 -0
  182. package/skills/specify/ears-writer/examples/good/login-requirements.md +41 -0
  183. package/skills/specify/ears-writer/gotchas.md +43 -0
  184. package/skills/specify/ears-writer/scripts/check-ears-compliance.sh +51 -0
  185. package/skills/test/test-case-generator/SKILL.md +161 -0
  186. package/skills/test/test-case-generator/config.json +33 -0
  187. package/skills/test/test-case-generator/examples/good/test-cases-login.md +104 -0
  188. package/skills/test/test-case-generator/gotchas.md +43 -0
  189. package/skills/understand/ba-docs-scanner/SKILL.md +239 -0
  190. package/skills/understand/ba-docs-scanner/config.json +47 -0
  191. package/skills/understand/ba-docs-scanner/examples/good/work-order-br-extract.md +28 -0
  192. package/skills/understand/ba-docs-scanner/gotchas.md +44 -0
  193. package/skills/understand/ba-docs-scanner/merge-rules.md +47 -0
  194. package/skills/understand/codebase-scanner/SKILL.md +260 -0
  195. package/skills/understand/codebase-scanner/config.json +56 -0
  196. package/skills/understand/codebase-scanner/examples/good/menu-module-output.md +44 -0
  197. package/skills/understand/codebase-scanner/gotchas.md +42 -0
  198. package/skills/understand/codebase-scanner/scripts/scan-project-structure.sh +64 -0
  199. package/templates/DESIGN.md +456 -0
  200. package/templates/agent-command-template.yaml +240 -0
  201. package/templates/agent-config-template.md +170 -0
  202. package/templates/agent-definition-template.md +145 -0
  203. package/templates/agent-metrics-template.md +150 -0
  204. package/templates/api-contract-template.md +72 -0
  205. package/templates/bugfix-report-template.md +195 -0
  206. package/templates/bugfix-spec-template.md +134 -0
  207. package/templates/code-review-report-template.md +119 -0
  208. package/templates/constitution-template.md +234 -0
  209. package/templates/context-template.md +94 -0
  210. package/templates/data-model-template.md +95 -0
  211. package/templates/decision-log-template.md +92 -0
  212. package/templates/flow-state-template.yaml +208 -0
  213. package/templates/github/workflows/v-flow-validate.yml +30 -0
  214. package/templates/knowledge/adr-template.md +70 -0
  215. package/templates/knowledge/api-contract-template.md +140 -0
  216. package/templates/knowledge/domain-glossary.md +29 -0
  217. package/templates/knowledge/golden-tests-readme.md +115 -0
  218. package/templates/knowledge/lessons-learned.md +41 -0
  219. package/templates/knowledge/patterns.md +103 -0
  220. package/templates/module-card/SKILL.md +85 -0
  221. package/templates/module-card/api-specs.md +96 -0
  222. package/templates/module-card/business-quiz.md +119 -0
  223. package/templates/module-card/cross-service.md +125 -0
  224. package/templates/module-card/db.md +85 -0
  225. package/templates/module-card/dev-quiz.md +62 -0
  226. package/templates/module-card/permissions.md +83 -0
  227. package/templates/module-card/state-diagram.md +64 -0
  228. package/templates/module-card/tech-context.md +90 -0
  229. package/templates/module-card/ui-flows.md +91 -0
  230. package/templates/module-card/use-cases.md +142 -0
  231. package/templates/module-template.yaml +161 -0
  232. package/templates/operations-report-template.md +108 -0
  233. package/templates/plan-template.md +308 -0
  234. package/templates/prototype-notes-template.md +116 -0
  235. package/templates/ptyc/PTYC.template.docx +0 -0
  236. package/templates/ptyc/ptyc.meta.example.yaml +44 -0
  237. package/templates/retrospective-report-template.md +136 -0
  238. package/templates/security-review-template.md +84 -0
  239. package/templates/session-template.md +167 -0
  240. package/templates/spec-review-log-template.md +75 -0
  241. package/templates/spec-template.md +229 -0
  242. package/templates/sprint-status-template.md +101 -0
  243. package/templates/tasks-template.md +275 -0
  244. package/templates/test-cases-template.md +124 -0
  245. package/templates/ux-checklist-template.md +79 -0
  246. package/templates/validation-report-template.md +125 -0
  247. package/templates/vflow-config-template.yaml +22 -0
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: context-reader
3
+ description: "Load context.md cho legacy projects, extract No-Go Zones, Technical Debt, và architecture thực tế. Agent PHẢI gọi skill này khi context.md tồn tại."
4
+ trigger: "Đầu mỗi agent session — khi .v-flow/context.md tồn tại"
5
+ phase: "All"
6
+ used_by:
7
+ - /v.specify
8
+ - /v.plan
9
+ - /v.test
10
+ - /v.check
11
+ - /v.implement
12
+ - /v.review
13
+ ---
14
+
15
+ # Context Reader — Hiểu Thực Trạng Legacy
16
+
17
+ > ⚠️ Đây là **Skill dùng chung cho legacy projects**.
18
+ > Nếu context.md KHÔNG tồn tại → Skip (greenfield project).
19
+ > Nếu TỒN TẠI → **BẮT BUỘC đọc TRƯỚC mọi thứ**.
20
+ >
21
+ > → Xem `gotchas.md` cho lỗi khi đọc context.
22
+ > → Xem `examples/good/` cho mẫu output legacy project.
23
+
24
+ ---
25
+
26
+ ## Khi nào KHÔNG đọc
27
+
28
+ - Greenfield project (không có context.md)
29
+ - Đang chạy `/v.understand` (đang TẠO context.md)
30
+
31
+ ---
32
+
33
+ ## Trust Levels — Đánh Giá Độ Tin Cậy
34
+
35
+ > 💡 KHÔNG phải mọi thông tin trong context.md đều đáng tin như nhau.
36
+
37
+ | Marker | Trust Level | Agent nên |
38
+ |:------:|:----------:|---------|
39
+ | (không marker) | 🟢 **Verified** | Tin tưởng — human đã review |
40
+ | `[⚠️ AI-inferred]` | 🟡 **Inferred** | Double-check với code trước khi rely |
41
+ | `[❓ CẦN VERIFY]` | 🔴 **Unverified** | KHÔNG dựa vào — chờ human confirm |
42
+
43
+ ### Staleness Score
44
+
45
+ ```
46
+ Last updated < 7 ngày → 🟢 Fresh — tin tưởng nguyên văn
47
+ Last updated 7-30 ngày → 🟡 Aging — verify No-Go Zones và Tech Stack
48
+ Last updated > 30 ngày → 🔴 Stale — WARN + suggest /v.understand --refresh
49
+ Không có date → 🔴 Unknown — treat như Stale
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Fields Cần Extract
55
+
56
+ > 💡 Mỗi field ảnh hưởng khác nhau đến các Agent downstream.
57
+
58
+ | Field | Section trong context.md | Ảnh hưởng tới Agent |
59
+ |-------|------------------------|-------------------|
60
+ | **Tech Stack** | §1 Tech Stack Thực Tế | Implement: dùng đúng framework |
61
+ | **Architecture** | §2 Kiến Trúc Thực Tế | Plan: thiết kế phù hợp reality |
62
+ | **Module Map** | §3 Module Map | All: biết scope, dependencies |
63
+ | **No-Go Zones** | §4 🚫 No-Go Zones | Implement: **BLOCK** nếu đụng |
64
+ | **Technical Debt** | §5 Technical Debt | Plan: aware risks, budget fix |
65
+ | **Test Coverage** | §6 Test Coverage | Test: biết baseline, Plan: allocate effort |
66
+ | **Patterns** | §7 Patterns Đang Dùng | Implement: follow existing patterns |
67
+
68
+ ## Per-Agent Impact Matrix
69
+
70
+ > 💡 Mỗi field ảnh hưởng KHÁC NHAU tới từng Agent:
71
+
72
+ | Field | BA | Plan | Test | Implement | Review |
73
+ |-------|:--:|:----:|:----:|:---------:|:------:|
74
+ | **Tech Stack** | • | • | • | ⭐ CRITICAL | • |
75
+ | **Architecture** | • | ⭐ CRITICAL | • | ⭐ CRITICAL | ⭐ CRITICAL |
76
+ | **No-Go Zones** | • | ⭐ CRITICAL | • | ⭐ CRITICAL | ⭐ CRITICAL |
77
+ | **Tech Debt** | • | ⭐ CRITICAL | • | • | ⭐ CRITICAL |
78
+ | **Test Coverage** | • | • | ⭐ CRITICAL | • | • |
79
+ | **Patterns** | • | • | • | ⭐ CRITICAL | • |
80
+
81
+ • = Awareness. ⭐ = Must extract để làm việc đúng.
82
+
83
+ ---
84
+
85
+ ## Đặc Thù — Những Điều KHÔNG Obvious
86
+
87
+ ### 1. AI-inferred ≠ verified
88
+ - LLM hay treat AI-inferred như fact → SAI
89
+ - VD: AI infer "JWT auth" nhưng thực tế dùng session-based
90
+ - **Rule**: Cross-reference `[⚠️ AI-inferred]` items với code TRƯỚC khi plan/implement
91
+
92
+ ### 2. Tech Debt là input cho Plan Agent
93
+ - context.md liệt kê sql injection risk → Plan Agent PHẢI address
94
+ - Không được ignore — ít nhất phải explicit acknowledge trong plan.md
95
+ - Nếu task chồng No-Go Zone + Tech Debt → BLOCK + escalate
96
+
97
+ ### 3. Reality ≠ Rules
98
+ - context.md mô tả **đang dùng gì** (reality)
99
+ - constitution.md mô tả **nên dùng gì** (rules)
100
+ - Code MỚI → follow constitution. Code CŨ → giữ nguyên (No-Go)
101
+ - Flag conflicts rõ ràng trong _session.md
102
+
103
+ ### 4. No-Go Zones là HARD STOP
104
+ - Khi task cần sửa file No-Go → DỪNG ngay
105
+ - Cross-reference với `no-go-zone-guard` skill
106
+ - KHÔNG cố workaround mà không báo
107
+
108
+ ### 5. Module Map = Scope Control
109
+ - Agent chỉ chạm vào modules liệt kê trong Module Map
110
+ - Nếu task cần module KHÔNG có trong map → likely out of scope
111
+ - Ghi _session.md và hỏi trước khi expand scope
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "context-reader",
3
+ "version": "1.0",
4
+ "description": "Load context.md cho legacy projects, extract No-Go Zones, Technical Debt, architecture thực tế",
5
+ "agent": "_shared",
6
+ "phase": ["All"],
7
+ "triggers": ["session_start"],
8
+ "dependencies": [],
9
+ "config": {
10
+ "context_path": ".v-flow/context.md",
11
+ "fallback_behavior": "skip_greenfield",
12
+ "staleness_thresholds": {
13
+ "fresh_days": 7,
14
+ "aging_days": 30
15
+ },
16
+ "critical_fields": ["no_go_zones", "tech_stack", "architecture"],
17
+ "trust_levels": {
18
+ "verified": "no_marker",
19
+ "inferred": "[⚠️ AI-inferred]",
20
+ "unverified": "[❓ CẦN VERIFY]"
21
+ }
22
+ },
23
+ "setup_questions": [
24
+ {
25
+ "id": "staleness_action",
26
+ "question": "Khi context.md quá cũ (>30 ngày)?",
27
+ "options": ["warn", "block", "auto-refresh"],
28
+ "default": "warn",
29
+ "description": "warn = hiện warning. block = DỪNG pipeline. auto-refresh = suggest /v.understand --refresh."
30
+ },
31
+ {
32
+ "id": "nogo_enforcement",
33
+ "question": "Mức độ enforce No-Go Zones?",
34
+ "options": ["strict", "warn", "log"],
35
+ "default": "strict",
36
+ "description": "strict = BLOCK ngay khi đụng. warn = cảnh báo nhưng cho tiếp. log = chỉ ghi log."
37
+ },
38
+ {
39
+ "id": "cross_reference_constitution",
40
+ "question": "Có cross-reference context.md với constitution.md không?",
41
+ "type": "boolean",
42
+ "default": true
43
+ }
44
+ ],
45
+ "hooks": {
46
+ "pre_read": "Check context.md tồn tại → nếu không → skip (greenfield project)",
47
+ "post_read": "Check staleness → warn nếu stale. Cross-reference No-Go Zones với constitution §7."
48
+ },
49
+ "memory": {
50
+ "file": "context-reads.log",
51
+ "format": "[date] | [agent] | [phase] | [staleness_status] | [nogo_zones_count] | [warnings]",
52
+ "purpose": "Track context awareness — dùng cho /v.understand --check"
53
+ }
54
+ }
@@ -0,0 +1,35 @@
1
+ # Good Example — Context Reader Output cho Legacy Project
2
+
3
+ > Mẫu output khi context-reader load context.md.
4
+
5
+ ```markdown
6
+ ## ⚠️ Legacy Context Active
7
+
8
+ **Project**: E-Commerce API (Node.js + Express)
9
+ **Stack**: Node.js 14, Express 4, PostgreSQL 12, no ORM (raw SQL)
10
+ **Architecture**: Monolith — routes/ → mixed logic (no service layer)
11
+ **Last Updated**: 2026-03-15 (40 ngày trước — ⚠️ có thể outdated)
12
+
13
+ ### 🚫 No-Go Zones (CRITICAL)
14
+ - 🔴 `routes/payment.js` (487 LOC) — PCI compliance, đã audit
15
+ - 🔴 `middleware/auth.js` (156 LOC) — 12 routes depend on this
16
+ - 🟡 `config/db.js` (45 LOC) — Connection pool, system-wide impact
17
+
18
+ ### ⚡ Technical Debt (6 items)
19
+ - 🔴 SQL injection risk in `routes/products.js:45` (string concatenation)
20
+ - 🔴 No input validation — req.body used directly
21
+ - 🟡 0% test coverage — no test files exist
22
+ - 🟡 Hardcoded secrets in `config/env.js`
23
+ - 🟢 No error classes — errors are plain strings
24
+ - 🟢 Mixed SQL styles (template literal + string concat)
25
+
26
+ ### 📊 Test Coverage
27
+ - Current: 0%
28
+ - Untested: ALL files
29
+ - Priority: routes/products.js, routes/orders.js
30
+
31
+ ### Patterns
32
+ - Direct SQL queries (no ORM, no query builder)
33
+ - Express middleware chain
34
+ - Callback-style error handling
35
+ ```
@@ -0,0 +1,49 @@
1
+ # Gotchas — Context Reader
2
+
3
+ > Cập nhật liên tục khi Agent gặp edge case mới.
4
+ > Legacy projects là "minefield" — mỗi gotcha ở đây từ lỗi thực tế.
5
+
6
+ ---
7
+
8
+ ## Gotchas Phổ Biến
9
+
10
+ 1. ❌ **Skip context.md vì "greenfield"** — File tồn tại = legacy. Phải đọc.
11
+ - **Check**: `ls .v-flow/context.md` — exists? → read.
12
+ - **Hậu quả**: Agent implement pattern sai cho legacy codebase.
13
+
14
+ 2. ❌ **AI-inferred → chấp nhận không verify** — AI có thể sai hoàn toàn.
15
+ - **VD**: AI infer "sử dụng JWT auth" nhưng thực tế dùng session-based.
16
+ - **Fix**: Cross-reference với code thực. Đánh dấu mức tin cậy.
17
+ - **Hậu quả**: Plan Agent design JWT flow → implement fail.
18
+
19
+ 3. ❌ **Outdated context → plan wrong** — context.md nói "Node 14" nhưng đã upgrade Node 18.
20
+ - **Fix**: Check `Last updated` date. > 30 ngày → WARN + suggest refresh.
21
+ - **Hậu quả**: Implement Agent dùng Node 14 syntax/API → warnings hoặc errors.
22
+
23
+ 4. ❌ **Bỏ qua No-Go Zones trong output** — Đọc context.md nhưng không extract No-Go list.
24
+ - **Rule**: No-Go Zones ALWAYS included in output, ALWAYS.
25
+ - **Hậu quả**: Downstream agents đụng No-Go → bị block muộn, waste effort.
26
+
27
+ 5. ❌ **Conflict context vs constitution không flag** — Reality ≠ Rules nhưng Agent chọn 1.
28
+ - **Fix**: Flag conflict rõ ràng. Ghi _session.md. Implement code mới theo constitution.
29
+ - **Hậu quả**: Inconsistent codebase — half old style, half new style.
30
+
31
+ 6. ❌ **Quên tech debt entries** — context.md liệt kê SQL injection nhưng Agent plan không address.
32
+ - **Fix**: Tech debt items PHẢI được xem xét trong plan.md (address hoặc explicit acknowledge).
33
+ - **Hậu quả**: Known vulnerabilities not addressed → security risk.
34
+
35
+ 7. ❌ **Module Map = boundary** — Agent chạm module ngoài scope.
36
+ - **VD**: Task nói "fix product page" nhưng Agent sửa cả payment module.
37
+ - **Fix**: Kiểm tra Module Map. Module không listed = out of scope.
38
+ - **Hậu quả**: Scope creep → unplanned changes → regression.
39
+
40
+ 8. ❌ **Trust level uniform** — Treat verified và AI-inferred cùng weight.
41
+ - **Fix**: Xem Trust Levels table trong SKILL.md. 🔴 items = DON'T rely.
42
+
43
+ ---
44
+
45
+ ## Edge Cases
46
+
47
+ - **context.md rỗng**: File exists nhưng không có content → treat như greenfield
48
+ - **context.md quá dài (> 300 LOC)**: Đọc §4 No-Go Zones TRƯỚC, còn lại after
49
+ - **Multiple context.md** (monorepo): Đọc gần nhất theo directory hierarchy
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: ears-notation
3
+ description: "Quick reference EARS notation cho mọi Agent cần viết hoặc đọc requirements. Gọi khi cần interpret REQ-xxx IDs."
4
+ trigger: "Khi cần viết, đọc, hoặc validate requirements"
5
+ phase: "S.1, B.0a, B.0b, R.0"
6
+ used_by:
7
+ - /v.specify
8
+ - /v.plan
9
+ - /v.test
10
+ - /v.check
11
+ - /v.ba-critic
12
+ ---
13
+
14
+ # EARS Notation — Quick Reference Card
15
+
16
+ > 💡 Đây là **reference card** — không phải skill dạy viết EARS.
17
+ > Để viết EARS chi tiết → xem `specify/ears-writer`.
18
+ >
19
+ > → Xem `gotchas.md` cho lỗi phổ biến khi interpret EARS.
20
+
21
+ ---
22
+
23
+ ## EARS Templates
24
+
25
+ | Type | Keyword | Template | Signal nhận biết |
26
+ |------|---------|----------|-----------------|
27
+ | **Ubiquitous** | `phải` | Hệ thống **phải** `<action>` | Luôn đúng, không điều kiện |
28
+ | **Event-driven** | `Khi` | **Khi** `<trigger>`, hệ thống phải `<action>` | Có sự kiện cụ thể |
29
+ | **State-driven** | `Trong khi` | **Trong khi** `<state>`, hệ thống phải `<action>` | Suốt thời gian ở state |
30
+ | **Optional** | `Nếu` | **Nếu** `<condition>`, hệ thống phải `<action>` | Có điều kiện tiên quyết |
31
+
32
+ ---
33
+
34
+ ## ID Convention
35
+
36
+ | Prefix | Type | Example |
37
+ |--------|------|---------|
38
+ | `REQ-U` | Ubiquitous | REQ-U01 |
39
+ | `REQ-E` | Event-driven | REQ-E01 |
40
+ | `REQ-S` | State-driven | REQ-S01 |
41
+ | `REQ-O` | Optional | REQ-O01 |
42
+
43
+ ---
44
+
45
+ ## Interpretation Guide Per Agent
46
+
47
+ > 💡 Phần này giúp Agent DOWNSTREAM hiểu mỗi loại REQ gợi ý implementation pattern gì.
48
+
49
+ | REQ Type | Plan Agent → | Test Agent → | Implement Agent → |
50
+ |:--------:|-------------|-------------|-------------------|
51
+ | **REQ-U** | Always-on component, middleware | Unit test: assert always true | Core module, no conditional |
52
+ | **REQ-E** | Event handler, route handler | Event test: given trigger → expect action | Handler/callback function |
53
+ | **REQ-S** | State management, lifecycle | State test: while in state → verify behavior | Stateful component, BLoC |
54
+ | **REQ-O** | Conditional logic, feature flag | Branch test: if true → A, else → B | if/guard clause |
55
+
56
+ ### Mapping sang Test Strategy
57
+
58
+ | REQ Type | Test Strategy | Minimum TCs |
59
+ |:--------:|--------------|:-----------:|
60
+ | REQ-U | Invariant check — test ở mọi state | 1-2 |
61
+ | REQ-E | Trigger → Action → Assert | 2-3 (success + errors) |
62
+ | REQ-S | Enter state → verify → exit state | 2-4 (enter + during + exit) |
63
+ | REQ-O | Condition true → A, condition false → B | 2+ (mỗi branch) |
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "ears-notation",
3
+ "version": "1.0",
4
+ "description": "EARS notation reference — Ubiquitous, Event-driven, State-driven, Optional patterns",
5
+ "agent": "_shared",
6
+ "phase": ["S.1"],
7
+ "triggers": ["spec_creation", "spec_review"],
8
+ "dependencies": [],
9
+ "config": {
10
+ "notation_types": ["Ubiquitous", "Event-driven", "State-driven", "Optional", "Unwanted"],
11
+ "prefix_mapping": {
12
+ "Ubiquitous": "REQ-U",
13
+ "Event-driven": "REQ-E",
14
+ "State-driven": "REQ-S",
15
+ "Optional": "REQ-O",
16
+ "Unwanted": "REQ-W"
17
+ },
18
+ "validation_rules": {
19
+ "min_requirements": 3,
20
+ "require_acceptance_criteria": true,
21
+ "max_ambiguous_words": 0
22
+ }
23
+ },
24
+ "setup_questions": [
25
+ {
26
+ "id": "strict_mode",
27
+ "question": "Bắt buộc tất cả requirements phải theo EARS format?",
28
+ "type": "boolean",
29
+ "default": true,
30
+ "description": "true = reject requirements không theo EARS. false = warn nhưng cho phép."
31
+ },
32
+ {
33
+ "id": "ambiguous_words",
34
+ "question": "Danh sách từ mơ hồ cần detect?",
35
+ "type": "string_array",
36
+ "default": ["nên", "hợp lý", "dễ dùng", "nhanh", "tối ưu", "user-friendly", "appropriate", "reasonable"],
37
+ "description": "Từ mơ hồ → trigger warning khi xuất hiện trong requirement."
38
+ },
39
+ {
40
+ "id": "require_nfr",
41
+ "question": "Bắt buộc có Non-Functional Requirements?",
42
+ "type": "boolean",
43
+ "default": true
44
+ }
45
+ ],
46
+ "hooks": {
47
+ "pre_write": "Load EARS notation reference → validate hiểu đúng format trước khi viết spec",
48
+ "post_write": "Scan spec.md → detect ambiguous words, verify mỗi REQ có AC"
49
+ },
50
+ "memory": {
51
+ "file": "ears-quality.log",
52
+ "format": "[date] | [feature] | [total_reqs] | [U_count] | [E_count] | [S_count] | [O_count] | [ambiguous_count]",
53
+ "purpose": "Track EARS adoption quality — identify patterns in requirement types"
54
+ }
55
+ }
@@ -0,0 +1,29 @@
1
+ # Good Example — EARS Interpretation cho Plan Agent
2
+
3
+ > Mẫu cách Plan Agent đọc spec và design architecture dựa trên REQ types.
4
+
5
+ ## Input: spec.md excerpt
6
+ ```
7
+ REQ-U01: Hệ thống phải hash password trước khi lưu DB
8
+ REQ-E01: Khi user nhấn Login, hệ thống phải validate credentials
9
+ REQ-S01: Trong khi loading, hệ thống phải hiển thị spinner
10
+ REQ-O01: Nếu user có valid token, hệ thống phải skip login
11
+ ```
12
+
13
+ ## Plan Agent Interpretation
14
+
15
+ | REQ | Type | → Architecture Decision |
16
+ |-----|------|------------------------|
17
+ | REQ-U01 | Ubiquitous | `AuthService` middleware — always hash, mọi endpoint dùng password |
18
+ | REQ-E01 | Event-driven | `LoginController.post()` → `AuthService.validate()` — handler pattern |
19
+ | REQ-S01 | State-driven | `LoginBloc` — state management: `LoginLoading` / `LoginSuccess` / `LoginError` |
20
+ | REQ-O01 | Optional | `AuthGuard` — check token at app startup, conditional redirect |
21
+
22
+ ## Test Agent Interpretation
23
+
24
+ | REQ | Type | → Test Strategy |
25
+ |-----|------|----------------|
26
+ | REQ-U01 | Ubiquitous | Invariant test — verify hash ở MỌI endpoint lưu password (≥2 TCs) |
27
+ | REQ-E01 | Event-driven | Trigger test — POST /login valid → 200, invalid → 401 (≥3 TCs) |
28
+ | REQ-S01 | State-driven | State test — emit Loading → verify spinner, emit Success → verify redirect (≥3 TCs) |
29
+ | REQ-O01 | Optional | Branch test — có token → skip, không token → show login (≥2 TCs) |
@@ -0,0 +1,43 @@
1
+ # Gotchas — EARS Notation
2
+
3
+ > Cập nhật liên tục khi Agent gặp edge case mới.
4
+ > Đây là "cheat sheet sai lầm" cho mọi Agent làm việc với requirements.
5
+
6
+ ---
7
+
8
+ ## Interpretation Gotchas
9
+
10
+ 1. ❌ **Prefix sai loại** — REQ-E nhưng nội dung Ubiquitous.
11
+ - **VD**: "REQ-E01: Hệ thống phải hash password" → thiếu trigger → là REQ-U.
12
+ - **Hậu quả**: Test Agent viết event test cho invariant rule → miss coverage.
13
+
14
+ 2. ❌ **Interpret REQ-U như "nice-to-have"** — "Hệ thống phải validate" → Agent nghĩ "optional".
15
+ - **Rule**: "phải" = MANDATORY. Ubiquitous = always enforced, every single request.
16
+
17
+ 3. ❌ **Confuse State-driven vs Event-driven**
18
+ - "Khi" = 1 event xảy ra, xong rồi thôi → **E**
19
+ - "Trong khi" = suốt thời gian ở state → **S**
20
+ - **VD**: "Khi user nhấn nút" = E. "Trong khi đang tải" = S.
21
+
22
+ 4. ❌ **Quên branch test cho REQ-O** — Optional REQ chỉ test condition=true.
23
+ - **Rule**: REQ-O PHẢI có test cho CẢ true branch VÀ false branch.
24
+ - **Hậu quả**: Untested else branch → bug khi condition false.
25
+
26
+ 5. ❌ **Count TCs sai per type**
27
+
28
+ | REQ Type | Minimum TCs | Lý do |
29
+ |:--------:|:-----------:|-------|
30
+ | REQ-U | 1-2 | Invariant — verify ở ≥1 context |
31
+ | REQ-E | 2-3 | Success + error + edge case |
32
+ | REQ-S | 2-4 | Enter state + during + exit + timeout |
33
+ | REQ-O | 2+ | condition=true + condition=false |
34
+
35
+ 6. ❌ **Plan Agent bỏ qua REQ-S** — Quên design state management.
36
+ - **Signal**: Spec có REQ-S nhưng plan không mention state.
37
+ - **Fix**: Mỗi REQ-S → plan.md PHẢI có state management component.
38
+
39
+ 7. ❌ **REQ-U nhưng implement conditional** — "Hệ thống phải log" nhưng code có `if (env === 'prod')`.
40
+ - **Rule**: REQ-U = unconditional. Nếu cần conditional → chuyển sang REQ-O.
41
+
42
+ 8. ❌ **Mixed language IDs** — REQ-E01 viết tiếng Việt nhưng REQ-E02 viết tiếng Anh.
43
+ - **Rule**: Đọc `config.json → language` setting. Nhất quán.
@@ -0,0 +1,206 @@
1
+ ---
2
+ name: cross-validator
3
+ description: "Hướng dẫn Master Check Agent cross-validate Spec ↔ Plan ↔ Tests. Agent PHẢI đọc skill này khi /v.check được gọi. Đảm bảo traceability 100% và phát hiện gaps/conflicts."
4
+ trigger: "Khi /v.check được gọi"
5
+ phase: "R.0"
6
+ used_by:
7
+ - /v.check
8
+ hooks:
9
+ pre_check: "Load spec.md + plan.md + tasks.md + test-cases.md → build traceability matrix"
10
+ post_check: "Output validation-report.md với verdict + routing + concerns"
11
+ ---
12
+
13
+ # Cross Validator — Kiểm Tra Chéo Có Hệ Thống
14
+
15
+ > ⚠️ Đây là **Skill bắt buộc** cho Master Check Agent.
16
+ > QUAN TRỌNG: Verdict PHẢI dựa trên EVIDENCE, không phải cảm tính.
17
+ >
18
+ > → Xem `gotchas.md` cho bias phổ biến khi validate.
19
+ > → Xem `examples/good/` cho mẫu validation-report chuẩn.
20
+ > → Xem `config.json` để customize (strictness, concern_threshold).
21
+
22
+ ---
23
+
24
+ ## Khi nào KHÔNG cần full cross-validation
25
+
26
+ - Quick Fix (`/v.quickfix`) — simplified check: spec → code direct
27
+ - Hotfix (`/v.hotfix`) — minimal check: correctness + security only
28
+ - Documentation-only — no code change, no check needed
29
+
30
+ ---
31
+
32
+ ## 3-Phase Validation Engine
33
+
34
+ > 💡 Agent PHẢI thực hiện tất cả 3 phases. Kết quả mỗi phase ảnh hưởng verdict.
35
+
36
+ ### Phase 1: Traceability Matrix — REQ ↔ Task ↔ TC
37
+
38
+ **Build ma trận (REQ + AC-NN):**
39
+ ```
40
+ Bước 1: Extract tất cả REQ-xxx + AC-NN từ spec.md (§4 Acceptance Criteria)
41
+ Bước 2: Map REQ-xxx / AC-NN → T-NNN từ tasks.md (field "REQ / UC mapping" + "Done khi: AC-NN")
42
+ Bước 3: Map REQ-xxx → TC-xx từ test-cases.md (Test Matrix §1)
43
+ Bước 4: Tạo matrix:
44
+
45
+ | REQ / AC | Task(s) | TC(s) | Status |
46
+ |----------|---------|-------|--------|
47
+ | REQ-E01 / AC-01 | T-001, T-004 | TC-01, TC-02 | ✅ Full |
48
+ | REQ-E02 / AC-02 | T-004 | TC-03 | ✅ Full |
49
+ | REQ-U01 / AC-03 | — | TC-04 | ❌ Missing Task |
50
+ | REQ-O01 / AC-04 | T-004 | — | ❌ Missing TC |
51
+ ```
52
+
53
+ **Verdict impact:**
54
+ - ✅ REQ + mọi AC-NN có Task + TC = FULL → OK
55
+ - ⚠️ REQ có Task nhưng không TC = WARNING (concern)
56
+ - ❌ REQ **hoặc** AC-NN không có task nào phủ = CRITICAL GAP → FAIL (mọi AC-NN PHẢI có ≥1 task)
57
+
58
+ ### Phase 2: Consistency Check — Spec vs Plan Alignment
59
+
60
+ **Kiểm tra:**
61
+
62
+ | Kiểm tra | Signal sai | Action |
63
+ |----------|-----------|--------|
64
+ | Architecture vs Constitution | Plan dùng pattern khác constitution | FAIL |
65
+ | File paths vs existing code | Plan modify file không tồn tại | WARNING |
66
+ | No-Go Zone compliance | Plan modify No-Go Zone code | FAIL |
67
+ | Dependency direction | Plan vi phạm layer rules | WARNING |
68
+ | Error handling completeness | Plan thiếu error architecture | WARNING |
69
+ | Security section | Feature cần auth nhưng plan không có | FAIL nếu security-critical |
70
+
71
+ ### Phase 3: Quality Assessment — Plan + Tasks + Tests Quality
72
+
73
+ **Kiểm tra:**
74
+
75
+ | Kiểm tra | Criteria | Action |
76
+ |----------|---------|--------|
77
+ | Task annotations | Có đúng 1 ENTRYPOINT? Có circular DEPENDS? | WARNING/FAIL |
78
+ | Task granularity | Nhiều task Complexity **L** (nên tách)? Σ sizing quá lớn? | WARNING |
79
+ | TDD trong task | Mỗi task có block **TDD (Red→Green)** + **Done khi (AC-NN)**? | WARNING nếu thiếu |
80
+ | AC coverage | Mọi **AC-NN** (spec §4) được ≥1 task phủ? | FAIL nếu có AC chưa phủ |
81
+ | Tech Decisions | Quyết định không tầm thường có ghi ở plan §13 (lý do + phương án loại)? | WARNING nếu thiếu |
82
+ | Test coverage | ≥1 TC per REQ? Edge cases covered? | FAIL nếu < 100% |
83
+ | Test types | Có unit + integration cho critical paths? | WARNING |
84
+ | TC priority | Có P1 cho core logic + security? | WARNING |
85
+
86
+ ---
87
+
88
+ ## 3-Level Verdict System
89
+
90
+ | Verdict | Điều kiện | Routing |
91
+ |---------|-----------|---------|
92
+ | ✅ **PASS** | 0 Critical + 0 Major | → B.1 (Implement) |
93
+ | ⚠️ **PASS WITH CONCERNS** | 0 Critical + có Warning(s) | → B.1 + carry concerns [W-xxx] |
94
+ | ❌ **FAIL** | Có ≥1 Critical gap/conflict | → Routing tùy `fail_reason` |
95
+
96
+ ### Fail Routing Logic
97
+
98
+ ```
99
+ fail_reason = "missing_tasks" → route: /v.plan (Plan Agent tạo tasks thiếu)
100
+ fail_reason = "missing_tests" → route: /v.test (Test Agent tạo TCs thiếu)
101
+ fail_reason = "spec_conflict" → route: /v.specify (BA Agent fix spec)
102
+ fail_reason = "plan_conflict" → route: /v.plan (Plan Agent redesign)
103
+ fail_reason = "nogo_violation" → route: /v.plan (Plan Agent redesign around No-Go)
104
+ fail_reason = "constitution_violation" → route: /v.plan (Plan Agent align constitution)
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Concerns System — [W-xxx]
110
+
111
+ Concerns là issues KHÔNG đủ nghiêm trọng để FAIL nhưng PHẢI được addressed:
112
+
113
+ ```markdown
114
+ ### W-001: {Tên concern}
115
+ - **Type**: Coverage / Consistency / Quality
116
+ - **Severity**: Low / Medium
117
+ - **Description**: {Mô tả concern}
118
+ - **Assigned to**: {Phase/Agent nào cần resolve}
119
+ - **Must verify at**: R.1 (Review Agent phải check)
120
+ ```
121
+
122
+ **Rules:**
123
+ - Concerns PHẢI được carry-forward vào `_session.md`
124
+ - Implement Agent PHẢI resolve W-xxx assigned cho mình
125
+ - Review Agent PHẢI verify W-xxx resolved ở R.1
126
+ - Nếu W-xxx không resolved → Review Agent tạo issue tương ứng
127
+
128
+ ---
129
+
130
+ ## Đặc Thù Và Quy Ước
131
+
132
+ ### 1. Evidence-Based Verdict
133
+
134
+ Mỗi quyết định trong report PHẢI có evidence:
135
+ - ❌ "Plan looks good" → không có evidence
136
+ - ✅ "4/4 REQs có task + TC, traceability 100%. Constitution alignment verified." → evidence
137
+
138
+ ### 2. Không Suy Đoán
139
+
140
+ - Nếu spec mơ hồ → flag MƠ HỒ, không tự interpret
141
+ - Nếu plan thiếu detail → flag THIẾU, không tự bổ sung
142
+ - Nếu TC coverage unclear → flag GAP, không tự assume covered
143
+
144
+ ### 3. Cross-check Constitution
145
+
146
+ Luôn verify:
147
+ - Architecture pattern match
148
+ - Naming convention match
149
+ - Error handling pattern match
150
+ - Security requirements covered (nếu constitution yêu cầu)
151
+
152
+ ---
153
+
154
+ ## Output — Validation Report Structure
155
+
156
+ ```markdown
157
+ # Validation Report — Feature {NNN}
158
+
159
+ **Ngày:** {date}
160
+ **Verdict:** ✅ PASS / ⚠️ PASS WITH CONCERNS / ❌ FAIL
161
+
162
+ ## 1. Traceability Matrix
163
+ | REQ | Task(s) | TC(s) | Status |
164
+ |-----|---------|-------|--------|
165
+ (matrix)
166
+
167
+ ## 2. Consistency Checks
168
+ (spec vs plan alignment findings)
169
+
170
+ ## 3. Quality Assessment
171
+ (plan + tasks + tests quality)
172
+
173
+ ## 4. Concerns [W-xxx]
174
+ (if PASS WITH CONCERNS)
175
+
176
+ ## 5. Issues Found
177
+ ### Critical (blocks PASS)
178
+ ### Major (requires action)
179
+ ### Minor (suggestions)
180
+
181
+ ## 6. Verdict Rationale
182
+ (evidence-based explanation)
183
+
184
+ ## 7. Routing Decision
185
+ fail_reason: "{reason}"
186
+ route_decision: "{/v.xxx}"
187
+ ```
188
+
189
+ ---
190
+
191
+ ## V-Flow Integration Points
192
+
193
+ - **spec.md** → Source of truth: REQ list
194
+ - **plan.md** → Design: components, file paths
195
+ - **tasks.md** → Implementation plan: task list, dependencies
196
+ - **test-cases.md** → Test coverage: TC list, REQ mapping
197
+ - **constitution.md** → Rules: patterns, conventions
198
+ - **context.md** → Constraints: No-Go Zones
199
+ - **_session.md** → Output: concerns carry-forward
200
+ - **validation-report.md** → Output: full report
201
+
202
+ ---
203
+
204
+ ## Gotchas
205
+
206
+ → Xem `gotchas.md` cho bias phổ biến khi validate — cập nhật liên tục.