@shanyucoder/flowgrid 0.1.9 → 0.1.11

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 (104) hide show
  1. package/adapters/nextjs/codegen/runners/lib/resolve-hub-id.mjs +7 -4
  2. package/adapters/nextjs/unitgen/runners/README.md +4 -4
  3. package/adapters/nextjs/unitgen/runners/generate.mjs +1 -1
  4. package/adapters/nuxt4/codegen/runners/lib/resolve-hub-id.mjs +7 -4
  5. package/adapters/nuxt4/unitgen/runners/README.md +4 -4
  6. package/adapters/nuxt4/unitgen/runners/generate.mjs +1 -1
  7. package/adapters/shared/common-gen.mjs +1 -1
  8. package/adapters/shared/resolve-hub-id.mjs +7 -4
  9. package/bin/flowgrid.mjs +43 -9
  10. package/bin/lib/audit-run.mjs +5 -1
  11. package/bin/lib/docs-hub-locale.mjs +9 -0
  12. package/bin/lib/init-scaffold.mjs +30 -2
  13. package/dist/docs/mcp/tools.js +4 -4
  14. package/dist/docs/mcp/tools.js.map +1 -1
  15. package/dist/docs/scan/ids.d.ts +1 -1
  16. package/dist/docs/scan/ids.js +9 -8
  17. package/dist/docs/scan/ids.js.map +1 -1
  18. package/dist/docs/scan/route.js +2 -2
  19. package/dist/docs/scan/route.js.map +1 -1
  20. package/dist/graph/mcp/tools.js +1 -1
  21. package/dist/graph/mcp/tools.js.map +1 -1
  22. package/engines/cases/render-cases.mjs +34 -26
  23. package/engines/docs/lib/audit-hub-prd.mjs +136 -0
  24. package/engines/docs/lib/audit-risks-catalog.mjs +142 -0
  25. package/engines/docs/lib/docs-hub-locale.mjs +100 -0
  26. package/engines/docs/lib/render-bundle-markdown.mjs +8 -1
  27. package/engines/docs/vitepress/config.ts +4 -4
  28. package/engines/spec/lib/audit-bundle-gaps.mjs +38 -7
  29. package/engines/spec/lib/audit-flow-gaps.mjs +2 -2
  30. package/engines/spec/lib/audit-legacy-gaps.mjs +10 -0
  31. package/engines/spec/lib/bundle-schema.mjs +3 -1
  32. package/engines/testcase/_staging-from-portal/runners/README.md +3 -3
  33. package/engines/testcase/_staging-from-portal/runners/generate.mjs +2 -2
  34. package/engines/testcase/_staging-from-portal/runners/lib/read-testcase.mjs +1 -1
  35. package/engines/testcase/runners/README.md +3 -3
  36. package/engines/testcase/runners/generate.mjs +2 -2
  37. package/engines/testcase/runners/lib/read-testcase.mjs +1 -1
  38. package/engines/testcase/runners/lib/resolve-hub-id.mjs +6 -6
  39. package/harness/be/skills/audit-api/SKILL.md +1 -1
  40. package/harness/be/skills/grill-api-unit/SKILL.md +1 -1
  41. package/harness/common/skills/legacy/SKILL.md +2 -2
  42. package/harness/docs/extracts/architecture-core.md +2 -0
  43. package/harness/docs/extracts/common-scope.md +8 -8
  44. package/harness/docs/extracts/extract-registry.docs.json +7 -3
  45. package/harness/docs/extracts/product-id-convention.md +58 -0
  46. package/harness/docs/extracts/spec-core.md +1 -1
  47. package/harness/docs/extracts/spec-prd-lite.md +11 -13
  48. package/harness/docs/extracts/spec-requirement.md +1 -1
  49. package/harness/docs/extracts/tpl-adoption-inventory.md +32 -0
  50. package/harness/docs/extracts/tpl-module.md +9 -40
  51. package/harness/docs/extracts/tpl-overview-prd.md +11 -0
  52. package/harness/docs/extracts/tpl-risk-register.md +28 -0
  53. package/harness/docs/extracts/tpl-surface-prd.md +7 -0
  54. package/harness/docs/rules/agent-compliance.mdc +1 -1
  55. package/harness/docs/rules/docs-hub.mdc +1 -1
  56. package/harness/docs/rules/flowgrid-process.mdc +1 -1
  57. package/harness/docs/skills/adopt/SKILL.md +43 -11
  58. package/harness/docs/skills/api-update/SKILL.md +1 -1
  59. package/harness/docs/skills/background-logic/SKILL.md +1 -1
  60. package/harness/docs/skills/common-spec/SKILL.md +1 -1
  61. package/harness/docs/skills/cross-service/SKILL.md +1 -1
  62. package/harness/docs/skills/db-erd/SKILL.md +1 -1
  63. package/harness/docs/skills/grill/SKILL.md +2 -0
  64. package/harness/docs/skills/grill-hub-prd/SKILL.md +38 -0
  65. package/harness/docs/skills/module/SKILL.md +9 -6
  66. package/harness/docs/skills/overview/SKILL.md +7 -6
  67. package/harness/docs/skills/risk-register/SKILL.md +29 -0
  68. package/harness/docs/skills/spec/SKILL.md +5 -4
  69. package/harness/docs/skills/surfaces/SKILL.md +4 -1
  70. package/harness/docs/skills/{business-process → user-flow}/SKILL.md +8 -8
  71. package/harness/fe/skills/gen-common/SKILL.md +1 -1
  72. package/harness/fe/skills/grill-prototype/SKILL.md +1 -1
  73. package/harness/fe/skills/prototype/SKILL.md +6 -6
  74. package/harness/fe/skills/unit/SKILL.md +4 -4
  75. package/harness/shared/SSOT_AGENT_PROTOCOL.md +1 -1
  76. package/harness/tests/extracts/grill-scenario-flow.md +2 -2
  77. package/harness/tests/skills/grill-testcase/SKILL.md +2 -2
  78. package/harness/tests/skills/scenario/SKILL.md +11 -11
  79. package/harness/tests/skills/testcase/SKILL.md +2 -2
  80. package/harness/tests/templates/SC.example.md +26 -26
  81. package/harness/tests/templates/TC.example.yaml +3 -3
  82. package/lexicon/registry-tags.en.txt +2 -2
  83. package/package.json +1 -1
  84. package/templates/project-skeleton/architecture/03-business-process/index.md +3 -0
  85. package/templates/project-skeleton/architecture/{03-business-process → 03-user-flows}/FLOW-login.md +16 -16
  86. package/templates/project-skeleton/architecture/{03-business-process → 03-user-flows}/FLOW-template.md +6 -7
  87. package/templates/project-skeleton/architecture/04-solution-strategy/index.md +1 -1
  88. package/templates/project-skeleton/architecture/08-cross-cutting/security.md +1 -1
  89. package/templates/project-skeleton/architecture/11-risks/index.md +7 -17
  90. package/templates/project-skeleton/architecture/11-risks/risk-register.md +34 -0
  91. package/templates/project-skeleton/architecture/12-glossary/index.md +5 -3
  92. package/templates/project-skeleton/architecture/model/workspace.dsl +7 -7
  93. package/templates/project-skeleton/overview/index.md +21 -43
  94. package/templates/project-skeleton/overview/operational-areas/_template.md +15 -22
  95. package/templates/project-skeleton/surfaces/_module-index.template.md +40 -0
  96. package/templates/project-skeleton/surfaces/_surface-index.template.md +44 -0
  97. package/templates/shared/bundle-authoring.md +6 -3
  98. package/templates/shared/default-layout.ejs +108 -62
  99. package/templates/shared/feature.bundle.yaml +15 -6
  100. package/templates/shared/ir/generated/spec.md +24 -24
  101. package/templates/shared/tpl-api-contract.md +5 -5
  102. package/templates/tests-skeleton/cases/README.md +1 -1
  103. package/templates/tests-skeleton/catalog/locale.yaml +16 -15
  104. package/templates/tests-skeleton/tpl-testcase-plan.md +6 -6
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  id: SC-EXAMPLE
3
- module: CMP-01-auth
3
+ module: CMP-ADM-AUTH-01
4
4
  surface: admin
5
- screen: W-AD-AUTH-001
5
+ screen: W-ADM-AUTH-01
6
6
  screens:
7
- - W-AD-AUTH-001
7
+ - W-ADM-AUTH-01
8
8
  rules:
9
9
  - RUL-00-example
10
10
  coverage_plan:
@@ -17,31 +17,31 @@ coverage_plan:
17
17
 
18
18
  # SC-EXAMPLE — Xác Thực & Khởi Tạo Hồ Sơ Khách Hàng
19
19
 
20
- Scenario thuộc **CMP-01-auth** · Tính năng năng lực **CAP-AUTH-001**.
20
+ Scenario thuộc **CMP-ADM-AUTH-01** · 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
- | **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` |
26
+ | **Module** | `CMP-ADM-AUTH-01` |
27
+ | **Surface** | `admin` |
28
+ | **Screen** | `W-ADM-AUTH-01` (`/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,12 +75,12 @@ 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
- |---|---|---|---|
82
- | `TC-EXAMPLE-VALID` | happy, boundary | Critical | `cases/admin/CMP-01-auth/01/create/` |
83
- | `TC-EXAMPLE-INVALID` | validation, boundary | High | `cases/admin/CMP-01-auth/01/create/` |
84
- | `TC-EXAMPLE-DUPLICATE` | concurrency, remote_unique | High | `cases/admin/CMP-01-auth/01/create/` |
85
- | `TC-EXAMPLE-CONCURRENCY` | interaction, double_submit | High | `cases/admin/CMP-01-auth/01/create/` |
86
- | `TC-EXAMPLE-OFFLINE` | reliability, offline_resilience | Medium | `cases/admin/CMP-01-auth/01/create/` |
80
+ | Case ID | Facets | Priority | Tests hub path |
81
+ | --- | --- | --- | --- |
82
+ | `TC-EXAMPLE-VALID` | happy, boundary | Critical | `cases/admin/CMP-ADM-AUTH-01/01/create/` |
83
+ | `TC-EXAMPLE-INVALID` | validation, boundary | High | `cases/admin/CMP-ADM-AUTH-01/01/create/` |
84
+ | `TC-EXAMPLE-DUPLICATE` | concurrency, remote_unique | High | `cases/admin/CMP-ADM-AUTH-01/01/create/` |
85
+ | `TC-EXAMPLE-CONCURRENCY` | interaction, double_submit | High | `cases/admin/CMP-ADM-AUTH-01/01/create/` |
86
+ | `TC-EXAMPLE-OFFLINE` | reliability, offline_resilience | Medium | `cases/admin/CMP-ADM-AUTH-01/01/create/` |
@@ -10,11 +10,11 @@ story: |
10
10
  When thực hiện thao tác nhập liệu và nhấn lưu
11
11
  Then hệ thống tạo mới thành công và chuyển trạng thái
12
12
  refs:
13
- module: CMP-01-auth
13
+ module: CMP-ADM-AUTH-01
14
14
  surface: admin
15
15
  scenario: SC-EXAMPLE
16
16
  example: EX-EXAMPLE-01
17
- screen: W-AD-AUTH-001
17
+ screen: W-ADM-AUTH-01
18
18
  coverage: [happy, boundary, validation, concurrency, exception]
19
19
  priority: high
20
20
  automation: automated
@@ -123,7 +123,7 @@ testIds:
123
123
 
124
124
  # Fill when bundle is available (required for `flowgrid cases:gate --strict`).
125
125
  traceability:
126
- bundleScreen: W-AD-AUTH-001
126
+ bundleScreen: W-ADM-AUTH-01
127
127
  bundleScenarios: []
128
128
  acceptanceRefs: []
129
129
  actionRefs:
@@ -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.9",
3
+ "version": "0.1.11",
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,22 +12,22 @@ 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:**
19
19
  | Tác nhân (Actor) | Vai trò trong Quy trình | Quyền hạn trên Màn hình |
20
20
  | :--- | :--- | :--- |
21
- | **Quản trị viên (Admin)** | Đăng nhập tài khoản | Nhập thông tin trên `[W-AD-AUTH-01]`, truy cập `[W-AD-DASH-01]` |
21
+ | **Quản trị viên (Admin)** | Đăng nhập tài khoản | Nhập thông tin trên `[W-ADM-AUTH-01]`, truy cập `[W-ADM-DASH-01]` |
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,
29
- > **Tôi muốn** nhập tên đăng nhập và mật khẩu hợp lệ trên màn hình đăng nhập `[W-AD-AUTH-01]`,
30
- > **Để** hệ thống xác thực danh tính và cấp quyền truy cập vào trang tổng quan `[W-AD-DASH-01]`.
29
+ > **Tôi muốn** nhập tên đăng nhập và mật khẩu hợp lệ trên màn hình đăng nhập `[W-ADM-AUTH-01]`,
30
+ > **Để** hệ thống xác thực danh tính và cấp quyền truy cập vào trang tổng quan `[W-ADM-DASH-01]`.
31
31
 
32
32
  ### Story 2: Xử lý Sai Thông tin & Khóa Tài khoản (Security Fallback Story)
33
33
  > **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,37 +53,37 @@ 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
- ### Chặng 1: Nhập thông tin trên `[W-AD-AUTH-01]`
58
+ ### Chặng 1: Nhập thông tin trên `[W-ADM-AUTH-01]`
59
59
  1. **Thao tác:** Quản trị viên mở trang đăng nhập, điền `username` và `password`.
60
60
  2. **Bấm "Đăng nhập":**
61
61
  * Hệ thống kiểm tra xác thực thông tin đối soát với cơ sở dữ liệu tài khoản.
62
- * **Nếu hợp lệ:** Khởi tạo phiên làm việc an toàn, điều hướng sang `[W-AD-DASH-01] Dashboard`.
62
+ * **Nếu hợp lệ:** Khởi tạo phiên làm việc an toàn, điều hướng sang `[W-ADM-DASH-01] Dashboard`.
63
63
  * **Nếu sai thông tin:** Giữ nguyên màn hình đăng nhập, xóa trắng trường mật khẩu và hiển thị cảnh báo đỏ theo BR-03.
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
  | :--- | :--- | :--- | :--- |
71
- | **Story 1 (Đăng nhập)** | `[W-AD-AUTH-01]` | `Admin ->> W_Auth ->> Core: Xác thực` | Auth Service, User Table |
72
- | **Story 1 (Điều hướng)** | `[W-AD-DASH-01]` | `W_Auth -->> W_Dash: Mở Dashboard` | Router & Session Storage |
73
- | **Story 2 (Sai mật khẩu)** | `[W-AD-AUTH-01]` | `W_Auth -->> Admin: Báo lỗi` | Form State & Error Alert |
71
+ | **Story 1 (Đăng nhập)** | `[W-ADM-AUTH-01]` | `Admin ->> W_Auth ->> Core: Xác thực` | Auth Service, User Table |
72
+ | **Story 1 (Điều hướng)** | `[W-ADM-DASH-01]` | `W_Auth -->> W_Dash: Mở Dashboard` | Router & Session Storage |
73
+ | **Story 2 (Sai mật khẩu)** | `[W-ADM-AUTH-01]` | `W_Auth -->> Admin: Báo lỗi` | Form State & Error Alert |
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
81
81
  autonumber
82
82
  actor Admin as Quản trị viên
83
- participant W_Auth as [W-AD-AUTH-01] Màn hình Đăng nhập
83
+ participant W_Auth as [W-ADM-AUTH-01] Màn hình Đăng nhập
84
84
  participant Core as Dịch vụ Xác thực (Auth Service)
85
85
  participant Storage as Cơ sở dữ liệu Người dùng
86
- participant W_Dash as [W-AD-DASH-01] Bàn làm việc (Dashboard)
86
+ participant W_Dash as [W-ADM-DASH-01] Bàn làm việc (Dashboard)
87
87
 
88
88
  Admin->>W_Auth: 1. Mở trang đăng nhập
89
89
  Admin->>W_Auth: 2. Nhập tên tài khoản, mật khẩu & bấm "Đăng nhập"
@@ -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
@@ -12,7 +12,7 @@ High-level approach: docs hub as arc42 TOC + C4 views; product Code under `CMP-*
12
12
  |-------|----------|
13
13
  | Docs structure | [ADR-001](../09-decisions/ADR-001-arc42-toc) — arc42 TOC over flat C4 folders |
14
14
  | Admin runtime | Admin Web + Admin API ([§07](../07-deployment/)) |
15
- | Auth entry | [CMP-01](/surfaces/CMP-01-auth/) · [FLOW-login](../06-runtime/journeys/FLOW-login) |
15
+ | Auth entry | [CMP-ADM-AUTH-01](/surfaces/admin/CMP-ADM-AUTH-01/) · [FLOW-login](../03-user-flows/FLOW-login) |
16
16
 
17
17
  Further ADRs land in [§09](../09-decisions/).
18
18
 
@@ -11,7 +11,7 @@ Authenticate admin operators and protect Admin API (session/token). Details evol
11
11
 
12
12
  ## Approach
13
13
 
14
- TBD — link ADR / CMP-01 / FLOW-login when expanded.
14
+ TBD — link ADR / CMP-ADM-AUTH-01 / FLOW-login when expanded.
15
15
 
16
16
  ## Out of scope
17
17
 
@@ -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`
@@ -9,8 +9,9 @@ status: active
9
9
  | `LND-*` | Landscape |
10
10
  | `DEP-*` | Deployment node |
11
11
  | `CTR-*` | Container |
12
- | `CMP-*` | Component (product) |
13
- | `W-*` / `API-*` | Screen / API Code |
12
+ | `surfaceCode` | 2–4 letter token on `surfaces/*/index.md` — embedded in all product IDs on that channel |
13
+ | `CMP-*` | Component (product) — folder name = id, pattern `CMP-{SURF}-{DOMAIN}-{NN}` |
14
+ | `W-*` / `API-*` | Screen / API — `W-{SURF}-{DOMAIN}-{NN}` (globally unique) |
14
15
  | `FLOW-*` | Product journey (runtime) |
15
16
  | `DEP-*` | Deployment (optional) |
16
17
  | `ADR-*` | Architecture decision |
@@ -21,7 +22,8 @@ status: active
21
22
 
22
23
  | Term | Meaning |
23
24
  |------|---------|
24
- | Journey | Curated product runtime flow `FLOW-*` under §06 |
25
+ | Journey / Luồng người dùng | `FLOW-*` under `architecture/03-user-flows` or `common/user-flows` |
26
+ | `/user-flow` | Docs skill to author product `FLOW-*` |
25
27
  | business-process-trace | Brownfield process-through-code skill — **not** product journey `FLOW-*` |
26
28
  | flow-trace | Deprecated alias of business-process-trace |
27
29
  | `_legacy.dynamics*` | Extract/artifact name for old dynamics — keep filename; wording → FLOW/journey |
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Structurizr DSL — pilot skeleton (Phase B).
3
3
  * SSOT for prose/IDs remains MD under architecture/ + surfaces/ (see MODEL.md).
4
- * IDs mirror docs hub: admin, web, CMP-01.
4
+ * IDs mirror docs hub: admin, CMP-ADM-AUTH-01, W-ADM-AUTH-01.
5
5
  */
6
6
  workspace "base-docs platform" "arc42 × C4 pilot model" {
7
7
 
@@ -12,10 +12,10 @@ workspace "base-docs platform" "arc42 × C4 pilot model" {
12
12
 
13
13
  admin = softwareSystem "Admin Product" "Admin product boundary" {
14
14
  web = container "Admin Web" "Admin SPA / FE" "Nuxt/Next" {
15
- auth = component "CMP-01 Auth" "Authentication module" "Vue/React"
15
+ auth = component "CMP-ADM-AUTH-01" "Authentication module" "Vue/React"
16
16
  }
17
17
  api = container "Admin API" "Admin HTTP API" "Nest/FastAPI" {
18
- authApi = component "CMP-01 Auth API" "Auth endpoints" "Node"
18
+ authApi = component "API-ADM-AUTH-01" "Auth endpoints" "Node"
19
19
  }
20
20
  db = container "Admin DB" "Storage" "PostgreSQL" "Database"
21
21
  }
@@ -46,19 +46,19 @@ workspace "base-docs platform" "arc42 × C4 pilot model" {
46
46
  autoLayout tb
47
47
  }
48
48
 
49
- component web "CMP-01-web" {
49
+ component web "CMP-ADM-AUTH-01-web" {
50
50
  include *
51
51
  autoLayout lr
52
52
  }
53
53
 
54
- component api "CMP-01-api" {
54
+ component api "API-ADM-AUTH-01-api" {
55
55
  include *
56
56
  autoLayout lr
57
57
  }
58
58
 
59
59
  dynamic admin "FLOW-login" {
60
- op -> web "Open login W-AD-AUTH-001"
61
- web -> api "POST login API-AD-AUTH-001"
60
+ op -> web "Open login W-ADM-AUTH-01"
61
+ web -> api "POST login API-ADM-AUTH-01"
62
62
  api -> idp "Validate credentials"
63
63
  api -> web "session / token"
64
64
  web -> op "Authenticated shell"
@@ -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/`] |
@@ -0,0 +1,40 @@
1
+ ---
2
+ id: CMP-ADM-DOMAIN-01
3
+ title: "Module name"
4
+ status: draft
5
+ contentLocale: vi
6
+ ---
7
+
8
+ # CMP-ADM-DOMAIN-01 — [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-…` |