@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
@@ -0,0 +1,78 @@
1
+ # flowgrid-qa-item/v1 — authoring rules (QA inbox)
2
+
3
+ Hub template: `.flowgrid/templates/qa-item.yaml` (sau `flowgrid init`) · Workflow: `docs/workflows/qa-team.md`
4
+
5
+ ## File naming
6
+
7
+ | Part | Rule | Example |
8
+ |------|------|---------|
9
+ | **SHORT** | Slug màn/module, ổn định, `A-Z0-9` + `-` | `HOTEL-LIST`, `ADM-AUTH` |
10
+ | **NNNN** | Tăng dần theo SHORT (0001…) | `0001`, `0002` |
11
+ | **Path** | `qa/<SHORT>_<NNNN>.yaml` | `qa/HOTEL-LIST_0001.yaml` |
12
+ | **id** | **Bắt buộc** = basename không `.yaml` | `HOTEL-LIST_0001` |
13
+
14
+ Legacy id `QA-<page-id>-NNNN` vẫn đọc được — file mới dùng `<SHORT>_NNNN`.
15
+
16
+ Gợi ý SHORT từ `W-HOTEL-LIST` → `HOTEL-LIST` (bỏ prefix `W-`). Team có thể chọn slug module cố định (vd. `ADM-AUTH` cho nhiều màn auth).
17
+
18
+ ## Top-level fields
19
+
20
+ | Key | Required | Purpose |
21
+ |-----|----------|---------|
22
+ | `schema` | yes | Luôn `flowgrid-qa-item/v1` |
23
+ | `id` | yes | Khớp tên file |
24
+ | `status` | yes | `open` \| `closed` |
25
+ | `target.path` | yes | Bundle hoặc `01-backend-spec.yaml` (repo-relative) |
26
+ | `target.at` | yes | Pointer field — gắn `#missing_info <id>` / `#tech-debt:<id>` |
27
+ | `updates` | yes | Timeline append-only (≥1 dòng) |
28
+ | `screen` | khuyến nghị | `W-*` hoặc `page-id` — catalog + split |
29
+ | `bundleId` | khi legacy | `page-id` bundle để `Q&A` trên `ir/spec.yaml` |
30
+ | `kind` | khuyến nghị | `customer` \| `choice` \| `tech-debt` \| `integration` \| `coverage` |
31
+ | `skill` | khuyến nghị | Skill mở gap: `spec`, `grill-dev`, `api-spec`, … |
32
+ | `options` | optional | Copy options AskQuestion khi mở (audit) |
33
+ | `tags` | optional | Mirror tag đã gắn trên spec |
34
+
35
+ ## `updates[]` (append-only)
36
+
37
+ **Không** sửa/xóa dòng cũ. Chỉ **thêm** cuối mảng.
38
+
39
+ | `kind` | Ai / khi |
40
+ |--------|----------|
41
+ | `question` | Mở QA (Log Tech Debt) — **dòng đầu** |
42
+ | `answer` | `/qa-resolve` — sau khi patch `target.at` |
43
+ | `review` | `/qa-review` — `approved:` hoặc `needs-change:` |
44
+ | `note` | Ghi chú, không đổi spec |
45
+
46
+ | `at` | Format **bắt buộc** | `20260930 08:00` (YYYYMMDD HH:mm) |
47
+ | `by` | Member / role | `ba-lead`, `middle-dev` |
48
+ | `text` | Nội dung | Block `\|` multiline |
49
+
50
+ ### Vòng đời status
51
+
52
+ - Mở file: `status: open`, `updates[0].kind: question`
53
+ - `/qa-resolve`: append `answer`, `status: closed`, gỡ tag trên spec
54
+ - `/qa-review` + `needs-change`: append `review`, **`status: open`** lại (cùng file)
55
+
56
+ ## Agent workflow (mở QA)
57
+
58
+ 1. Đọc **whole** `.flowgrid/templates/qa-item.yaml` + file này.
59
+ 2. Chọn SHORT (team convention hoặc từ `screen`).
60
+ 3. `nextQaId(hub, SHORT)` hoặc glob `qa/<SHORT>_*.yaml` → max NNNN + 1.
61
+ 4. Copy template → `qa/<SHORT>_<NNNN>.yaml`; set `id`, `target`, `at` now, `updates[0]`.
62
+ 5. Patch spec: `#missing_info <id>` trên field `target.at`.
63
+ 6. `flowgrid split` + `flowgrid render`.
64
+
65
+ ## Agent output
66
+
67
+ - **YAML only** khi tạo/sửa QA file — không markdown giải thích trong repo.
68
+ - Quote string có `:`; multiline dùng `|`.
69
+
70
+ ## Không dùng QA file cho
71
+
72
+ - ADR → `architecture/09-decisions`
73
+ - Risk dài hạn → `architecture/11-risks`
74
+ - `openQuestions` trên bundle — **cấm**
75
+
76
+ ## Schema
77
+
78
+ Validate (optional CI): `templates/schemas/qa-item.schema.json` · `flowgrid` test `validateQaItem`.
@@ -1,15 +1,36 @@
1
- # Copy to qa/open/QA-<bundle.id>-NNNN.yaml — do not leave this file in qa/open/.
2
- id: QA-cmp-adm-002-02-01-02-0001
3
- kind: customer # customer | choice | tech-debt
4
- skill: spec # spec | grill-bqa | grill-dev | grill-docs | api-spec | api-update
1
+ # flowgrid-qa-item/v1 — Authoring: qa-authoring.md · Hub: docs/workflows/qa-team.md
2
+ # Copy to qa/<SHORT>_NNNN.yaml (id = basename without .yaml). Append-only updates[].
3
+
4
+ schema: flowgrid-qa-item/v1
5
+ id: HOTEL-LIST_0001
6
+ screen: W-HOTEL-LIST
7
+ bundleId: cmp-adm-000-01-01
8
+ status: open
9
+ kind: tech-debt
10
+ skill: spec
11
+ tags:
12
+ - "#missing_info HOTEL-LIST_0001"
5
13
  target:
6
- path: surfaces/<surface>/CMP-*/<NN…>/<slug>.bundle.yaml
7
- at: design.zones.main.items.title.purpose
8
- question: |
9
- What is still unknown?
10
- options: []
11
- # - id: a
12
- # text: Option A
13
- # recommended: true
14
- # - id: other
15
- # text: Member supplies copy
14
+ path: surfaces/<surface>/CMP-*/<slug>.bundle.yaml
15
+ at: design.sections.main.items.filter_timezone.purpose
16
+ options:
17
+ - label: "(Recommended) Theo timezone property"
18
+ recommended: true
19
+ - label: Theo locale user
20
+ updates:
21
+ - at: "20260930 08:00"
22
+ by: <member-id>
23
+ kind: question
24
+ text: |
25
+ Filter timezone lấy theo property hay user locale?
26
+ # Append only — never delete or rewrite prior lines:
27
+ # - at: "20260930 10:00"
28
+ # by: ba-lead
29
+ # kind: answer
30
+ # text: |
31
+ # Theo property TZ; label UTC+7 trên UI.
32
+ # - at: "20261001 08:00"
33
+ # by: senior
34
+ # kind: review
35
+ # text: |
36
+ # needs-change: thêm AC khi property chưa set TZ.
@@ -6,7 +6,7 @@
6
6
 
7
7
  ---
8
8
 
9
- ## Đọc trước khi viết (global)
9
+ ## Read before writing (global)
10
10
 
11
11
  | Ai | Đọc gì trên VitePress / docs hub | Khi nào mở YAML `01` |
12
12
  |----|-----------------------------------|----------------------|
@@ -19,7 +19,7 @@ Sau `flowgrid split` + `flowgrid render`: sidebar leaf **Spec · W-*** · **Data
19
19
 
20
20
  ---
21
21
 
22
- ## Bộ trio trên function leaf
22
+ ## Function leaf trio
23
23
 
24
24
  ```text
25
25
  surfaces/<surface>/CMP-*/<NN…>/<slug>/
@@ -42,7 +42,7 @@ surfaces/<surface>/CMP-*/<NN…>/<slug>/
42
42
 
43
43
  ---
44
44
 
45
- ## Cấu trúc `01` (tóm tắt field)
45
+ ## `01` structure (field summary)
46
46
 
47
47
  Mẫu đầy đủ: [`backend-api.yaml`](./backend-api.yaml) (sau `flowgrid init` → `.flowgrid/templates/backend-api.yaml`).
48
48
 
@@ -108,15 +108,15 @@ Skill: `/openapi` · Redoc/Swagger UI: `openapi_build_ui` (tùy hub).
108
108
 
109
109
  ---
110
110
 
111
- ## YAML an toàn
111
+ ## Safe YAML
112
112
 
113
113
  - Chuỗi có `:` → bọc `"..."`.
114
114
  - Chạy `flowgrid api:check` trước handoff.
115
- - Thiếu fact → AskQuestion hoặc `qa/open/` — **không** `openQuestions` trong YAML.
115
+ - Thiếu fact → AskQuestion hoặc `qa/` — **không** `openQuestions` trong YAML.
116
116
 
117
117
  ---
118
118
 
119
- ## Liên kết bundle FE
119
+ ## FE bundle link
120
120
 
121
121
  Trên bundle chỉ khai báo **hành vi UI** và `apiRefs`; chi tiết endpoint nằm trên `01`:
122
122
 
@@ -1,16 +1,17 @@
1
- memberLocale: vi
1
+ # Overwritten on scaffold — English headings; prose in TC YAML uses contentLocale.
2
+ structureLocale: en
3
+ contentLocale: vi
2
4
  headings:
3
- vi:
4
- home: Trang chủ
5
- cases: Testcase
6
- scenarios: Scenario
7
- plans: Kế hoạch kiểm thử
8
- preconditions: Điều kiện tiên quyết
9
- steps: Các bước thực hiện
10
- expected: Kết quả mong đợi
11
- traceability: Liên kết docs (traceability)
12
- testMatrix: Ma trận kiểm thử
13
- crossRefDocs: Đối chiếu docs hub
14
- technical: Chi tiết kỹ thuật
15
- testData: Dữ liệu kiểm thử
16
- coverage: Phạm vi coverage
5
+ home: Home
6
+ cases: Test cases
7
+ scenarios: Scenarios
8
+ plans: Test plans
9
+ preconditions: Preconditions
10
+ steps: Steps
11
+ expected: Expected results
12
+ traceability: Traceability (docs SSOT)
13
+ testMatrix: Test matrix (equivalence)
14
+ crossRefDocs: Docs hub cross-reference
15
+ technical: Technical details
16
+ testData: Test data
17
+ coverage: Coverage
@@ -1,9 +1,9 @@
1
- # Testcase plan — hướng dẫn hub
1
+ # Testcase plan — hub guide
2
2
 
3
- Bản đầy đủ (toolkit): sau `flowgrid init` copy từ package `harness/tests/templates/tpl-testcase-plan.md` hoặc xem repo FlowGrid `templates/tests-skeleton/tpl-testcase-plan.md` (sync với harness).
3
+ Full toolkit copy: `harness/tests/templates/tpl-testcase-plan.md` (synced with this skeleton).
4
4
 
5
- - SSOT ghi: `cases/**/TC-*.yaml`
6
- - SSOT đọc team: `cases:render` → `TC-*.md` trên VitePress (`flowgrid dev` port 5174)
7
- - Đối chiếu nghiệp vụ: docs hub `FLOWGRID_DOCS_ROOT` — bundle + `ir/generated/spec.md`
5
+ - **SSOT write:** `cases/**/TC-*.yaml` — field names **English**; narrative in `contentLocale` (`catalog/locale.yaml`).
6
+ - **SSOT read:** `cases:render` → `TC-*.md` on VitePress (`flowgrid dev`, port 5174).
7
+ - **Business alignment:** docs hub — bundle + `ir/generated/spec.md`. Product copy values live in bundle `i18n:`, not in TC prose.
8
8
 
9
- Mẫu vàng: `TC.example.yaml` (init / harness templates).
9
+ Golden example: `TC.example.yaml` (init / harness templates).