@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
package/README.md ADDED
@@ -0,0 +1,326 @@
1
+ # V Flow 🚀
2
+
3
+ **Agentic AI Software Development — Spec-Driven Development**
4
+
5
+ > 🇻🇳 [Phiên bản tiếng Việt](#-phiên-bản-tiếng-việt) bên dưới.
6
+
7
+ ---
8
+
9
+ ## Overview
10
+
11
+ V Flow uses **16 specialized AI Agents** orchestrated in a structured pipeline:
12
+
13
+ ```
14
+ [U] Understand → [S] Specify → [B] Build → [R] Review → [M] Metrics → [O] Operations
15
+ ```
16
+
17
+ | Phase | Code | Agent | Output |
18
+ |-------|------|-------|--------|
19
+ | Understand | **U.0** | Understand Agent | `context.md` + Module Cards *(legacy)* |
20
+ | Foundation | **S.0a** | Constitute Agent | `constitution.md` |
21
+ | Specification | **S.1** | BA Agent | `spec.md` (EARS notation) |
22
+ | Planning | **B.0a** | Plan Agent | `plan.md`, `tasks.md` |
23
+ | Testing | **B.0b** | Test Agent | `test-cases.md` |
24
+ | Master Check | **R.0** | Master Check Agent | `validation-report.md` |
25
+ | Implementation | **B.1** | Implement Agent | Working code + tests |
26
+ | Verification | **R.1** | Review Agent | Code review (5-chiều có bằng chứng) |
27
+ | Metrics | **M.0** | Metrics Agent | `metrics-report.md` |
28
+
29
+ ### Key Features
30
+
31
+ - 🎯 **Spec-Driven** — Define "what" before "how" via EARS notation
32
+ - 🔄 **3-Level Master Check** — PASS / PASS WITH CONCERNS / FAIL with explicit routing
33
+ - 🤖 **4-Target AI Sync** — Antigravity, GitHub Copilot, Cursor, Claude Code (auto-synced, config-driven)
34
+ - ⚔️ **Adversarial Review** — Evidence-based 5-dimension review (no rubber stamps, no forced issue quota)
35
+ - 🔀 **Dual BA Mode** — Opt-in spec critique loop
36
+ - ⏮️ **Time Travel** — `/v.rewind` and `/v.fork` for spec versioning
37
+ - 📊 **Typed State** — Machine-readable `.flow-state.yaml` tracking
38
+ - 🧰 **14 Skills** — Action-oriented guidance for every pipeline phase
39
+
40
+ ---
41
+
42
+ ## ⚡ Quick Start
43
+
44
+ ### CLI Installation
45
+
46
+ ```bash
47
+ # Install globally
48
+ npm install -g v-flow-cli
49
+
50
+ # Initialize in your project
51
+ v-flow init my-project
52
+
53
+ # Verify setup
54
+ v-flow check
55
+
56
+ # View pipeline status
57
+ v-flow status
58
+ ```
59
+
60
+ ### Slash Commands (in AI Agent)
61
+
62
+ ```
63
+ /v.help → Project status & next step suggestion
64
+ /v.understand → Multi-Layer Understanding (--all, --module)
65
+ /v.specify → BA Agent creates spec (--dual for critique loop)
66
+ /v.plan → Plan Agent designs architecture
67
+ /v.test → Test Agent generates test cases
68
+ /v.check → Master Check cross-validation
69
+ /v.implement → Implement Agent — TDD coding (--yolo: auto-mode)
70
+ /v.review → Adversarial Code Review (evidence-based, no forced quota)
71
+ /v.quickfix → Quick fix for small bugs (< 5 files)
72
+ /v.hotfix → Hotfix for P1/P2 production incidents
73
+ ```
74
+
75
+ <details>
76
+ <summary>📋 All 23 Slash Commands</summary>
77
+
78
+ | Command | Phase | Description |
79
+ |---------|-------|-------------|
80
+ | `/v.help` | Any | Project status & next step |
81
+ | `/v.understand` | U.0 | Codebase scan → context.md + Module Cards |
82
+ | `/v.import-ba-docs` | U.0d | Import BA docs from NotebookLM |
83
+ | `/v.constitution` | S.0a | Interactive constitution setup |
84
+ | `/v.constitute` | S.0a | AI auto-draft constitution.md |
85
+ | `/v.specify` | S.1 | BA Agent → spec.md (--dual for critique) |
86
+ | `/v.ba-critic` | S.1 | Adversarial spec review |
87
+ | `/v.prototype` | S.1.5 | Throwaway prototype to validate ambiguity |
88
+ | `/v.ba-to-ptyc` | S.1.6 | spec.md → PTYC.docx (ISO requirements doc, optional) |
89
+ | `/v.plan` | B.0a | Plan Agent → plan.md + tasks.md |
90
+ | `/v.test` | B.0b | Test Agent → test-cases.md |
91
+ | `/v.check` | R.0 | Master Check → validation-report.md |
92
+ | `/v.implement` | B.1 | Implement Agent → TDD coding |
93
+ | `/v.review` | R.1 | Adversarial Code Review |
94
+ | `/v.sync` | Any | Propagate spec changes |
95
+ | `/v.sprint` | B.1 | Sprint planning dashboard |
96
+ | `/v.retrospective` | R.1 | Post-sprint summary |
97
+ | `/v.metrics` | M.0 | Agent performance metrics |
98
+ | `/v.status` | Any | Visual pipeline dashboard |
99
+ | `/v.quickfix` | S.1→R.1 | Quick bug fix flow |
100
+ | `/v.bugfix` | S.1→R.1 | Bugfix flow — root cause + 3-tier TDD |
101
+ | `/v.hotfix` | O.0→R.1 | Production incident flow |
102
+ | `/v.rewind` | Any | Time Travel: rollback |
103
+ | `/v.fork` | Any | Time Travel: branch |
104
+
105
+ </details>
106
+
107
+ ---
108
+
109
+ ## 🤖 Supported AI Agents
110
+
111
+ | Agent | Integration | Config Files |
112
+ |-------|------------|-------------|
113
+ | **Antigravity** | `.agents/workflows/` + `AGENTS.md` | Auto-available slash commands |
114
+ | **GitHub Copilot** | `.github/prompts/` + `copilot-instructions.md` | Prompt files for Agent Mode |
115
+ | **Cursor** | `.cursor/rules/` + `.cursorrules` | Rules `.mdc` + Agent personas |
116
+ | **Claude Code** | `.claude/commands/` + `CLAUDE.md` | Slash commands + subagents + skills |
117
+
118
+ > ➕ Targets are config-driven — add a vendor by appending one entry to `cli/lib/sync-targets.js` (no engine changes).
119
+
120
+ ---
121
+
122
+ ## 🔧 CLI Reference
123
+
124
+ | Command | Description |
125
+ |---------|-------------|
126
+ | `v-flow init [name]` | Initialize `.v-flow/` + AI agent files |
127
+ | `v-flow check` | Verify setup and artifact status |
128
+ | `v-flow status [feature]` | Pipeline progress for features |
129
+ | `v-flow feature create <name>` | Create feature folder + scaffold |
130
+ | `v-flow sync [--apply]` | Sync commands/agents/skills → AI folders |
131
+ | `v-flow doctor [--fix]` | Deep health check |
132
+ | `v-flow upgrade [--check]` | Upgrade templates and agents |
133
+ | `v-flow validate [feature]` | Validate artifact structure & quality |
134
+ | `v-flow validate --module-cards [module]` | Lint module card structure + business-quiz language |
135
+ | `v-flow score-card [module]` | Objective scorecard (6 pts) for a module card, with evidence trail |
136
+ | `v-flow dev-quiz <module>` | Machine-graded technical check (GitNexus graph = answer key) |
137
+
138
+ ---
139
+
140
+ ## 📚 Documentation
141
+
142
+ | Doc | Description |
143
+ |-----|------------|
144
+ | 📖 [V-Flow Guide](docs/v-flow-guide.md) | Full technical documentation |
145
+ | 📚 [Learning Path](learn/) | 7-step tutorial |
146
+ | 📘 [Golden Example](examples/001-user-login/) | End-to-end: spec → metrics |
147
+ | 🏗️ [Legacy Example](examples/002-legacy-crud/) | Legacy refactor example |
148
+ | ⚡ [Quick Fix Example](examples/003-quickfix-bug/) | Bug fix flow |
149
+ | 🚨 [Hotfix Example](examples/004-hotfix-p1/) | P1 incident response |
150
+ | 🎯 [Best Practices](docs/best-practices.md) | Anti-patterns & tips |
151
+ | 📐 [EARS Notation](docs/ears-notation-guide.md) | Requirements writing guide |
152
+ | ⚙️ [Skills Blueprint](docs/skills-blueprint.md) | Skills system design |
153
+
154
+ ---
155
+
156
+ ## Philosophy
157
+
158
+ - **Spec first, code later** — Define "what" before "how"
159
+ - **Consistency via Constitution** — All Agents follow the same rules
160
+ - **Cross-validation** — Master Check ensures Spec ↔ Plan ↔ Tests alignment
161
+ - **Human-in-the-loop** — AI drafts, humans decide
162
+ - **Closed-loop** — Production feedback flows back into the pipeline
163
+
164
+ ---
165
+
166
+ ## Inspiration
167
+
168
+ - [Kiro](https://kiro.dev/) — Spec-driven development, EARS notation
169
+ - [GitHub Spec Kit](https://github.com/github/spec-kit) — Constitution, SDD workflow
170
+ - [Microsoft AI-Led SDLC](https://developer.microsoft.com/blog/spec-driven-development-spec-kit) — Agentic lifecycle
171
+ - [EPAM ADLC](https://www.epam.com/insights/ai/blogs/agentic-development-lifecycle-explained) — Agent governance
172
+ - [LangGraph](https://github.com/langchain-ai/langgraph) — Typed state, routing, time travel
173
+
174
+ ---
175
+
176
+ ---
177
+
178
+ # 🇻🇳 Phiên Bản Tiếng Việt
179
+
180
+ ## Tổng quan nhanh
181
+
182
+ V Flow sử dụng **19 AI Agent chuyên biệt** phối hợp theo pipeline:
183
+
184
+ ```
185
+ [U] Understand → [S] Specify → [B] Build → [R] Review/Verify → [M] Metrics → [O] Operations
186
+ ```
187
+
188
+ *[U] chỉ cần lần đầu với legacy project*
189
+
190
+ | Phase | Code | Agent | Output |
191
+ |-------|------|-------|--------|
192
+ | Understand | **U.0** | Understand Agent (AI scan) + Tech Lead + BA | `context.md` + Module Cards *(legacy)* |
193
+ | Foundation | **S.0a** | Constitute Agent (AI draft) + Tech Lead | `constitution.md` |
194
+ | Agent Setup | **S.0b** | — | `agent-config.md` |
195
+ | Specification | **S.1** | BA Agent | `spec.md` |
196
+ | Planning | **B.0a** | Plan Agent | `plan.md`, `tasks.md` |
197
+ | Testing | **B.0b** | Test Agent | `test-cases.md` |
198
+ | Master Check | **R.0** | Master Check Agent | `validation-report.md` |
199
+ | Implementation | **B.1** | Implement Agent | Working code + tests |
200
+ | Verification | **R.1** | CI/CD + QA + PO | UAT report |
201
+ | Agent Metrics | **M.0** | — | `metrics-report.md` |
202
+ | Operations | **O.0** | Operations Agent | `operations-report.md` |
203
+
204
+ ---
205
+
206
+ ## ⚡ Bắt đầu nhanh
207
+
208
+ ### Cách 1: Dùng CLI Tool
209
+
210
+ ```bash
211
+ # Cài đặt global
212
+ npm install -g v-flow-cli
213
+
214
+ # Khởi tạo trong dự án hiện tại
215
+ v-flow init my-project
216
+
217
+ # Kiểm tra setup
218
+ v-flow check
219
+
220
+ # Xem pipeline status
221
+ v-flow status
222
+ ```
223
+
224
+ ### Cách 2: Dùng Slash Commands (trong AI Agent)
225
+
226
+ ```
227
+ /v.help → [Any] Xem trạng thái dự án & gợi ý bước tiếp
228
+ /v.understand → [U.0] Multi-Layer Understanding (--all, --module, --check, --refresh)
229
+ /v.specify → [S.1] BA Agent tạo spec + init state files (--dual for Dual BA)
230
+ /v.plan → [B.0a] Plan Agent thiết kế kiến trúc
231
+ /v.test → [B.0b] Test Agent tạo test cases
232
+ /v.check → [R.0] Master Check cross-validate + explicit routing
233
+ /v.implement → [B.1] Implement Agent coding TDD (--yolo: auto-mode)
234
+ /v.review → [R.1] Adversarial Code Review (5-chiều có bằng chứng)
235
+ /v.quickfix → [S.1→R.1] Quick fix cho bug nhỏ (< 5 files)
236
+ /v.hotfix → [O.0→R.1] Hotfix cho P1/P2 production incident
237
+ ```
238
+
239
+ ### Cách 3: Manual
240
+
241
+ 1. **Đọc quy trình**: [v-flow.md](v-flow.md)
242
+ 2. **Legacy project**: chạy `v-flow init` → `/v.understand --all` → `/v.understand --module {tên}` → Human review
243
+ 3. **Thiết lập Constitution**: chạy `/v.constitute` (AI draft) → Tech Lead review `constitution.md`
244
+ 4. **Chạy theo workflow**: [full-flow.md](workflows/full-flow.md) hoặc [quick-feature.md](workflows/quick-feature.md)
245
+ 5. **Xem ví dụ**: [examples/001-user-login](examples/001-user-login/) — Golden Example end-to-end
246
+
247
+ ---
248
+
249
+ ## 🔧 CLI Reference
250
+
251
+ | Command | Description |
252
+ |---------|-------------|
253
+ | `v-flow init [name]` | Khởi tạo `.v-flow/` + AI agent files |
254
+ | `v-flow check` | Kiểm tra setup và artifacts status |
255
+ | `v-flow status [feature]` | Xem pipeline progress cho features |
256
+ | `v-flow feature create <name>` | Tạo feature folder + scaffold artifacts |
257
+ | `v-flow sync [--apply]` | Đồng bộ commands/agents/skills → AI agent folders |
258
+ | `v-flow doctor [--fix]` | Deep health check — verify installation integrity |
259
+ | `v-flow upgrade [--check]` | Upgrade templates, agents khi có version mới |
260
+ | `v-flow validate [feature]` | Kiểm tra cấu trúc và chất lượng artifacts |
261
+ | `v-flow validate --module-cards [module]` | Lint cấu trúc module card + ngôn ngữ business-quiz (bỏ trống = tất cả) |
262
+ | `v-flow score-card [module]` | Chấm điểm objective (6đ) cho module card, có evidence trail |
263
+ | `v-flow dev-quiz <module>` | Kiểm chứng kỹ thuật — chấm máy theo GitNexus impact (graph = answer key) |
264
+
265
+ ---
266
+
267
+ ## 🔄 Sync System
268
+
269
+ > **Source of Truth**: `commands/`, `agents/`, `skills/`
270
+ > **Distribution**: `.agents/`, `.github/`, `.cursor/` (auto-synced)
271
+
272
+ ```bash
273
+ v-flow sync # Preview (dry-run)
274
+ v-flow sync --apply # Apply sync
275
+ v-flow sync --apply --verbose # Detailed output
276
+ ```
277
+
278
+ > 💡 **Legacy scripts** (`scripts/_deprecated/`) đã deprecated — dùng `v-flow sync --apply`.
279
+
280
+ ---
281
+
282
+ ## Cấu trúc thư mục
283
+
284
+ ```
285
+ v-flow/
286
+ ├── AGENTS.md ← Instructions cho AI agents
287
+ ├── v-flow.md ← Quy trình chi tiết (v4.1)
288
+ ├── package.json ← npm CLI package
289
+ ├── cli/ ← CLI Tool source (8 commands)
290
+ │ ├── index.js
291
+ │ ├── commands/ ← init, check, status, feature, sync, doctor, upgrade, validate
292
+ │ └── lib/
293
+ │ ├── templates.js ← Scaffold & features
294
+ │ ├── scanner.js ← Codebase analysis (multi-language)
295
+ │ ├── cli-error.js ← Unified error handling
296
+ │ └── sync-core.js ← Shared sync logic
297
+ ├── commands/ ← Slash Commands (21 commands, source of truth)
298
+ ├── agents/ ← Agent definitions (16 agents)
299
+ ├── skills/ ← Agent Skills (14 skills, 6 groups)
300
+ ├── templates/ ← Templates cho artifacts
301
+ ├── workflows/ ← 10 workflow definitions
302
+ ├── examples/ ← 4 ví dụ end-to-end (full, legacy, quickfix, hotfix)
303
+ ├── learn/ ← 📚 Learning Path (7 bài)
304
+ ├── docs/ ← Tài liệu bổ sung
305
+ ├── scripts/ ← Automation (pre-commit hook)
306
+ │ └── _deprecated/ ← Legacy scripts (reference only)
307
+ ├── .agents/ ← Antigravity (auto-synced)
308
+ ├── .github/ ← GitHub Copilot (auto-synced)
309
+ └── .cursor/ ← Cursor (auto-synced)
310
+ ```
311
+
312
+ ---
313
+
314
+ ## Triết lý
315
+
316
+ - **Spec trước, Code sau** — Định nghĩa "cần gì" trước khi bàn "làm thế nào"
317
+ - **Nhất quán qua Constitution** — Mọi Agent tuân thủ cùng bộ quy tắc
318
+ - **Cross-validation** — Master Check đảm bảo Spec ↔ Plan ↔ Tests đồng nhất
319
+ - **Human-in-the-loop** — AI tạo draft, con người quyết định
320
+ - **Closed-loop** — Feedback từ production quay lại pipeline
321
+
322
+ ---
323
+
324
+ ## License
325
+
326
+ MIT © [quochoang228](https://github.com/quochoang228)