@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,91 @@
|
|
|
1
|
+
<!-- HEADING MAP — Agent PHẢI dùng CHÍNH XÁC các heading dưới đây:
|
|
2
|
+
# UI Flows: {Tên Module}
|
|
3
|
+
## 1. Danh Sách Màn Hình
|
|
4
|
+
## 2. Chi Tiết Từng Màn Hình
|
|
5
|
+
### Màn hình: {Tên màn hình thực}
|
|
6
|
+
-->
|
|
7
|
+
# UI Flows: {Tên Module}
|
|
8
|
+
|
|
9
|
+
> **Audience chính**: BA, Frontend Dev
|
|
10
|
+
> **AI generate**: Scan components, routes, state management → draft. Human bổ sung UX context.
|
|
11
|
+
|
|
12
|
+
**App(s)**: {web / mobile / cả hai}
|
|
13
|
+
**Framework**: {framework thực — VD: Flutter, React, Vue...}
|
|
14
|
+
**State Management**: {state management thực — VD: Riverpod, BLoC, Redux...}
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 1. Danh Sách Màn Hình
|
|
19
|
+
|
|
20
|
+
<!-- HƯỚNG DẪN: Scan route definitions, navigation, GoRouter, Navigator.push...
|
|
21
|
+
Liệt kê TẤT CẢ màn hình/screens/pages thuộc module.
|
|
22
|
+
-->
|
|
23
|
+
|
|
24
|
+
| # | Màn hình | Route/Path | Component/Widget chính | State Manager | Mô tả chức năng |
|
|
25
|
+
|---|---|---|---|---|---|
|
|
26
|
+
| 1 | {tên màn hình thực} | {route thực} | {widget/component thực} | {state manager thực} | {mô tả} |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. Chi Tiết Từng Màn Hình
|
|
31
|
+
|
|
32
|
+
### Màn hình: {Tên màn hình thực}
|
|
33
|
+
|
|
34
|
+
**Route**: {route thực}
|
|
35
|
+
**Component**: `{WidgetThực}` — File: `{file_thực}`
|
|
36
|
+
**State**: `{StateManagerThực}` — File: `{state_file_thực}`
|
|
37
|
+
|
|
38
|
+
**UI Elements chính:**
|
|
39
|
+
|
|
40
|
+
| Element | Loại | Behavior | State liên quan |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
| {element thực từ code} | {loại widget} | {behavior mô tả từ code} | `{state_field_thực}` |
|
|
43
|
+
|
|
44
|
+
**Fields Mapping (UI → API → DB):**
|
|
45
|
+
|
|
46
|
+
<!-- HƯỚNG DẪN: So sánh tên fields trong UI form/display với tên fields trong API DTO và DB columns.
|
|
47
|
+
Tạo bảng mapping CHÍNH XÁC từ code thực tế.
|
|
48
|
+
-->
|
|
49
|
+
|
|
50
|
+
| UI Label | UI Component | API Field (Request) | API Field (Response) | DB Column | Validation |
|
|
51
|
+
|---|---|---|---|---|---|
|
|
52
|
+
| "{label thực}" | {component} | `{api_field}` | `{response_field}` | `{db_column}` | {validation} |
|
|
53
|
+
|
|
54
|
+
**User Flow:**
|
|
55
|
+
|
|
56
|
+
<!-- HƯỚNG DẪN: Mô tả step-by-step thao tác người dùng.
|
|
57
|
+
Phải phản ánh đúng UX thực tế trong code (navigation, loading states, error handling).
|
|
58
|
+
-->
|
|
59
|
+
|
|
60
|
+
1. {bước 1 — action người dùng}
|
|
61
|
+
2. {bước 2 — hệ thống phản hồi}
|
|
62
|
+
3. {bước 3 — action tiếp theo}
|
|
63
|
+
|
|
64
|
+
**API Calls:**
|
|
65
|
+
|
|
66
|
+
| Action | Endpoint / Method Call | Trigger | Loading State | Error Handling |
|
|
67
|
+
|---|---|---|---|---|
|
|
68
|
+
| {action} | `{endpoint/method thực}` | {trigger} | `{loading_state_thực}` | {error handling} |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### Màn hình: {Tên màn hình thực 2}
|
|
73
|
+
|
|
74
|
+
**Route**: {route thực}
|
|
75
|
+
**Component**: `{WidgetThực}` — File: `{file_thực}`
|
|
76
|
+
|
|
77
|
+
**UI Elements chính:**
|
|
78
|
+
|
|
79
|
+
| Element | Loại | Behavior | Điều kiện hiển thị |
|
|
80
|
+
|---|---|---|---|
|
|
81
|
+
| {element thực} | {loại} | {behavior} | {điều kiện} |
|
|
82
|
+
|
|
83
|
+
**Conditional UI (nếu có phân quyền):**
|
|
84
|
+
|
|
85
|
+
<!-- HƯỚNG DẪN: Chỉ điền section này nếu UI thay đổi theo role/status.
|
|
86
|
+
Nếu không có conditional UI → bỏ section này.
|
|
87
|
+
-->
|
|
88
|
+
|
|
89
|
+
| Điều kiện | UI thay đổi | File reference |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| {điều kiện từ code} | {UI element thay đổi} | `{file_thực}:{line}` |
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<!-- HEADING MAP — Agent PHẢI dùng CHÍNH XÁC các heading dưới đây:
|
|
2
|
+
# Use Cases: {Tên Module}
|
|
3
|
+
## 1. Luồng Nghiệp Vụ E2E (End-to-End Flows)
|
|
4
|
+
### Flow 1: {Tên luồng chính}
|
|
5
|
+
### Flow 2: {Tên luồng phụ}
|
|
6
|
+
## 2. Business Rules Chi Tiết
|
|
7
|
+
### BR-01: {Tên rule cụ thể}
|
|
8
|
+
### BR-02: {Tên rule}
|
|
9
|
+
## 3. State Machine
|
|
10
|
+
## 4. Actors & Permissions (Tóm tắt)
|
|
11
|
+
-->
|
|
12
|
+
# Use Cases: {Tên Module}
|
|
13
|
+
|
|
14
|
+
> **Audience chính**: BA, PO, Domain Expert
|
|
15
|
+
> **AI generate**: Draft từ deep code scan → Human bổ sung business context, SLA
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 1. Luồng Nghiệp Vụ E2E (End-to-End Flows)
|
|
20
|
+
|
|
21
|
+
> ⚠️ Mỗi flow phải mô tả CHÍNH XÁC luồng chạy trong code: từ entry point → xử lý → lưu DB → response.
|
|
22
|
+
> KHÔNG viết chung chung. Phải ghi rõ file/hàm nào xử lý bước nào.
|
|
23
|
+
|
|
24
|
+
### Flow 1: {Tên luồng chính}
|
|
25
|
+
|
|
26
|
+
**Trigger**: {Ai trigger, khi nào}
|
|
27
|
+
**Entry point**: `{file_thực}` → hàm `{function_thực}`
|
|
28
|
+
|
|
29
|
+
**Chi tiết luồng:**
|
|
30
|
+
|
|
31
|
+
<!-- HƯỚNG DẪN: Mô tả từng bước chạy trong code, dạng:
|
|
32
|
+
1. [Layer] Mô tả — File: file_thực:line
|
|
33
|
+
2. [Layer] Mô tả — File: file_thực:line
|
|
34
|
+
Các layer phổ biến: UI, Controller, Service, Repository, DB, Side-effect, Response
|
|
35
|
+
-->
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
1. [{Layer}] {mô tả bước 1} — File: {file_thực}:{line}
|
|
39
|
+
2. [{Layer}] {mô tả bước 2} — File: {file_thực}:{line}
|
|
40
|
+
3. [{Layer}] {mô tả bước 3} — File: {file_thực}:{line}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
<!-- HƯỚNG DẪN: Vẽ sequence diagram cho flow phức tạp.
|
|
44
|
+
Thay tên participant bằng tên THỰC TẾ từ codebase (class names, file names).
|
|
45
|
+
-->
|
|
46
|
+
|
|
47
|
+
```mermaid
|
|
48
|
+
sequenceDiagram
|
|
49
|
+
actor User
|
|
50
|
+
participant A as {ComponentThực1}
|
|
51
|
+
participant B as {ComponentThực2}
|
|
52
|
+
participant C as {ComponentThực3}
|
|
53
|
+
|
|
54
|
+
User->>A: {action thực}
|
|
55
|
+
A->>B: {method call thực}
|
|
56
|
+
B->>C: {operation thực}
|
|
57
|
+
C-->>B: {response}
|
|
58
|
+
B-->>A: {result}
|
|
59
|
+
A-->>User: {UI feedback}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Flow 2: {Tên luồng phụ}
|
|
63
|
+
|
|
64
|
+
**Trigger**: {Ai trigger, khi nào}
|
|
65
|
+
**Entry point**: `{file_thực}` → hàm `{function_thực}`
|
|
66
|
+
|
|
67
|
+
**Chi tiết luồng:**
|
|
68
|
+
```
|
|
69
|
+
1. [{Layer}] {mô tả} — File: {file_thực}:{line}
|
|
70
|
+
...
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 2. Business Rules Chi Tiết
|
|
76
|
+
|
|
77
|
+
> ⚠️ Trích xuất TỪ CODE. Mỗi rule PHẢI có file reference. Không viết chung chung.
|
|
78
|
+
|
|
79
|
+
### BR-01: {Tên rule cụ thể}
|
|
80
|
+
|
|
81
|
+
<!-- HƯỚNG DẪN: Mỗi rule phải có:
|
|
82
|
+
- Điều kiện: Khi nào rule apply
|
|
83
|
+
- Hành động: Hệ thống làm gì
|
|
84
|
+
- Code reference: file:line + đoạn code ngắn THỰC TẾ
|
|
85
|
+
- Ngoại lệ: Trường hợp ngoại lệ nếu có
|
|
86
|
+
-->
|
|
87
|
+
|
|
88
|
+
- **Điều kiện**: {Khi nào rule apply}
|
|
89
|
+
- **Hành động**: {Hệ thống làm gì}
|
|
90
|
+
- **Code reference**: `{file_thực}:{line}` — `{đoạn code ngắn thực tế}`
|
|
91
|
+
- **Ngoại lệ**: {Trường hợp ngoại lệ nếu có}
|
|
92
|
+
- **SLA**: {Thời gian / ràng buộc nếu có} [❓ CẦN HUMAN BỔ SUNG]
|
|
93
|
+
- [⚠️ AI-inferred]
|
|
94
|
+
|
|
95
|
+
### BR-02: {Tên rule}
|
|
96
|
+
|
|
97
|
+
- **Điều kiện**: ...
|
|
98
|
+
- **Hành động**: ...
|
|
99
|
+
- **Code reference**: `{file_thực}:{line}`
|
|
100
|
+
- [⚠️ AI-inferred]
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 3. State Machine
|
|
105
|
+
|
|
106
|
+
> ⚠️ States và transitions phải lấy TỪ CODE (enum definitions, transition logic). Không bịa.
|
|
107
|
+
> Source: `{enum_file_thực}` — enum `{EnumName_thực}`
|
|
108
|
+
|
|
109
|
+
<!-- HƯỚNG DẪN: Vẽ stateDiagram với states THỰC TẾ từ code.
|
|
110
|
+
Lấy từ enum definitions, const values trong codebase.
|
|
111
|
+
TUYỆT ĐỐI KHÔNG copy states mẫu (DRAFT, PENDING_APPROVAL, APPROVED...) nếu module không có.
|
|
112
|
+
Nếu module không có state machine → ghi rõ "Module không có state machine" và bỏ section này.
|
|
113
|
+
-->
|
|
114
|
+
|
|
115
|
+
```mermaid
|
|
116
|
+
stateDiagram-v2
|
|
117
|
+
[*] --> {STATE_1} : {event tạo}
|
|
118
|
+
{STATE_1} --> {STATE_2} : {event chuyển}
|
|
119
|
+
{STATE_2} --> {STATE_3} : {event chuyển}
|
|
120
|
+
{STATE_3} --> [*]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
| Từ trạng thái | Sang trạng thái | Trigger (Event) | Điều kiện (Guards) | Ai được phép | File reference |
|
|
124
|
+
|---|---|---|---|---|---|
|
|
125
|
+
| `{STATE_1}` | `{STATE_2}` | {event} | {điều kiện} | {actor} | `{file_thực}:{line}` |
|
|
126
|
+
|
|
127
|
+
**Side-Effects khi chuyển state:**
|
|
128
|
+
|
|
129
|
+
| Transition | Side-Effect | File reference |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| → `{STATE}` | {mô tả side-effect} | `{file_thực}:{line}` |
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 4. Actors & Permissions (Tóm tắt)
|
|
136
|
+
|
|
137
|
+
> Chi tiết đầy đủ xem [permissions.md](permissions.md)
|
|
138
|
+
|
|
139
|
+
| Actor (Role) | Quyền trong module | Phạm vi dữ liệu | Ghi chú |
|
|
140
|
+
|---|---|---|---|
|
|
141
|
+
| `{ROLE_1}` | {quyền} | {phạm vi} | |
|
|
142
|
+
| `{ROLE_2}` | {quyền} | {phạm vi} | |
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Module Template — Subgraph Composition
|
|
2
|
+
# Mỗi module = 1 reusable subgraph trong V Flow pipeline.
|
|
3
|
+
# Lấy cảm hứng từ LangGraph Subgraphs — encapsulated workflows có input/output rõ ràng.
|
|
4
|
+
#
|
|
5
|
+
# Module che giấu internal complexity — parent pipeline chỉ cần biết input/output.
|
|
6
|
+
|
|
7
|
+
# ─ Cách dùng ─────────────────────────────────────────────────────
|
|
8
|
+
# 1. Tạo file module definition: .v-flow/modules/[name].yaml
|
|
9
|
+
# 2. Dùng module trong pipeline: /v.plan --module security
|
|
10
|
+
# 3. Compose nhiều modules: /v.plan --modules "security,ux,api"
|
|
11
|
+
# ─────────────────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
# ═══════════════════════════════════════════════════════════════
|
|
14
|
+
# Module: Build (B.0)
|
|
15
|
+
# ═══════════════════════════════════════════════════════════════
|
|
16
|
+
module_build:
|
|
17
|
+
name: "build"
|
|
18
|
+
description: "Plan + Test + Optional Agents chạy song song"
|
|
19
|
+
phase: "B.0"
|
|
20
|
+
|
|
21
|
+
input_required:
|
|
22
|
+
- "spec.md (approved)"
|
|
23
|
+
- "constitution.md"
|
|
24
|
+
- "context.md (nếu legacy)"
|
|
25
|
+
|
|
26
|
+
output_produces:
|
|
27
|
+
- "plan.md"
|
|
28
|
+
- "tasks.md"
|
|
29
|
+
- "test-cases.md"
|
|
30
|
+
- "security-review.md (optional)"
|
|
31
|
+
- "ux-checklist.md (optional)"
|
|
32
|
+
|
|
33
|
+
composed_of:
|
|
34
|
+
- command: "/v.plan"
|
|
35
|
+
parallel: true
|
|
36
|
+
required: true
|
|
37
|
+
- command: "/v.test"
|
|
38
|
+
parallel: true
|
|
39
|
+
required: true
|
|
40
|
+
- command: "/v-flow.security"
|
|
41
|
+
parallel: true
|
|
42
|
+
required: false
|
|
43
|
+
trigger_keywords: ["auth", "login", "payment", "JWT", "API key"]
|
|
44
|
+
|
|
45
|
+
exit_condition:
|
|
46
|
+
all_required_complete: true
|
|
47
|
+
output_synced_to_spec: true
|
|
48
|
+
|
|
49
|
+
next_module: "review"
|
|
50
|
+
|
|
51
|
+
# ═══════════════════════════════════════════════════════════════
|
|
52
|
+
# Module: Review (R.0 + R.1)
|
|
53
|
+
# ═══════════════════════════════════════════════════════════════
|
|
54
|
+
module_review:
|
|
55
|
+
name: "review"
|
|
56
|
+
description: "Master Check → Gate → Code Review"
|
|
57
|
+
phase: "R.0 → R.1"
|
|
58
|
+
|
|
59
|
+
input_required:
|
|
60
|
+
- "plan.md"
|
|
61
|
+
- "tasks.md"
|
|
62
|
+
- "test-cases.md"
|
|
63
|
+
- "spec.md"
|
|
64
|
+
|
|
65
|
+
output_produces:
|
|
66
|
+
- "validation-report.md"
|
|
67
|
+
|
|
68
|
+
composed_of:
|
|
69
|
+
- command: "/v.check"
|
|
70
|
+
required: true
|
|
71
|
+
- command: "human_gate" # pause for human approval
|
|
72
|
+
required: true
|
|
73
|
+
|
|
74
|
+
routing:
|
|
75
|
+
PASS: "implement_module"
|
|
76
|
+
PASS_WITH_CONCERNS: "implement_module"
|
|
77
|
+
FAIL:
|
|
78
|
+
spec_gap: "specify_module"
|
|
79
|
+
plan_gap: "build_module"
|
|
80
|
+
test_gap: "build_module"
|
|
81
|
+
|
|
82
|
+
next_module: "implement"
|
|
83
|
+
|
|
84
|
+
# ═══════════════════════════════════════════════════════════════
|
|
85
|
+
# Module: Implement (B.1)
|
|
86
|
+
# ═══════════════════════════════════════════════════════════════
|
|
87
|
+
module_implement:
|
|
88
|
+
name: "implement"
|
|
89
|
+
description: "TDD implementation + Code Review"
|
|
90
|
+
phase: "B.1 → R.1"
|
|
91
|
+
|
|
92
|
+
input_required:
|
|
93
|
+
- "plan.md"
|
|
94
|
+
- "tasks.md"
|
|
95
|
+
- "test-cases.md"
|
|
96
|
+
- "validation-report.md (PASS or PASS_WITH_CONCERNS)"
|
|
97
|
+
|
|
98
|
+
output_produces:
|
|
99
|
+
- "source code"
|
|
100
|
+
- "test files"
|
|
101
|
+
- "updated tasks.md [x]"
|
|
102
|
+
|
|
103
|
+
composed_of:
|
|
104
|
+
- command: "/v.implement"
|
|
105
|
+
required: true
|
|
106
|
+
- command: "/v.review"
|
|
107
|
+
required: true
|
|
108
|
+
|
|
109
|
+
routing:
|
|
110
|
+
APPROVED: "metrics_module"
|
|
111
|
+
CHANGES_REQUIRED: "self" # loop back — fix and re-review
|
|
112
|
+
|
|
113
|
+
next_module: "metrics"
|
|
114
|
+
|
|
115
|
+
# ═══════════════════════════════════════════════════════════════
|
|
116
|
+
# Module: Quick Fix (Prebuilt Composed Subgraph)
|
|
117
|
+
# ═══════════════════════════════════════════════════════════════
|
|
118
|
+
module_quickfix:
|
|
119
|
+
name: "quickfix"
|
|
120
|
+
description: "Mini Spec → Implement → Quick Review (skip full pipeline)"
|
|
121
|
+
phase: "S.1 → B.1 → R.1"
|
|
122
|
+
|
|
123
|
+
input_required:
|
|
124
|
+
- "bug description / change request"
|
|
125
|
+
- "constitution.md"
|
|
126
|
+
|
|
127
|
+
output_produces:
|
|
128
|
+
- "mini spec.md"
|
|
129
|
+
- "code fix"
|
|
130
|
+
- "review report"
|
|
131
|
+
|
|
132
|
+
composed_of:
|
|
133
|
+
- command: "/v.quickfix" # uses internal phases
|
|
134
|
+
required: true
|
|
135
|
+
|
|
136
|
+
exit_condition:
|
|
137
|
+
review_verdict: ["APPROVED", "APPROVED_WITH_NOTES"]
|
|
138
|
+
|
|
139
|
+
# ═══════════════════════════════════════════════════════════════
|
|
140
|
+
# Full Pipeline Composition
|
|
141
|
+
# ═══════════════════════════════════════════════════════════════
|
|
142
|
+
pipeline_full:
|
|
143
|
+
name: "full_pipeline"
|
|
144
|
+
modules:
|
|
145
|
+
- "specify" # S.1 → spec.md
|
|
146
|
+
- "build" # B.0 → plan + tests + optional agents
|
|
147
|
+
- "review" # R.0 → master check + gate
|
|
148
|
+
- "implement" # B.1 + R.1 → code + review
|
|
149
|
+
- "metrics" # M.0 → retrospective + metrics
|
|
150
|
+
|
|
151
|
+
# Prebuilt alternatives:
|
|
152
|
+
# quickfix_pipeline: ["quickfix"]
|
|
153
|
+
# hotfix_pipeline: ["hotfix"]
|
|
154
|
+
|
|
155
|
+
pipeline_quickfix:
|
|
156
|
+
name: "quickfix_pipeline"
|
|
157
|
+
modules: ["quickfix"]
|
|
158
|
+
|
|
159
|
+
pipeline_hotfix:
|
|
160
|
+
name: "hotfix_pipeline"
|
|
161
|
+
modules: ["hotfix"]
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Template: Operations Report — Báo cáo Vận hành
|
|
2
|
+
|
|
3
|
+
> Tạo bởi Operations Agent (**O.0**) hoặc thủ công khi có incident.
|
|
4
|
+
> Lưu tại: `.v-flow/features/NNN-ten-feature/operations-report.md` hoặc `.v-flow/incidents/INC-NNN.md`
|
|
5
|
+
|
|
6
|
+
## Thông tin Incident
|
|
7
|
+
|
|
8
|
+
| Mục | Giá trị |
|
|
9
|
+
|-----|--------|
|
|
10
|
+
| **Incident ID** | INC-[NNN] |
|
|
11
|
+
| **Severity** | 🔴 P1 / 🟡 P2 / 🔵 P3 / ⚪ P4 |
|
|
12
|
+
| **Phát hiện lúc** | [YYYY-MM-DD HH:MM UTC] |
|
|
13
|
+
| **Phát hiện bởi** | Operations Agent / Manual / Monitoring alert |
|
|
14
|
+
| **Resolved lúc** | [YYYY-MM-DD HH:MM UTC] |
|
|
15
|
+
| **Duration** | [X phút / giờ] |
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 1. Mô tả sự cố
|
|
20
|
+
|
|
21
|
+
### Triệu chứng
|
|
22
|
+
<!-- Mô tả ngắn gọn: cái gì bị lỗi, users thấy gì -->
|
|
23
|
+
|
|
24
|
+
### Timeline
|
|
25
|
+
| Thời gian | Sự kiện |
|
|
26
|
+
|-----------|---------|
|
|
27
|
+
| [HH:MM] | [Anomaly đầu tiên được phát hiện] |
|
|
28
|
+
| [HH:MM] | [Hành động đầu tiên] |
|
|
29
|
+
| [HH:MM] | [Fix được deploy] |
|
|
30
|
+
| [HH:MM] | [Confirmed resolved] |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Impact — Ảnh hưởng
|
|
35
|
+
|
|
36
|
+
| Metric | Giá trị |
|
|
37
|
+
|--------|--------|
|
|
38
|
+
| Users bị ảnh hưởng | |
|
|
39
|
+
| Error rate (peak) | |
|
|
40
|
+
| Services bị ảnh hưởng | |
|
|
41
|
+
| Revenue impact (nếu có) | |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 3. Root Cause Analysis
|
|
46
|
+
|
|
47
|
+
### Nguyên nhân gốc
|
|
48
|
+
<!-- Mô tả chi tiết nguyên nhân -->
|
|
49
|
+
|
|
50
|
+
### Feature / Component liên quan
|
|
51
|
+
| Mục | Giá trị |
|
|
52
|
+
|-----|--------|
|
|
53
|
+
| Feature | #[NNN] — [Tên feature] |
|
|
54
|
+
| Spec | `.v-flow/features/NNN/spec.md` |
|
|
55
|
+
| Commit gây lỗi | [commit hash] — [message] |
|
|
56
|
+
| File | [path:line] |
|
|
57
|
+
|
|
58
|
+
### Phân loại nguyên nhân
|
|
59
|
+
- [ ] Code bug (logic error, unhandled exception)
|
|
60
|
+
- [ ] Data issue (schema mismatch, bad data)
|
|
61
|
+
- [ ] Infrastructure (resource exhaustion, config error)
|
|
62
|
+
- [ ] External dependency (3rd party API down)
|
|
63
|
+
- [ ] Deployment issue (failed migration, config)
|
|
64
|
+
- [ ] Khác: ___
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 4. Resolution — Giải pháp
|
|
69
|
+
|
|
70
|
+
### Hành động đã thực hiện
|
|
71
|
+
1. [Mô tả fix]
|
|
72
|
+
|
|
73
|
+
### Fix verification
|
|
74
|
+
- [ ] Fix đã deploy
|
|
75
|
+
- [ ] Error rate trở về baseline
|
|
76
|
+
- [ ] Không có side effects
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 5. Lessons Learned & Prevention
|
|
81
|
+
|
|
82
|
+
### Test gaps phát hiện
|
|
83
|
+
<!-- Test cases nào bị thiếu mà nên có? -->
|
|
84
|
+
- [ ] [Test case cần thêm]
|
|
85
|
+
|
|
86
|
+
### Process gaps
|
|
87
|
+
<!-- Quy trình nào cần cải thiện? -->
|
|
88
|
+
- [ ] [Process improvement]
|
|
89
|
+
|
|
90
|
+
### Follow-up actions
|
|
91
|
+
| Action | Owner | Deadline | Status |
|
|
92
|
+
|--------|-------|----------|--------|
|
|
93
|
+
| [Thêm test case] | [Tên] | [Date] | [ ] |
|
|
94
|
+
| [Cập nhật spec/plan] | [Tên] | [Date] | [ ] |
|
|
95
|
+
| [Cập nhật monitoring] | [Tên] | [Date] | [ ] |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 6. Traceability
|
|
100
|
+
|
|
101
|
+
| Artifact | Link |
|
|
102
|
+
|----------|------|
|
|
103
|
+
| Spec gốc | `.v-flow/features/NNN/spec.md` |
|
|
104
|
+
| Plan gốc | `.v-flow/features/NNN/plan.md` |
|
|
105
|
+
| Test cases | `.v-flow/features/NNN/test-cases.md` |
|
|
106
|
+
| Metrics report | `.v-flow/features/NNN/metrics-report.md` |
|
|
107
|
+
| Fix PR/MR | [link to merge request] |
|
|
108
|
+
| Monitoring dashboard | [link to dashboard] |
|