@shanyucoder/flowgrid 0.1.8 → 0.1.10

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 (98) hide show
  1. package/bin/flowgrid.mjs +43 -9
  2. package/bin/lib/audit-run.mjs +5 -1
  3. package/bin/lib/docs-hub-locale.mjs +9 -0
  4. package/bin/lib/init-scaffold.mjs +30 -2
  5. package/dist/docs/mcp/tools.js +4 -4
  6. package/dist/docs/mcp/tools.js.map +1 -1
  7. package/dist/docs/scan/ids.d.ts +1 -1
  8. package/dist/docs/scan/ids.js +6 -6
  9. package/dist/docs/scan/ids.js.map +1 -1
  10. package/dist/docs/scan/route.js +2 -2
  11. package/dist/docs/scan/route.js.map +1 -1
  12. package/engines/cases/render-cases.mjs +33 -25
  13. package/engines/docs/lib/audit-hub-prd.mjs +136 -0
  14. package/engines/docs/lib/audit-risks-catalog.mjs +142 -0
  15. package/engines/docs/lib/docs-hub-locale.mjs +100 -0
  16. package/engines/docs/lib/qa-item.mjs +91 -0
  17. package/engines/docs/lib/render-bundle-markdown.mjs +8 -1
  18. package/engines/docs/lib/render-qa-list.mjs +123 -25
  19. package/engines/docs/vitepress/config.ts +4 -4
  20. package/engines/spec/lib/audit-bundle-gaps.mjs +38 -7
  21. package/engines/spec/lib/audit-flow-gaps.mjs +2 -2
  22. package/engines/spec/lib/bundle-schema.mjs +3 -1
  23. package/engines/spec/lib/open-qa.mjs +71 -21
  24. package/engines/testcase/runners/lib/resolve-hub-id.mjs +3 -3
  25. package/harness/common/skills/legacy/SKILL.md +2 -2
  26. package/harness/docs/extracts/agent-execution-protocol.md +2 -2
  27. package/harness/docs/extracts/api-codegen-readiness.md +1 -1
  28. package/harness/docs/extracts/api-spec-sync.md +1 -1
  29. package/harness/docs/extracts/call-external.md +1 -1
  30. package/harness/docs/extracts/common-scope.md +8 -8
  31. package/harness/docs/extracts/design-leaf-signoff.md +2 -2
  32. package/harness/docs/extracts/extract-registry.docs.json +2 -1
  33. package/harness/docs/extracts/qa-inbox.md +19 -10
  34. package/harness/docs/extracts/qa-team.md +32 -0
  35. package/harness/docs/extracts/spec-core.md +1 -1
  36. package/harness/docs/extracts/spec-evolution.md +1 -1
  37. package/harness/docs/extracts/spec-prd-lite.md +11 -13
  38. package/harness/docs/extracts/tpl-module.md +9 -40
  39. package/harness/docs/extracts/tpl-overview-prd.md +11 -0
  40. package/harness/docs/extracts/tpl-risk-register.md +28 -0
  41. package/harness/docs/extracts/tpl-surface-prd.md +7 -0
  42. package/harness/docs/rules/docs-hub.mdc +1 -1
  43. package/harness/docs/rules/flowgrid-process.mdc +1 -1
  44. package/harness/docs/schemas/flowgrid-docs/qa-item.schema.json +65 -0
  45. package/harness/docs/skills/adopt/SKILL.md +1 -1
  46. package/harness/docs/skills/api-spec/SKILL.md +1 -1
  47. package/harness/docs/skills/api-update/SKILL.md +1 -1
  48. package/harness/docs/skills/background-logic/SKILL.md +1 -1
  49. package/harness/docs/skills/common-spec/SKILL.md +1 -1
  50. package/harness/docs/skills/cross-service/SKILL.md +1 -1
  51. package/harness/docs/skills/db-erd/SKILL.md +1 -1
  52. package/harness/docs/skills/grill/SKILL.md +2 -0
  53. package/harness/docs/skills/grill-bqa/SKILL.md +2 -2
  54. package/harness/docs/skills/grill-dev/SKILL.md +1 -1
  55. package/harness/docs/skills/grill-docs/SKILL.md +2 -2
  56. package/harness/docs/skills/grill-hub-prd/SKILL.md +38 -0
  57. package/harness/docs/skills/module/SKILL.md +8 -5
  58. package/harness/docs/skills/overview/SKILL.md +7 -6
  59. package/harness/docs/skills/qa-resolve/SKILL.md +13 -12
  60. package/harness/docs/skills/qa-review/SKILL.md +45 -0
  61. package/harness/docs/skills/risk-register/SKILL.md +29 -0
  62. package/harness/docs/skills/spec/SKILL.md +4 -4
  63. package/harness/docs/skills/surfaces/SKILL.md +3 -1
  64. package/harness/docs/skills/update-spec/SKILL.md +2 -2
  65. package/harness/docs/skills/{business-process → user-flow}/SKILL.md +8 -8
  66. package/harness/fe/extracts/wire-audit-loop.md +1 -1
  67. package/harness/fe/skills/gen-common/SKILL.md +1 -1
  68. package/harness/fe/skills/grill-wire/SKILL.md +1 -1
  69. package/harness/fe/skills/wire/SKILL.md +1 -1
  70. package/harness/tests/extracts/grill-scenario-flow.md +2 -2
  71. package/harness/tests/skills/grill-testcase/SKILL.md +1 -1
  72. package/harness/tests/skills/scenario/SKILL.md +11 -11
  73. package/harness/tests/skills/testcase/SKILL.md +1 -1
  74. package/harness/tests/templates/SC.example.md +16 -16
  75. package/lexicon/registry-tags.en.txt +2 -2
  76. package/package.json +1 -1
  77. package/templates/project-skeleton/architecture/03-business-process/index.md +3 -0
  78. package/templates/project-skeleton/architecture/{03-business-process → 03-user-flows}/FLOW-login.md +6 -6
  79. package/templates/project-skeleton/architecture/{03-business-process → 03-user-flows}/FLOW-template.md +6 -7
  80. package/templates/project-skeleton/architecture/11-risks/index.md +7 -17
  81. package/templates/project-skeleton/architecture/11-risks/risk-register.md +34 -0
  82. package/templates/project-skeleton/architecture/12-glossary/index.md +2 -1
  83. package/templates/project-skeleton/overview/index.md +21 -43
  84. package/templates/project-skeleton/overview/operational-areas/_template.md +15 -22
  85. package/templates/project-skeleton/qa/README.md +4 -8
  86. package/templates/project-skeleton/surfaces/_module-index.template.md +40 -0
  87. package/templates/project-skeleton/surfaces/_surface-index.template.md +43 -0
  88. package/templates/schemas/qa-item.schema.json +98 -0
  89. package/templates/shared/bundle-authoring.md +10 -6
  90. package/templates/shared/default-layout.ejs +108 -62
  91. package/templates/shared/feature.bundle.yaml +15 -6
  92. package/templates/shared/ir/generated/spec.md +24 -24
  93. package/templates/shared/ir-spec.yaml +1 -1
  94. package/templates/shared/qa-authoring.md +78 -0
  95. package/templates/shared/qa-item.yaml +35 -14
  96. package/templates/shared/tpl-api-contract.md +6 -6
  97. package/templates/tests-skeleton/catalog/locale.yaml +16 -15
  98. package/templates/tests-skeleton/tpl-testcase-plan.md +6 -6
@@ -56,7 +56,7 @@ flowgrid audit e2e --e2e-root <playwright-dir> --tests-docs "$FLOWGRID_TESTS_DOC
56
56
  Optional: pass explicit `cases/**/TC-*.yaml` paths instead of `--tests-docs`.
57
57
 
58
58
  - Parse JSON: `missingInPlaywright`, `matrixRowsUncovered`, `orphanTestCases`, `orphanSpecs`, `gaps[]`.
59
- - **[MANDATORY]** Fix or defer every `critical` / `warning` gap before marking wire done; log deferrals in `qa/open` if team policy allows.
59
+ - **[MANDATORY]** Fix or defer every `critical` / `warning` gap before marking wire done; log deferrals in `qa` if team policy allows.
60
60
  - **[MANDATORY]** Portal leaf with `apiRef`: `flowgrid audit fe-be <bundle.yaml>`.
61
61
  - **[MANDATORY]** When `SC-*` covers screen: `flowgrid audit scenario <SC.yaml> --tests-docs "$FLOWGRID_TESTS_DOC"`.
62
62
 
@@ -4,7 +4,7 @@ Hub SSOT: `docs/workflows/test.md#grill-scenario-flow`.
4
4
 
5
5
  ## Scope
6
6
 
7
- - Docs **`FLOW-*.md`** exists (Phase 0 / business-process) — **no SC without FLOW**
7
+ - Docs **`FLOW-*.md`** exists (Phase 0 / user-flow) — **no SC without FLOW**
8
8
  - Tests: `scenarios/<mirror>/FLOW-<name>/SC-*.yaml` with `screens: [W-*, W-*, …]`
9
9
  - **Per screen touched:** at least one `cases/…/TC-*.yaml` OR documented defer (`coverage_deferred` + `QA-*` on docs)
10
10
 
@@ -36,4 +36,4 @@ Hub SSOT: `docs/workflows/test.md#grill-scenario-flow`.
36
36
  - [ ] Each screen's TC passed `cases:gate --strict` traceability
37
37
  - [ ] SC `screens[]` matches docs FLOW touchpoints (spot vs `FLOW-*.md`)
38
38
 
39
- Handoff thin FLOW → `/docs-hub /business-process` or `/update-spec` — not tests hub.
39
+ Handoff thin FLOW → `/docs-hub /user-flow` or `/update-spec` — not tests hub.
@@ -26,7 +26,7 @@ query a workspace-parent graph.
26
26
  - **[MANDATORY]** Read the entire function **`*.bundle.yaml`** (sibling of `ir/`). Cross-reference plans against bundle `userStories`, `acceptanceCriteria`, `spec.ui`, and `design.*` — not split IR files.
27
27
  - If scenarios/acceptance are thin or missing → hand off docs-hub `/update-spec` or `/spec` (paste-ready prompt). Do not patch bundle from tests hub.
28
28
  - **[STRICTLY FORBIDDEN]** Do NOT read generated `*.md`.
29
- - If auditing **SC-***, the YAML/MD path MUST mirror the docs `FLOW-*.md` (cluster/module/surface `common/processes/` or `architecture/03-business-process/`). Flag `scenarios/auth/…` or `common/` leftovers.
29
+ - If auditing **SC-***, the YAML/MD path MUST mirror the docs `FLOW-*.md` (cluster/module/surface `common/user-flows/` or `architecture/03-user-flows/`). Flag `scenarios/auth/…` or `common/` leftovers.
30
30
 
31
31
  ## Audit Rules
32
32
 
@@ -13,7 +13,7 @@ disable-model-invocation: true
13
13
 
14
14
  Author cross-flow scenarios (SC) on the current tests hub. Design rules stay on the docs hub.
15
15
 
16
- Scenarios test a **business process** (`FLOW-*`) that spans multiple screens (`W-*`) or modules. They mirror the docs FLOW file **after** bộ docs LCA `common/` placement (not a flat `common/` tree).
16
+ Scenarios test a **user flow** (`FLOW-*`) that spans multiple screens (`W-*`) or modules. They mirror the docs FLOW file **after** bộ docs LCA `common/` placement (not a flat `common/` tree).
17
17
 
18
18
  ## Output Rules
19
19
 
@@ -30,12 +30,12 @@ Scenarios test a **business process** (`FLOW-*`) that spans multiple screens (`W
30
30
 
31
31
  - **[MANDATORY]** Agent MUST locate the **`FLOW-*.md`** file on the docs hub (`FLOWGRID_DOCS_ROOT`) via `flowgrid_docs_route` / `flowgrid_docs_get_element` / glob. Filenames are `FLOW-…md`, not `flow-*`.
32
32
  - Search in this order (same LCA as bộ docs `common-scope.md`):
33
- 1. `surfaces/<surface>/<CMP-id>/<NN>/common/processes/FLOW-*.md` (cluster)
34
- 2. `surfaces/<surface>/<CMP-id>/common/processes/FLOW-*.md` (module)
35
- 3. `surfaces/<surface>/common/processes/FLOW-*.md` (surface)
36
- 4. `surfaces/common/processes/FLOW-*.md` (cross-surface product common)
37
- 5. `architecture/03-business-process/FLOW-*.md` (org catalog only)
38
- - **Strict:** Only author a scenario if that `FLOW-*.md` exists. Missing FLOW or thin business rules → hand off to docs-hub `/business-process` or `/update-spec`, do not invent SC. **[MANDATORY]** When handing off, you MUST output a comprehensive gap report (formatted as a complete, ready-to-use prompt starting with `/docs-hub`) detailing exactly what flows or business rules are missing, so the user can copy-paste it directly to run the docs-hub skill.
33
+ 1. `surfaces/<surface>/<CMP-id>/<NN>/common/user-flows/FLOW-*.md` (cluster)
34
+ 2. `surfaces/<surface>/<CMP-id>/common/user-flows/FLOW-*.md` (module)
35
+ 3. `surfaces/<surface>/common/user-flows/FLOW-*.md` (surface)
36
+ 4. `surfaces/common/user-flows/FLOW-*.md` (cross-surface product common)
37
+ 5. `architecture/03-user-flows/FLOW-*.md` (org catalog only)
38
+ - **Strict:** Only author a scenario if that `FLOW-*.md` exists. Missing FLOW or thin business rules → hand off to docs-hub `/user-flow` or `/update-spec`, do not invent SC. **[MANDATORY]** When handing off, you MUST output a comprehensive gap report (formatted as a complete, ready-to-use prompt starting with `/docs-hub`) detailing exactly what flows or business rules are missing, so the user can copy-paste it directly to run the docs-hub skill.
39
39
  - **[STRICTLY FORBIDDEN]** Do not treat `common/yaml/` or `common/patterns/` as scenario sources.
40
40
 
41
41
  ## Directory Mirroring Rule (Docs SSOT)
@@ -44,13 +44,13 @@ Mirror the FLOW file path onto the tests hub. Strip **only** these prefixes:
44
44
 
45
45
  | Docs FLOW path | Tests hub |
46
46
  |----------------|-----------|
47
- | `surfaces/<rest>/common/processes/FLOW-checkout.md` | `scenarios/<rest>/common/processes/FLOW-checkout/SC-*.yaml` |
48
- | `architecture/03-business-process/FLOW-checkout.md` | `scenarios/architecture/03-business-process/FLOW-checkout/SC-*.yaml` |
47
+ | `surfaces/<rest>/common/user-flows/FLOW-checkout.md` | `scenarios/<rest>/common/user-flows/FLOW-checkout/SC-*.yaml` |
48
+ | `architecture/03-user-flows/FLOW-checkout.md` | `scenarios/architecture/03-user-flows/FLOW-checkout/SC-*.yaml` |
49
49
 
50
50
  Examples:
51
51
 
52
- - Docs `surfaces/admin/CMP-ADM-002/02/common/processes/FLOW-checkout.md` → `scenarios/admin/CMP-ADM-002/02/common/processes/FLOW-checkout/SC-*.yaml`
53
- - Docs `surfaces/admin/CMP-ADM-002/common/processes/FLOW-onboard.md` → `scenarios/admin/CMP-ADM-002/common/processes/FLOW-onboard/SC-*.yaml`
52
+ - Docs `surfaces/admin/CMP-ADM-002/02/common/user-flows/FLOW-checkout.md` → `scenarios/admin/CMP-ADM-002/02/common/user-flows/FLOW-checkout/SC-*.yaml`
53
+ - Docs `surfaces/admin/CMP-ADM-002/common/user-flows/FLOW-onboard.md` → `scenarios/admin/CMP-ADM-002/common/user-flows/FLOW-onboard/SC-*.yaml`
54
54
 
55
55
  Do **not** flatten to `scenarios/auth/…`. Do **not** use `common/` (legacy). Keep numeric cluster folders (`02/`) in the tests path.
56
56
 
@@ -51,7 +51,7 @@ disable-model-invocation: true
51
51
  - **[MANDATORY]** Mirror function folder: `cases/<relative-path>/TC-*.yaml`.
52
52
  - ✅ `surfaces/admin/CMP-ADM-002/02/01/login/` → `cases/admin/CMP-ADM-002/02/01/login/TC-*.yaml`
53
53
  - ❌ `cases/admin/auth/W-…` — invented path not matching docs structure.
54
- - Cross-flow plans → `/scenario` (mirror `common/processes/FLOW-*` or `architecture/03-business-process/FLOW-*`).
54
+ - Cross-flow plans → `/scenario` (mirror `common/user-flows/FLOW-*` or `architecture/03-user-flows/FLOW-*`).
55
55
 
56
56
  ---
57
57
 
@@ -20,28 +20,28 @@ coverage_plan:
20
20
  Scenario thuộc **CMP-01-auth** · Tính năng năng lực **CAP-AUTH-001**.
21
21
  Quy tắc chi tiết và schema cơ sở dữ liệu tham chiếu tại **Docs Hub** (cite ID: `spec.yaml`).
22
22
 
23
- | Thuộc tính | Giá trị |
24
- |---|---|
23
+ | Attribute | Value |
24
+ | --- | --- |
25
25
  | **Scenario ID** | `SC-EXAMPLE` |
26
26
  | **Module** | `CMP-01-auth` |
27
- | **Bề mặt (Surface)** | `admin` |
28
- | **Màn hình (Screen)** | `W-AD-AUTH-001` (`/admin/records/create`) |
29
- | **Mức độ ưu tiên** | `High` |
27
+ | **Surface** | `admin` |
28
+ | **Screen** | `W-AD-AUTH-001` (`/admin/records/create`) |
29
+ | **Priority** | `High` |
30
30
 
31
- ## 1. Bối Cảnh Nghiệp Vụ & Phân Tích Rủi Ro (Business Context & Risk Analysis)
31
+ ## 1. Business context & risk analysis
32
32
 
33
33
  Màn hình khởi tạo hồ sơ là cửa ngõ dữ liệu tài chính của khách hàng. Nếu bỏ sót kiểm tra trùng mã hoặc không xử lý chặn click đúp (double-submit), hệ thống sẽ tạo các bản ghi rác gây xung đột số liệu doanh thu và vi phạm tính toàn vẹn dữ liệu kế toán.
34
34
 
35
- ## 2. Hành Vi Chuẩn BDD (Behavior: Given / When / Then)
35
+ ## 2. BDD behavior (Given / When / Then)
36
36
 
37
37
  - **Given (Tiền điều kiện):** Người dùng đăng nhập thành công với vai trò Quản trị viên (`ADMIN`), tài khoản có quyền `records.create`, và chưa tồn tại bản ghi nào có mã `REC-2026-001` trong cơ sở dữ liệu.
38
38
  - **When (Thao tác):** Người dùng nhập đầy đủ các trường thông tin hợp lệ (mã hồ sơ, tên hồ sơ, chọn gói dịch vụ) và nhấn nút "Lưu & Xác Nhận".
39
39
  - **Then (Hậu điều kiện):** Hệ thống khóa nút để tránh gửi trùng lặp, gửi request kèm header `X-Idempotency-Key`, tạo mới bản ghi thành công trong bảng `records`, hiển thị Toast thông báo màu xanh và điều hướng sang màn hình chi tiết `W-ADM-DETAIL-01`.
40
40
 
41
- ## 3. Ma Trận Test Phân Hoạch Tương Đương & Phân Tích Giá Trị Biên (Equivalence Partitioning & Boundary Test Matrix - IEEE 29119)
41
+ ## 3. Equivalence & boundary test matrix
42
42
 
43
- | Mã Case (Case ID) | Khía Cạnh Kiểm Thử (Facet) | Dữ Liệu Đầu Vào (Input Data) | Kết Quả Mong Đợi (Expected Outcome) | HTTP Status & UI State | Tự Động Hóa (Automation Case) |
44
- |---|---|---|---|---|---|
43
+ | Case ID | Facet | Input | Expected outcome | HTTP & UI | Automation case |
44
+ | --- | --- | --- | --- | --- | --- |
45
45
  | **TC-VAL-01** | `positive_boundary` (Biên tối thiểu) | `code: "REC01"` (5 chars), `name: "Hồ sơ A"` | Form hợp lệ, gửi dữ liệu thành công | `HTTP 200` · Toast Success xanh | `TC-EXAMPLE-VALID` |
46
46
  | **TC-VAL-02** | `positive_boundary` (Biên tối đa) | `code: "REC-2026-MAXIMUM-001"` (20 chars) | Form hợp lệ, gửi dữ liệu thành công | `HTTP 200` · Toast Success xanh | `TC-EXAMPLE-VALID` |
47
47
  | **TC-VAL-03** | `negative_length` (Dưới độ dài min) | `code: "REC"` (3 chars) | Chặn submit, báo lỗi inline dưới ô nhập | `Client Error` · "Độ dài từ 5 đến 20 ký tự" | `TC-EXAMPLE-INVALID` |
@@ -50,10 +50,10 @@ Màn hình khởi tạo hồ sơ là cửa ngõ dữ liệu tài chính của kh
50
50
  | **TC-ACT-06** | `concurrency_double_submit` | Click nút "Lưu" liên tục 2 lần trong 100ms | Nút khóa disabled tức thì, chỉ 1 request gửi đi | `UI Locked` · Không tạo 2 bản ghi trùng | `TC-EXAMPLE-CONCURRENCY` |
51
51
  | **TC-SYS-07** | `network_interruption` (Mất mạng) | Ngắt kết nối mạng ngay khi gửi request | Hiện banner cảnh báo mất kết nối, giữ nguyên dữ liệu form | `Network Banner` · Form state preserved | `TC-EXAMPLE-OFFLINE` |
52
52
 
53
- ## 4. Bao Phủ Rủi Ro & Khía Cạnh Chất Lượng (Quality Dimensions Coverage)
53
+ ## 4. Quality dimensions coverage
54
54
 
55
- | Khía Cạnh (Dimension) | Mức Độ Bao Phủ | Ghi Chú Đảm Bảo Chất Lượng |
56
- |---|---|---|
55
+ | Dimension | Coverage | Notes |
56
+ | --- | --- | --- |
57
57
  | **Happy Path & Workflow** | 100% | Toàn bộ luồng khởi tạo đến xem chi tiết hoàn tất |
58
58
  | **Boundary Value Analysis** | 100% | Kiểm thử đầy đủ tại ngưỡng min-1, min, max, max+1 |
59
59
  | **Data Integrity & Concurrency** | 100% | Kiểm tra unique mã hồ sơ qua async DB & chặn double-click |
@@ -75,10 +75,10 @@ stateDiagram-v2
75
75
  ChuyenTrangChiTiet --> [*]
76
76
  ```
77
77
 
78
- ## 5. Danh Sách Test Cases Chi Tiết (Test Cases Mapping)
78
+ ## 5. Test case mapping
79
79
 
80
- | Mã Case (ID) | Khía Cạnh | Mức Độ Ưu Tiên | Thư Mục Test Hub |
81
- |---|---|---|---|
80
+ | Case ID | Facets | Priority | Tests hub path |
81
+ | --- | --- | --- | --- |
82
82
  | `TC-EXAMPLE-VALID` | happy, boundary | Critical | `cases/admin/CMP-01-auth/01/create/` |
83
83
  | `TC-EXAMPLE-INVALID` | validation, boundary | High | `cases/admin/CMP-01-auth/01/create/` |
84
84
  | `TC-EXAMPLE-DUPLICATE` | concurrency, remote_unique | High | `cases/admin/CMP-01-auth/01/create/` |
@@ -127,7 +127,7 @@ PII / Sensitive / Masked
127
127
  K. Business architecture — process hierarchy & synonyms
128
128
  ================================================================================
129
129
  Business Capability
130
- Business Process
130
+ User flow
131
131
  End-to-End Flow / E2E Flow
132
132
  Use Case
133
133
  Scenario
@@ -138,7 +138,7 @@ Cross-Service Flow / Service Orchestration / Service Choreography
138
138
  Saga Flow / Distributed Transaction
139
139
  Domain Workflow / Event Flow / Command Flow
140
140
  #process: business-capability
141
- #process: business-process
141
+ #process: user-flow
142
142
  #process: e2e-flow
143
143
  #process: use-case
144
144
  #process: scenario
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shanyucoder/flowgrid",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Unified Local MCP Toolkit (Graph, DNA, Docs, Test, Codegen)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,3 @@
1
+ # Deprecated path
2
+
3
+ Use [`../03-user-flows/`](../03-user-flows/) for new hubs. Files here are legacy copies only.
@@ -12,7 +12,7 @@ status: "approved"
12
12
 
13
13
  ---
14
14
 
15
- ## 1. Bối cảnh & Ma trận Phân quyền Nghiệp vụ
15
+ ## 1. Context & role matrix
16
16
 
17
17
  * **Bối cảnh kích hoạt:** Quản trị viên truy cập vào cổng quản trị để quản lý hệ thống. Phiên đăng nhập hiện tại chưa có hoặc đã hết hạn.
18
18
  * **Ma trận Vai trò & Quyền hạn:**
@@ -22,7 +22,7 @@ status: "approved"
22
22
 
23
23
  ---
24
24
 
25
- ## 2. Chuỗi User Stories Đa Tầng
25
+ ## 2. User stories (multi-tier)
26
26
 
27
27
  ### Story 1: Xác thực & Truy cập Hệ thống (Primary Action Story)
28
28
  > **Là một** Quản trị viên hệ thống,
@@ -38,7 +38,7 @@ status: "approved"
38
38
 
39
39
  ---
40
40
 
41
- ## 3. Quy tắc Nghiệp vụ (Business Rules) & Vòng đời Trạng thái
41
+ ## 3. Business rules & state lifecycle
42
42
 
43
43
  ### Danh mục Quy tắc Nghiệp vụ
44
44
  * **BR-01 (Giới hạn thử lại):** Cho phép nhập sai tối đa 5 lần liên tiếp. Nếu vượt quá, khóa tài khoản tạm thời trong 15 phút.
@@ -53,7 +53,7 @@ status: "approved"
53
53
 
54
54
  ---
55
55
 
56
- ## 4. Đặc tả Chi tiết Hành trình Từng Chặng
56
+ ## 4. Step-by-step journey
57
57
 
58
58
  ### Chặng 1: Nhập thông tin trên `[W-AD-AUTH-01]`
59
59
  1. **Thao tác:** Quản trị viên mở trang đăng nhập, điền `username` và `password`.
@@ -64,7 +64,7 @@ status: "approved"
64
64
 
65
65
  ---
66
66
 
67
- ## 5. Ma trận Đối chiếu (Traceability Matrix)
67
+ ## 5. Traceability matrix
68
68
 
69
69
  | Bước trong User Story | Màn hình liên quan | Hành động trên Sequence Diagram | Thành phần kỹ thuật đảm nhiệm |
70
70
  | :--- | :--- | :--- | :--- |
@@ -74,7 +74,7 @@ status: "approved"
74
74
 
75
75
  ---
76
76
 
77
- ## 6. Sơ đồ Tuần tự Nghiệp vụ Liên Màn hình (Screen-to-Screen Sequence Diagram)
77
+ ## 6. Screen-to-screen sequence diagram
78
78
 
79
79
  ```mermaid
80
80
  sequenceDiagram
@@ -11,11 +11,10 @@ status: "draft"
11
11
 
12
12
  ---
13
13
 
14
- ## 1. Bối cảnh & Ma trận Phân quyền Nghiệp vụ (Context & Role Matrix)
14
+ ## 1. Context & role matrix
15
15
 
16
16
  * **Bối cảnh kích hoạt (Trigger Context):** [Mô tả hoàn cảnh hoặc sự kiện nào khiến quy trình này diễn ra. Ví dụ: Khách hàng yêu cầu đặt hàng, hoặc quản trị viên khởi tạo chiến dịch khuyến mãi...]
17
17
  * **Mục tiêu kinh doanh (Business Goal):** [Giá trị kinh doanh hoặc bài toán mà quy trình này giải quyết...]
18
- * **Chỉ số thành công (Success metrics):** [Đo được nếu có — VD: thời gian xử lý, tỷ lệ lỗi, SLA phản hồi]
19
18
  * **Phạm vi không làm (Non-goals):** [Quy trình/phase này cố ý không bao gồm — tránh trùng FLOW khác]
20
19
  * **Ma trận Vai trò & Quyền hạn (Role & Permission Matrix):**
21
20
  | Tác nhân (Actor) | Vai trò trong Quy trình | Quyền hạn trên Màn hình |
@@ -28,7 +27,7 @@ status: "draft"
28
27
 
29
28
  ---
30
29
 
31
- ## 2. Chuỗi User Stories Đa Tầng (Multi-tiered User Stories)
30
+ ## 2. User stories (multi-tier)
32
31
 
33
32
  ### Story 1: Thao tác Chuẩn bị / Cấu hình (Setup Story - Tùy chọn)
34
33
  > **Là một** [Vai trò chuẩn bị, vd: Quản trị viên],
@@ -52,7 +51,7 @@ status: "draft"
52
51
 
53
52
  ---
54
53
 
55
- ## 3. Quy tắc Nghiệp vụ (Business Rules) & Vòng đời Trạng thái
54
+ ## 3. Business rules & state lifecycle
56
55
 
57
56
  ### Danh mục Quy tắc Nghiệp vụ (Business Rules)
58
57
  * **BR-01 (Quy tắc thẩm định dữ liệu):** [Mô tả điều kiện hợp lệ để cho phép đi tiếp sang bước kế tiếp...]
@@ -70,7 +69,7 @@ status: "draft"
70
69
 
71
70
  ---
72
71
 
73
- ## 4. Đặc tả Chi tiết Hành trình Từng Chặng (Step-by-step Journey)
72
+ ## 4. Step-by-step journey
74
73
 
75
74
  ### Chặng 1: Thao tác & Nhập liệu trên Màn hình `[W-ACTION-01]`
76
75
  1. **Thao tác người dùng:** Người dùng truy cập form, điền các thông tin bắt buộc.
@@ -96,7 +95,7 @@ status: "draft"
96
95
 
97
96
  ---
98
97
 
99
- ## 5. Ma trận Đối chiếu (Traceability Matrix)
98
+ ## 5. Traceability matrix
100
99
 
101
100
  | Bước trong User Story | Màn hình liên quan | Hành động trên Sequence Diagram | Thành phần kỹ thuật đảm nhiệm |
102
101
  | :--- | :--- | :--- | :--- |
@@ -107,7 +106,7 @@ status: "draft"
107
106
 
108
107
  ---
109
108
 
110
- ## 6. Sơ đồ Tuần tự Nghiệp vụ Liên Màn hình (Screen-to-Screen Business Sequence Diagram)
109
+ ## 6. Screen-to-screen sequence diagram
111
110
 
112
111
  ```mermaid
113
112
  sequenceDiagram
@@ -2,24 +2,14 @@
2
2
 
3
3
  status: active
4
4
 
5
- Risks and mitigations for the docs hub migration and for relying on curated architecture docs.
5
+ Risks live **only** in the central register — not on feature bundles.
6
6
 
7
- ## Docs hub
7
+ ## Register (member-facing)
8
8
 
9
- | Risk | Mitigation |
10
- |------|------------|
11
- | Stale paths after arc42 migrate | Redirect stubs on old flat paths; skills + start-now / SYSTEM-DOC-STRUCTURE |
12
- | Orphan / wrong IDs in MD | FlowGrid bộ docs MCP orphans + validate_links; add FLOW-* only with lead IDs |
13
- | “Full sequence every story” pressure | Principle: curated ~10–20%; skill `/journey` refusal |
14
- | Mermaid render confusion | Reader = VitePress only; no Mermaid MCP; Structurizr only if C4 hierarchy pain |
15
- | Invented deployment topology | §07 stub-first; `/deployment` refuses fiction |
9
+ **[risk-register.md](./risk-register.md)** — bảng `RISK-*`, hạn mức vs nhu cầu peak.
16
10
 
17
- ## Product / domain (stub)
11
+ ```bash
12
+ flowgrid audit risks architecture/11-risks/risk-register.md
13
+ ```
18
14
 
19
- New MES / IoT / ERP journeys only when lead assigns real `CTR-*`/`API-*` ownership — do not invent draft FLOW SSOT.
20
-
21
- ## See also
22
-
23
- - [10 Quality](/architecture/10-quality/)
24
- - [Start now](/platform/guide/start-now)
25
- - [Doc structure](/platform/guide/SYSTEM-DOC-STRUCTURE)
15
+ Skill: `/risk-register`
@@ -0,0 +1,34 @@
1
+ ---
2
+ status: draft
3
+ owner: product-team
4
+ contentLocale: vi
5
+ ---
6
+
7
+ # Risk register
8
+
9
+ **SSOT** for project risks — members edit this file only. **Do not** use `risks:` on `*.bundle.yaml`.
10
+
11
+ Add a row when **limit** (quota, SLA, license) differs from **need** (peak, campaign).
12
+
13
+ ## Summary
14
+
15
+ | Metric | Value |
16
+ | --- | --- |
17
+ | Open risks | 0 |
18
+ | Quota / capacity gaps | 0 |
19
+ | With mitigation | 0 |
20
+
21
+ ## Risk table
22
+
23
+ | ID | Type | Description | Limit | Need | Gap | Impact | Mitigation | Status |
24
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
25
+ | RISK-QUOTA-EMAIL-001 | Quota / infra | System notification email | 500 emails/day (SMTP) | ~700 emails/day (month start, reminders) | +200 (~40%) | Users miss timely email | (1) Spread queue (2) Upgrade plan (3) SMS for critical | Open |
26
+
27
+ ### Suggested types
28
+
29
+ Quota / infra · Vendor · Data / compliance · Operations capacity · Product / scope
30
+
31
+ ## Links
32
+
33
+ - Open questions: `qa/index.md`
34
+ - Skill: `/risk-register` · `flowgrid audit risks architecture/11-risks/risk-register.md`
@@ -21,7 +21,8 @@ status: active
21
21
 
22
22
  | Term | Meaning |
23
23
  |------|---------|
24
- | Journey | Curated product runtime flow `FLOW-*` under §06 |
24
+ | Journey / Luồng người dùng | `FLOW-*` under `architecture/03-user-flows` or `common/user-flows` |
25
+ | `/user-flow` | Docs skill to author product `FLOW-*` |
25
26
  | business-process-trace | Brownfield process-through-code skill — **not** product journey `FLOW-*` |
26
27
  | flow-trace | Deprecated alias of business-process-trace |
27
28
  | `_legacy.dynamics*` | Extract/artifact name for old dynamics — keep filename; wording → FLOW/journey |
@@ -1,68 +1,46 @@
1
1
  ---
2
2
  status: draft
3
3
  owner: product-team
4
+ contentLocale: vi
4
5
  ---
5
6
 
6
- # Product overview (arc42 §1 — Introduction & Goals)
7
+ # Product overview
7
8
 
8
- Tài liệu **sản phẩm** cho toàn docs hub: *vì sao* hệ thống tồn tại, *ai* dùng, *phạm vi* operational area. Chi tiết màn/API → `surfaces/`; kiến trúc kỹ thuật → `architecture/`.
9
+ Product-level docs for this hub. Screen detail → `surfaces/` · technical architecture → `architecture/`.
9
10
 
10
- ## Mục tiêu (Goals)
11
+ > Section titles are **English** (global keys). Prose uses `contentLocale` in frontmatter / `docs-hub.locale.yaml`.
11
12
 
12
- 1. **Giá trị nghiệp vụ** — [Một đoạn: bài toán chính product giải quyết.]
13
- 2. **Đối tượng phục vụ** — [Vai trò / operational area chính.]
14
- 3. **Nguyên tắc sản phẩm** — [VD: một SSOT docs, trace `W-*` / `API-*`, grill trước codegen.]
13
+ ## Goals {#goals}
15
14
 
16
- ## Stakeholders
15
+ 1. **Business value** — [Main problem this product solves.]
16
+ 2. **Primary audience** — [Roles / channels — one line.]
17
+ 3. **Product principles** — [e.g. single SSOT, trace `W-*` / `API-*`.]
17
18
 
18
- | Vai trò | Mục đích đọc overview |
19
- | --- | --- |
20
- | PO / BA | Phạm vi, persona, operational area |
21
- | Dev / QA | Boundary module, link `CMP-*` |
22
- | Leadership | Goals + success metrics cấp product |
23
-
24
- ## Top quality goals (arc42)
25
-
26
- | # | Thuộc tính | Mục tiêu (đo được nếu có) |
27
- | --- | --- | --- |
28
- | 1 | Khả dụng | [VD: uptime SLA nội bộ] |
29
- | 2 | Bảo mật | [VD: RBAC trên admin portal] |
30
- | 3 | Khả năng mở rộng | [VD: multi-tenant / module mới không phá SSOT] |
31
- | 4 | Khả năng bảo trì | [VD: spec bundle + split + audit] |
32
- | 5 | Trải nghiệm | [VD: affordance UX portal chuẩn] |
33
-
34
- ## Personas (tóm tắt)
35
-
36
- - **[Persona A]** — [Một câu: nhu cầu chính trên surface nào.]
37
- - **[Persona B]** — […]
38
-
39
- Leaf `userStories.primary.asA` **tham chiếu** persona ở đây (không copy persona dài trên từng màn).
40
-
41
- ## Phạm vi & không làm (product-level)
19
+ ## Background {#background}
42
20
 
43
- **In scope (overview):**
21
+ [Short paragraph: current situation, why this product/phase exists. No infra deep-dive.]
44
22
 
45
- - [Operational area / surface được document trong hub này]
23
+ ## Scope {#scope}
46
24
 
47
- **Non-goals (product-level):**
25
+ **In scope:**
48
26
 
49
- - [VD: không mô tả hạ tầng chi tiết — xem `architecture/`]
50
- - [VD: không thay quy trình UAT Excel deliverable — xem tests-docs]
27
+ - [Operational areas / surfaces documented in this hub]
51
28
 
52
- ## Success metrics (product-level)
29
+ **Out of scope:**
53
30
 
54
- - [Chỉ số đo được cấp product — VD: thời gian onboard member đọc SSOT, % leaf có audit sạch trước test lane]
31
+ - [e.g. deployment detail → `architecture/07-deployment/`]
32
+ - [personas / KPIs managed outside the hub]
55
33
 
56
34
  ## Operational areas
57
35
 
58
- Mỗi area một file dưới `overview/operational-areas/` — dùng [`_template.md`](./operational-areas/_template.md).
36
+ One file per area under `overview/operational-areas/` — see [`_template.md`](./operational-areas/_template.md).
59
37
 
60
38
  | Area | File |
61
39
  | --- | --- |
62
- | [Tên area] | `operational-areas/<slug>.md` |
40
+ | [Area name] | `operational-areas/<slug>.md` |
63
41
 
64
42
  ## See also
65
43
 
66
- - Surfaces SSOT: `surfaces/`
67
- - Architecture: `architecture/01-introduction/`
68
- - Workflow Design: `platform` hoặc `docs/workflows/design.md` (khi publish site)
44
+ - Surfaces: `surfaces/`
45
+ - User flows catalog: `architecture/03-user-flows/`
46
+ - Risk register: `architecture/11-risks/risk-register.md`
@@ -1,37 +1,30 @@
1
1
  ---
2
2
  id: OA-TEMPLATE
3
- title: "Tên operational area"
3
+ title: "Operational area name"
4
4
  status: draft
5
5
  surfaces: ["admin-web"]
6
+ contentLocale: vi
6
7
  ---
7
8
 
8
- # Operational area: [Tên]
9
+ # Operational area: [Name]
9
10
 
10
- **Mục đích:** [Một đoạn — bối cảnh vận hành: ai làm việc gì, trên kênh nào.]
11
+ > Section titles are **English**. Prose uses `contentLocale` / `docs-hub.locale.yaml`.
11
12
 
12
- ## Personas trong area
13
+ **Purpose:** [One paragraph — who does what, on which channel.]
13
14
 
14
- | Persona | Mô tả ngắn | Surface chính |
15
- | --- | --- | --- |
16
- | [VD: Nhân viên vận hành] | [Nhu cầu] | `admin-web` |
15
+ ## Scope {#scope}
17
16
 
18
- ## Phạm vi nghiệp vụ
17
+ - **In scope:** [Processes / modules in this area]
18
+ - **Out of scope:** [Other area or later phase]
19
19
 
20
- - **In scope:** [Quy trình / module thuộc area]
21
- - **Out of scope:** [Chuyển sang area khác hoặc phase sau]
20
+ ## Module links
22
21
 
23
- ## Success metrics (area)
24
-
25
- - [Metric 1 — đo được]
26
- - [Metric 2]
27
-
28
- ## Liên kết module
29
-
30
- | CMP | Mô tả |
22
+ | CMP | Summary |
31
23
  | --- | --- |
32
- | `CMP-XX-…` | [Boundary một dòng] |
24
+ | `CMP-XX-…` | [One-line boundary] |
33
25
 
34
- ## Non-goals
26
+ ## Related user flows
35
27
 
36
- - [Không document chi tiết deployment — `architecture/07-deployment/`]
37
- - [Không duplicate FLOW kỹ thuật — `architecture/03-business-process/`]
28
+ | FLOW | Summary |
29
+ | --- | --- |
30
+ | `FLOW-…` | [Link under `architecture/03-user-flows/` or `common/user-flows/`] |
@@ -1,11 +1,7 @@
1
- # QA inbox (docs hub)
1
+ # QA inbox
2
2
 
3
- Open customer / choice / tech-debt questions live here — **not** in `*.bundle.yaml`.
3
+ One file per case: `qa/<SHORT>_0001.yaml`.
4
4
 
5
- - One file per open issue: `qa/open/QA-<bundle.id>-NNNN.yaml`
6
- - `bundle.id` is the screen leaf id from `/spec` (e.g. `cmp-adm-002-02-01-02`)
7
- - Sequence is **per screen** (`0001`, `0002`, …). Different screens never share a counter.
8
- - Close with **`/qa-resolve QA-<bundle.id>-NNNN`** plus the decision (skill deletes the file).
5
+ After `flowgrid init`, copy from `.flowgrid/templates/qa-item.yaml` and follow `.flowgrid/templates/qa-authoring.md`.
9
6
 
10
- Template: `.flowgrid/templates/qa-item.yaml`
11
- Rules: `.cursor/extracts/qa-inbox.md`
7
+ Append-only `updates[]` · `flowgrid render` refreshes `index.md`.
@@ -0,0 +1,40 @@
1
+ ---
2
+ id: CMP-NN-slug
3
+ title: "Module name"
4
+ status: draft
5
+ contentLocale: vi
6
+ ---
7
+
8
+ # CMP-{NN} — [Name]
9
+
10
+ > Section titles are **English**. Prose uses `contentLocale` / `docs-hub.locale.yaml`.
11
+
12
+ ## Goals {#goals}
13
+
14
+ [Module value — one paragraph.]
15
+
16
+ ## Scope {#scope}
17
+
18
+ - **In scope:** [Capabilities owned by this CMP on this surface.]
19
+ - **Out of scope:** [Other CMP / phase / channel.]
20
+
21
+ ## Features overview {#features-overview}
22
+
23
+ | Function | Screen / API | Notes |
24
+ | --- | --- | --- |
25
+ | `<slug>` | `W-…` / `API-…` | Leaf: `ir/generated/spec.md` |
26
+
27
+ ## Depends on {#depends-on}
28
+
29
+ | ID / artifact | Reason |
30
+ | --- | --- |
31
+ | `CMP-…` / `FLOW-…` | [Upstream dependency] |
32
+
33
+ ## Module metadata
34
+
35
+ | Field | Value |
36
+ | --- | --- |
37
+ | **ID** | `CMP-{NN}` |
38
+ | **User flows** | `…/common/user-flows/FLOW-…` · [`architecture/03-user-flows/`](../../architecture/03-user-flows/) |
39
+ | **Functions** | `<function-slug>`, … |
40
+ | **Screens** | `W-…` |
@@ -0,0 +1,43 @@
1
+ ---
2
+ id: SURFACE-TEMPLATE
3
+ title: "Surface channel name"
4
+ status: draft
5
+ contentLocale: vi
6
+ ---
7
+
8
+ # Surface: [Channel name]
9
+
10
+ > Section titles are **English**. Prose uses `contentLocale` / `docs-hub.locale.yaml`.
11
+
12
+ ## Goals {#goals}
13
+
14
+ [Value of this channel — one paragraph.]
15
+
16
+ ## Background {#background}
17
+
18
+ [Who uses this channel and in what context.]
19
+
20
+ ## Scope {#scope}
21
+
22
+ **In scope:**
23
+
24
+ - [CMP modules on this surface]
25
+
26
+ **Out of scope:**
27
+
28
+ - [Other surface or integration-only scope]
29
+
30
+ ## Modules (CMP)
31
+
32
+ | CMP | Summary | Primary flow |
33
+ | --- | --- | --- |
34
+ | `CMP-…` | […] | `FLOW-…` (if any) |
35
+
36
+ ## User flows on this surface
37
+
38
+ - Catalog: [`architecture/03-user-flows/`](/architecture/03-user-flows/)
39
+ - Shared on surface: `common/user-flows/FLOW-*.md` (when ≥2 modules share)
40
+
41
+ ## Features overview
42
+
43
+ [1–2 paragraphs: how to read the hub — detail per screen in bundles and `ir/generated/spec.md`.]