@shanyucoder/flowgrid 0.1.9 → 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 (69) 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/render-bundle-markdown.mjs +8 -1
  17. package/engines/docs/vitepress/config.ts +4 -4
  18. package/engines/spec/lib/audit-bundle-gaps.mjs +38 -7
  19. package/engines/spec/lib/audit-flow-gaps.mjs +2 -2
  20. package/engines/spec/lib/bundle-schema.mjs +3 -1
  21. package/engines/testcase/runners/lib/resolve-hub-id.mjs +3 -3
  22. package/harness/common/skills/legacy/SKILL.md +2 -2
  23. package/harness/docs/extracts/common-scope.md +8 -8
  24. package/harness/docs/extracts/spec-core.md +1 -1
  25. package/harness/docs/extracts/spec-prd-lite.md +11 -13
  26. package/harness/docs/extracts/tpl-module.md +9 -40
  27. package/harness/docs/extracts/tpl-overview-prd.md +11 -0
  28. package/harness/docs/extracts/tpl-risk-register.md +28 -0
  29. package/harness/docs/extracts/tpl-surface-prd.md +7 -0
  30. package/harness/docs/rules/docs-hub.mdc +1 -1
  31. package/harness/docs/rules/flowgrid-process.mdc +1 -1
  32. package/harness/docs/skills/adopt/SKILL.md +1 -1
  33. package/harness/docs/skills/background-logic/SKILL.md +1 -1
  34. package/harness/docs/skills/common-spec/SKILL.md +1 -1
  35. package/harness/docs/skills/cross-service/SKILL.md +1 -1
  36. package/harness/docs/skills/db-erd/SKILL.md +1 -1
  37. package/harness/docs/skills/grill/SKILL.md +2 -0
  38. package/harness/docs/skills/grill-hub-prd/SKILL.md +38 -0
  39. package/harness/docs/skills/module/SKILL.md +8 -5
  40. package/harness/docs/skills/overview/SKILL.md +7 -6
  41. package/harness/docs/skills/risk-register/SKILL.md +29 -0
  42. package/harness/docs/skills/spec/SKILL.md +3 -3
  43. package/harness/docs/skills/surfaces/SKILL.md +3 -1
  44. package/harness/docs/skills/{business-process → user-flow}/SKILL.md +8 -8
  45. package/harness/fe/skills/gen-common/SKILL.md +1 -1
  46. package/harness/tests/extracts/grill-scenario-flow.md +2 -2
  47. package/harness/tests/skills/grill-testcase/SKILL.md +1 -1
  48. package/harness/tests/skills/scenario/SKILL.md +11 -11
  49. package/harness/tests/skills/testcase/SKILL.md +1 -1
  50. package/harness/tests/templates/SC.example.md +16 -16
  51. package/lexicon/registry-tags.en.txt +2 -2
  52. package/package.json +1 -1
  53. package/templates/project-skeleton/architecture/03-business-process/index.md +3 -0
  54. package/templates/project-skeleton/architecture/{03-business-process → 03-user-flows}/FLOW-login.md +6 -6
  55. package/templates/project-skeleton/architecture/{03-business-process → 03-user-flows}/FLOW-template.md +6 -7
  56. package/templates/project-skeleton/architecture/11-risks/index.md +7 -17
  57. package/templates/project-skeleton/architecture/11-risks/risk-register.md +34 -0
  58. package/templates/project-skeleton/architecture/12-glossary/index.md +2 -1
  59. package/templates/project-skeleton/overview/index.md +21 -43
  60. package/templates/project-skeleton/overview/operational-areas/_template.md +15 -22
  61. package/templates/project-skeleton/surfaces/_module-index.template.md +40 -0
  62. package/templates/project-skeleton/surfaces/_surface-index.template.md +43 -0
  63. package/templates/shared/bundle-authoring.md +5 -2
  64. package/templates/shared/default-layout.ejs +108 -62
  65. package/templates/shared/feature.bundle.yaml +15 -6
  66. package/templates/shared/ir/generated/spec.md +24 -24
  67. package/templates/shared/tpl-api-contract.md +5 -5
  68. package/templates/tests-skeleton/catalog/locale.yaml +16 -15
  69. package/templates/tests-skeleton/tpl-testcase-plan.md +6 -6
@@ -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/`] |
@@ -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`.]
@@ -8,8 +8,11 @@ Hub: `docs/templates/feature.bundle.yaml` · split: `pnpm spec:split`
8
8
  |-----|---------|
9
9
  | `page-id` | Screen identity (`cmp-adm-000-01`). Split copies this onto `ir/spec.yaml` as `page-id` (not `id`, so it does not collide with requirement/section ids). Legacy bundles may still use `id`. |
10
10
  | `summary` | Phải trình bày dạng bullet. Bắt buộc có các tiêu đề (chuẩn Arc42 business): **mục tiêu nghiệp vụ** (business_goals), **các bên liên quan** (stakeholders), **kịch bản người dùng** (user_journey), **bối cảnh** (description, input liên kết cross-page/module, output) và **cách giải quyết** (tùy chọn). Mục đích để 100% Non-tech Stakeholder hiểu và duyệt. |
11
- | `successMetrics` | **Tùy chọn** khi có thông tin — bullet (string multiline hoặc list). Chỉ số đo được / qualitative metric cấp **màn/feature**. Product-level → `overview/`. Split → `ir/spec.yaml`; render → section riêng trong `ir/generated/spec.md`. |
12
- | `nonGoals` | **Tùy chọn** — phạm vi **không làm** trên màn/phase (PRD non-goals). Tránh nhét vào `requirements` prose. |
11
+ | `scopeIn` | **Khuyến nghị** — trong phạm vi màn/phase (PRD). Audit `WARN_NO_SCOPE_IN`. |
12
+ | `nonGoals` | **Khuyến nghị** — ngoài phạm vi màn/phase (PRD). Audit `WARN_NO_NON_GOALS`. |
13
+ | `userFlows` | **Khuyến nghị** — link `FLOW-*` (`03-user-flows` / `common/user-flows`) hoặc journey ngắn. Audit `WARN_NO_USER_FLOWS` khi multi-screen. |
14
+ | `nfr` | **Khuyến nghị** — hiệu năng, bảo mật. Audit `WARN_NO_NFR`. |
15
+ | _(rủi ro)_ | **Không** khai báo trên bundle. SSOT: `architecture/11-risks/risk-register.md` — `/risk-register`. Key `risks:` → audit `WARN_BUNDLE_RISKS_FORBIDDEN`. |
13
16
  | `userStories` | **Khối User Stories chuyên sâu cho màn hình:** `primary`, `contextAndHandoff` (+ `screenAccess`), `scenarios` (5 kịch bản chuẩn + **scenario thứ 6 “Affordances UX”** khi màn có delete/filter/breadcrumb/disabled/import — xem `feature.bundle.yaml`), `acceptanceCriteria` (kèm checkbox UX khi áp dụng). **Split:** `pnpm spec:split` copy nguyên khối sang `ir/spec.yaml` (business prose); **không** tự sinh từ `design` — Agent phải cập nhật `userStories` khi bổ sung DSL/`#needs-component`/audit `UX_*`. Render → `## User Stories & Screen Journey` trong Markdown. |
14
17
  | `spec` | Design v1 — **`entities`**, **`relationships`**, actors, requirements, `ui.routes`, **`ui.list` / `ui.form` / `ui.detail`**, `acceptance`. **Không** author `spec.api` — API SSOT là `api/<seq>/01-backend-spec.yaml`. |
15
18
  | `gen` | **Bắt buộc trước flowgrid gen:** `codegen.profile` (`auth` login/forgot/reset; `change-password`; `public`; `not-found`/`error`; `list`/`create`/`admin-crud`) + entity/module, `tags`, derived `ui.*`. `/grill-dev` ghi. Endpoint `action` ghi trên **01**, không trên bundle. |