@shanyucoder/flowgrid 0.1.5 → 0.1.9

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 (169) hide show
  1. package/README.md +1 -1
  2. package/adapters/laravel/registries/codegen.registry.json +9 -9
  3. package/bin/flowgrid.mjs +326 -115
  4. package/bin/lib/agent-mcp.mjs +4 -0
  5. package/bin/lib/agent-profiles.mjs +30 -6
  6. package/bin/lib/audit-run.mjs +1 -1
  7. package/bin/lib/cli-update.mjs +48 -8
  8. package/bin/lib/doctor.mjs +90 -3
  9. package/bin/lib/harness-overlay.mjs +12 -5
  10. package/bin/lib/harness-sync.mjs +17 -3
  11. package/bin/lib/init-adapters.mjs +75 -0
  12. package/bin/lib/init-scaffold.mjs +9 -0
  13. package/bin/lib/inject-consumer-scripts.mjs +115 -0
  14. package/bin/lib/merge-stack-config.mjs +89 -0
  15. package/bin/lib/project-gitignore.mjs +1 -0
  16. package/bin/lib/repo-maps-align.mjs +203 -0
  17. package/dist/graph/config/load-config.js +7 -2
  18. package/dist/graph/config/load-config.js.map +1 -1
  19. package/dist/graph/mcp/tools.js +1 -1
  20. package/dist/graph/mcp/tools.js.map +1 -1
  21. package/dist/graph/registry/load-registries.d.ts +1 -0
  22. package/dist/graph/registry/load-registries.js +14 -1
  23. package/dist/graph/registry/load-registries.js.map +1 -1
  24. package/engines/cases/render-cases.mjs +67 -5
  25. package/engines/docs/lib/qa-item.mjs +91 -0
  26. package/engines/docs/lib/render-api-summary-markdown.mjs +28 -0
  27. package/engines/docs/lib/render-bundle-markdown.mjs +77 -2
  28. package/engines/docs/lib/render-data-model-markdown.mjs +171 -0
  29. package/engines/docs/lib/render-design-tables.mjs +89 -7
  30. package/engines/docs/lib/render-qa-list.mjs +123 -25
  31. package/engines/docs/lib/render-template.mjs +6 -0
  32. package/engines/docs/render-docs.mjs +6 -2
  33. package/engines/docs/vitepress/config.ts +7 -7
  34. package/engines/docs/vitepress/surfaces-nav.mjs +45 -14
  35. package/engines/openapi/check-backend-spec.mjs +2 -2
  36. package/engines/openapi/lib/markdown-table.mjs +8 -0
  37. package/engines/openapi/lib/render-backend-spec-markdown.mjs +78 -0
  38. package/engines/registry-sync/be-capabilities-sync.mjs +118 -0
  39. package/engines/registry-sync/fe-design-sync.mjs +258 -0
  40. package/engines/registry-sync/run-registry-sync.mjs +107 -0
  41. package/engines/shared/e2e-output-layout.mjs +68 -0
  42. package/engines/shared/flowgrid-e2e-root.mjs +19 -0
  43. package/engines/shared/resolve-flowgrid-context.mjs +176 -0
  44. package/engines/spec/lib/audit-api-gaps.mjs +1 -1
  45. package/engines/spec/lib/audit-bundle-gaps.mjs +92 -3
  46. package/engines/spec/lib/audit-db-tables.mjs +529 -0
  47. package/engines/spec/lib/audit-e2e-coverage.mjs +88 -30
  48. package/engines/spec/lib/bundle-schema.mjs +4 -1
  49. package/engines/spec/lib/open-qa.mjs +71 -21
  50. package/engines/spec/split-bundle.mjs +11 -1
  51. package/engines/testcase/runners/generate-api.mjs +23 -23
  52. package/engines/testcase/runners/generate.mjs +19 -17
  53. package/engines/testcase/runners/lib/bootstrap-context.mjs +44 -0
  54. package/engines/testcase/runners/lib/write-files.mjs +37 -9
  55. package/harness/agents/antigravity/rules/antigravity-mcp.mdc +12 -0
  56. package/harness/agents/gemini/rules/gemini-mcp.mdc +11 -0
  57. package/harness/agents/gemini_antigravity/rules/antigravity-mcp.mdc +8 -6
  58. package/harness/be/skills/{grill-api → audit-api}/SKILL.md +8 -7
  59. package/harness/common/extracts/artifact-graph.md +2 -2
  60. package/harness/common/extracts/artifactgraph-phase-hooks.md +2 -2
  61. package/harness/common/extracts/docs-mark-detect.md +2 -2
  62. package/harness/common/extracts/entity-relationship.md +23 -0
  63. package/harness/common/rules/flowgrid-ux-common.mdc +3 -3
  64. package/harness/common/skills/configure-repo-maps/SKILL.md +4 -2
  65. package/harness/docs/extracts/agent-execution-protocol.md +3 -3
  66. package/harness/docs/extracts/api-codegen-readiness.md +34 -0
  67. package/harness/docs/extracts/api-codegen-tags.md +30 -0
  68. package/harness/docs/extracts/api-contract.md +43 -0
  69. package/harness/docs/extracts/api-spec-sync.md +35 -0
  70. package/harness/docs/extracts/artifactgraph-hooks-docs.md +1 -1
  71. package/harness/docs/extracts/call-external.md +16 -0
  72. package/harness/docs/extracts/common-scope.md +9 -10
  73. package/harness/docs/extracts/db-audit-wizard.md +45 -0
  74. package/harness/docs/extracts/derived-data.md +18 -0
  75. package/harness/docs/extracts/design-leaf-signoff.md +16 -0
  76. package/harness/docs/extracts/extract-registry.docs.json +11 -2
  77. package/harness/docs/extracts/qa-inbox.md +19 -10
  78. package/harness/docs/extracts/qa-team.md +32 -0
  79. package/harness/docs/extracts/spec-core.md +7 -3
  80. package/harness/docs/extracts/spec-evolution.md +21 -0
  81. package/harness/docs/extracts/spec-prd-lite.md +19 -0
  82. package/harness/docs/extracts/spec-requirement.md +6 -2
  83. package/harness/docs/extracts/spec-ssot-prep.md +25 -0
  84. package/harness/docs/extracts/tpl-module.md +12 -0
  85. package/harness/docs/extracts/verify-gate.md +33 -0
  86. package/harness/docs/extracts/wire-spec-feedback.md +31 -0
  87. package/harness/docs/rules/agent-compliance.mdc +1 -1
  88. package/harness/docs/rules/team-flow-spec.mdc +3 -4
  89. package/harness/docs/schemas/flowgrid-docs/qa-item.schema.json +65 -0
  90. package/harness/docs/skills/adopt/SKILL.md +2 -0
  91. package/harness/docs/skills/api/SKILL.md +4 -5
  92. package/harness/docs/skills/api-spec/SKILL.md +19 -6
  93. package/harness/docs/skills/api-update/SKILL.md +4 -4
  94. package/harness/docs/skills/architecture/SKILL.md +1 -1
  95. package/harness/docs/skills/business-process/SKILL.md +2 -0
  96. package/harness/docs/skills/common/SKILL.md +2 -2
  97. package/harness/docs/skills/common-spec/SKILL.md +10 -47
  98. package/harness/docs/skills/db-erd/SKILL.md +26 -0
  99. package/harness/docs/skills/grill/SKILL.md +28 -22
  100. package/harness/docs/skills/grill-api/SKILL.md +4 -6
  101. package/harness/docs/skills/grill-api-spec/SKILL.md +44 -24
  102. package/harness/docs/skills/grill-bqa/SKILL.md +28 -13
  103. package/harness/docs/skills/grill-common-spec/SKILL.md +10 -35
  104. package/harness/docs/skills/grill-dev/SKILL.md +8 -7
  105. package/harness/docs/skills/grill-docs/SKILL.md +11 -4
  106. package/harness/docs/skills/module/SKILL.md +3 -1
  107. package/harness/docs/skills/openapi/SKILL.md +2 -1
  108. package/harness/docs/skills/overview/SKILL.md +7 -1
  109. package/harness/docs/skills/qa-resolve/SKILL.md +13 -12
  110. package/harness/docs/skills/qa-review/SKILL.md +45 -0
  111. package/harness/docs/skills/spec/SKILL.md +43 -10
  112. package/harness/docs/skills/update-spec/SKILL.md +5 -2
  113. package/harness/fe/extracts/wire-audit-loop.md +72 -0
  114. package/harness/fe/extracts/wire-phase.md +45 -0
  115. package/harness/fe/rules/platform-design-vocabulary.mdc +1 -1
  116. package/harness/fe/rules/team-flow-prototype.mdc +8 -4
  117. package/harness/fe/skills/gen-common/SKILL.md +11 -84
  118. package/harness/fe/skills/grill-prototype/SKILL.md +51 -25
  119. package/harness/fe/skills/grill-test/SKILL.md +78 -20
  120. package/harness/fe/skills/grill-wire/SKILL.md +81 -0
  121. package/harness/fe/skills/prototype/SKILL.md +3 -2
  122. package/harness/fe/skills/wire/SKILL.md +8 -3
  123. package/harness/shared/AGENTS.md +3 -3
  124. package/harness/shared/SSOT_AGENT_PROTOCOL.md +3 -3
  125. package/harness/tests/extracts/grill-api-hook.md +69 -0
  126. package/harness/tests/extracts/grill-scenario-flow.md +39 -0
  127. package/harness/tests/extracts/grill-screen-tc.md +40 -0
  128. package/harness/tests/extracts/testcase-gen-cli.md +57 -0
  129. package/harness/tests/extracts/testcase-plan.md +29 -0
  130. package/harness/tests/extracts/tests-verify-gate.md +29 -0
  131. package/harness/tests/extracts/wire-test-handoff.md +37 -0
  132. package/harness/tests/skills/grill-testcase/SKILL.md +1 -0
  133. package/harness/tests/skills/test-api/SKILL.md +14 -6
  134. package/harness/tests/skills/testcase/SKILL.md +3 -1
  135. package/harness/tests/templates/TC.example-api.yaml +7 -1
  136. package/harness/tests/templates/TC.example.yaml +4 -1
  137. package/harness/tests/templates/tpl-testcase-plan.md +75 -0
  138. package/package.json +1 -1
  139. package/stacks/fastapi.json +1 -0
  140. package/stacks/laravel.json +1 -0
  141. package/stacks/nestjs.json +72 -0
  142. package/stacks/nextjs-nest.json +1 -0
  143. package/stacks/nuxt4-nest.json +1 -0
  144. package/templates/project-skeleton/architecture/03-business-process/FLOW-template.md +2 -0
  145. package/templates/project-skeleton/overview/index.md +68 -2
  146. package/templates/project-skeleton/overview/operational-areas/_template.md +37 -0
  147. package/templates/project-skeleton/qa/README.md +4 -8
  148. package/templates/project-skeleton/surfaces/common/data-model/index.md +10 -2
  149. package/templates/schemas/qa-item.schema.json +98 -0
  150. package/templates/shared/api-03-mock.stub.yaml +14 -0
  151. package/templates/shared/backend-api.bundle.yaml +3 -0
  152. package/templates/shared/backend-api.yaml +4 -0
  153. package/templates/shared/be-capabilities.registry.base.json +8 -0
  154. package/templates/shared/bundle-authoring.md +44 -7
  155. package/templates/shared/default-layout.ejs +131 -18
  156. package/templates/shared/design-spec.yaml +2 -3
  157. package/templates/shared/design.registry.base.json +38 -0
  158. package/templates/shared/feature.bundle.yaml +16 -9
  159. package/templates/shared/ir/generated/spec.md +281 -0
  160. package/templates/shared/ir-spec.yaml +1 -1
  161. package/templates/shared/qa-authoring.md +78 -0
  162. package/templates/shared/qa-item.yaml +35 -14
  163. package/templates/shared/tpl-api-contract.md +133 -0
  164. package/templates/shared/tpl-screen-data-model.md +76 -0
  165. package/templates/tests-skeleton/cases/README.md +4 -0
  166. package/templates/tests-skeleton/catalog/locale.yaml +9 -0
  167. package/templates/tests-skeleton/tpl-testcase-plan.md +9 -0
  168. package/harness/docs/skills/api-integration/SKILL.md +0 -110
  169. package/harness/docs/skills/grill-integration-spec/SKILL.md +0 -51
@@ -1,55 +1,18 @@
1
1
  ---
2
2
  name: common-spec
3
- extractBundle: spec-core
4
- description: EXCLUSIVE /common-spec — Use this to define common technical bundles (YAML) for a Surface for Codegen. DO NOT output Markdown files.
3
+ description: DEPRECATED — common no longer uses YAML bundles on the docs hub. Use /common (Markdown) or custom-base.
5
4
  disable-model-invocation: true
6
5
  ---
7
6
 
8
- > [!CRITICAL] MANDATORY PRE-FLIGHT
9
- > **[MANDATORY]** Re-read this entire `SKILL.md` via file-read tool. STRICTLY FORBIDDEN to rely on memory.
10
- > **[MANDATORY]** Read `.cursor/extracts/common-scope.md` first to resolve the LCA path.
7
+ # /common-spec — DEPRECATED
11
8
 
12
- # /common-spec — Common Technical Bundle (YAML)
9
+ Common technical bundles (`common/yaml`, `*.bundle.yaml` under `surfaces/.../common`) are **no longer** part of the product workflow.
13
10
 
14
- **Target Path:** `<LCA>/common/yaml/<slug>/<slug>.bundle.yaml` (LCA from `common-scope.md`).
11
+ | Need | Use |
12
+ |------|-----|
13
+ | Cross-flow product doc | `common/processes/FLOW-*.md` |
14
+ | Shared UX/business rules | `/common` → `common/patterns/*.md` |
15
+ | UI patterns (delete flow, badges, flat design, …) | FE **base** + `flowgrid-ux-common.mdc` during `/spec` / grill |
16
+ | New shared component / codegen template | [custom-base](../../../docs/workflows/custom-base.md) → `build-template-code` |
15
17
 
16
- **Gate:** Only use when user explicitly invokes `/common-spec` or confirmed a grill proposal to promote common.
17
-
18
- ---
19
-
20
- ## Rule: Platform-Agnostic Generation
21
-
22
- - **[MANDATORY]** Use `design.shell.tag` to match target surface type:
23
- - Web Portal → `#shell: DataListPage`
24
- - WinForms Kiosk → `#shell: KioskCheckIn`
25
- - Gateway → `#shell: OtAdapter`
26
- - **[MANDATORY]** Populate `spec.clients` if applicable.
27
- - **[RECOMMENDED]** For known Web patterns (e.g. `confirm-dialog`): ask if user wants to inherit from seed template in `templates/project-skeleton/surfaces/common/yaml/`.
28
- - **[MANDATORY]** For non-Web surfaces → generate new bundle tailored to that requirement. Do NOT force Web template inheritance.
29
-
30
- ---
31
-
32
- ## Rule: Output
33
-
34
- - **[MANDATORY]** Output MUST be `.bundle.yaml`. Do NOT write `.md` directly.
35
- - **[MANDATORY]** All strings containing `:` must be double-quoted.
36
- - **[MANDATORY]** After writing: instruct user to run `flowgrid split -- <path>` (must emit `ir/design.yaml`), then `flowgrid render`. Run `flowgrid split --check` to verify.
37
- - **[STRICTLY FORBIDDEN]** Do NOT send BE `/api` a common FE bundle. bộ code → FE `/gen-common` only.
38
-
39
- ---
40
-
41
- ## Workflow
42
-
43
- 1. Read `common-scope.md`. Identify consumers → one LCA `common/yaml/<slug>/`.
44
- - Example module-local: `surfaces/admin/CMP-ADM-002/common/yaml/confirm-dialog/confirm-dialog.bundle.yaml`
45
- 2. Generate `.bundle.yaml` using `portal-feature-bundle/v1` schema.
46
- 3. Instruct user: `flowgrid split -- <path>` → `flowgrid render`.
47
-
48
- ---
49
-
50
- ## Verification Checklist
51
-
52
- - [ ] LCA resolved from `common-scope.md`; path correctly scoped.
53
- - [ ] `design.shell.tag` matches target surface type.
54
- - [ ] `.bundle.yaml` output only (no `.md`). YAML strings with `:` are double-quoted.
55
- - [ ] `flowgrid split --check` passes (emits `ir/design.yaml`).
18
+ **If invoked:** STOP and redirect — do not author `common/yaml` or run `flowgrid split` for CMN bundles.
@@ -10,16 +10,33 @@ extractBundle: architecture-core
10
10
 
11
11
  # /db-erd — Business Data Model (ERD)
12
12
 
13
+ **Phase:** **0 Architecture** — sau `/overview`, `/module`, `/business-process` khi có entity/bảng mới. **Trước** `/spec` leaf.
14
+
15
+ **Hub SSOT:** [architecture-data.md](../../../docs/workflows/architecture-data.md)
16
+
13
17
  **Target Path:** `<LCA>/common/db-erd.md` — LCA resolved from `.cursor/extracts/common-scope.md`.
14
18
  VitePress/publish menu label: **`db-erd`** (not the H1 heading).
15
19
 
20
+ **Handoff:** Design `/spec` đọc file này; chi tiết cột → `design.sections[].db` + `spec.entities` — **không** duplicate full ER trên bundle.
21
+
16
22
  ---
17
23
 
18
24
  ## Rule: Modeling Approach
19
25
 
20
26
  - **[MANDATORY]** Use Mermaid `erDiagram`. Start from business entities and domain data ownership — NOT from a raw repository schema dump.
21
27
  - **[MANDATORY]** Place shared entities in the common scope when reused by multiple surfaces or modules.
28
+ - **[MANDATORY]** Document per entity: business name, owning `CMP-*` / surface, primary key, main attributes (not every UI-only field).
22
29
  - **[STRICTLY FORBIDDEN]** Do NOT use this skill as a per-repository ORM/schema export unless the repository boundary strictly represents the actual data boundary.
30
+ - **[STRICTLY FORBIDDEN]** Do NOT author per-screen `db:` bindings here — that is `/spec` (Phase 1).
31
+
32
+ ---
33
+
34
+ ## Rule: Phase 0 sequence
35
+
36
+ 1. Confirm LCA with `common-scope.md` (same as `/common` patterns).
37
+ 2. Read existing `db-erd.md` at wider LCA if any — extend, do not fork duplicate ER.
38
+ 3. Write/update `<LCA>/common/db-erd.md`.
39
+ 4. Optional: link entities in `common/data-model/index.md` (prose / `#derived-data` only).
23
40
 
24
41
  ---
25
42
 
@@ -27,3 +44,12 @@ VitePress/publish menu label: **`db-erd`** (not the H1 heading).
27
44
 
28
45
  - **[MANDATORY]** Reference source mappings from `legacy-repos.local.json`.
29
46
  - **[MANDATORY]** Map legacy schema to the business data model and entity ownership.
47
+
48
+ ---
49
+
50
+ ## Verification Checklist
51
+
52
+ - [ ] LCA path correct; single `db-erd.md` at that level.
53
+ - [ ] Mermaid `erDiagram` renders; entities have owner module/surface.
54
+ - [ ] Main relationships and cardinality documented.
55
+ - [ ] No per-screen column inventory (deferred to `/spec`).
@@ -1,46 +1,52 @@
1
1
  ---
2
2
  name: grill
3
- description: /grill — General discovery/gap-fill grill before authoring any skill. Routes to the correct specialized grill.
3
+ description: /grill — Gap router only. Routes to specialized grill skills; never authors SSOT inline.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
7
  > [!CRITICAL] MANDATORY PRE-FLIGHT
8
8
  > **[MANDATORY]** Re-read this entire `SKILL.md` via file-read tool. STRICTLY FORBIDDEN to rely on memory.
9
9
 
10
- # /grill — Discovery & Gap Fill Router
10
+ # /grill — Discovery & Gap Router
11
11
 
12
- **Mindset:** Discovery and resolution of ambiguity — not authoring. Route to the correct specialized grill.
12
+ **Mindset:** Surface **gaps / orphans / misalignment** — route to one specialized grill. **Not** authoring, **not** multi-phase product planning.
13
+
14
+ SSOT flow: `docs/workflows/grill-and-human-review.md` · close checklist: `docs/workflows/gates.md#close-one-function`.
13
15
 
14
16
  ---
15
17
 
16
18
  ## Rule: Routing Logic
17
19
 
18
- - **[MANDATORY]** Route based on what is unclear or incomplete:
19
-
20
- | Context | Route to |
21
- |---|---|
22
- | UI/UX acceptance, copy, layout gaps | `/grill-bqa` |
23
- | Codegen tags, API contracts, `bundle.gen` | `/grill-dev` |
24
- | Backend API spec trio (Portal FE exists) | `/grill-api-spec` |
25
- | Integration contract (webhook/partner/no FE) | `/grill-integration-spec` |
26
- | Architecture-level design (services, C4) | `/architecture-grill` |
27
- | Common YAML bundle audit | `/grill-common-spec` |
28
- | Doc hub content quality | `/grill-docs` |
29
-
30
- - **[STRICTLY FORBIDDEN]** Do NOT use `/grill` as a catch-all that attempts to resolve all gaps inline — always route to the specialized grill for that domain.
20
+ - **[MANDATORY]** Pick **one** row — then run that skill in a **new focused session** when possible:
21
+
22
+ | Gap context | Route to |
23
+ | --- | --- |
24
+ | UI acceptance, copy, validation, UX affordance | `/grill-bqa` |
25
+ | `bundle.gen`, codegen profile, `#gen:*`, endpoint `action` on `01` | `/grill-dev` |
26
+ | BQA ↔ Dev contradiction on same bundle | `/grill-docs` |
27
+ | `01-backend-spec.yaml` contract (portal or `base: none`) | `/grill-api-spec` |
28
+ | Generated BE routes/code vs `01` | `/audit-api` (BE repo) |
29
+ | Prototype / mock boundary / testIds before ship UI | `/grill-prototype` |
30
+ | `TC-*.yaml` plan, matrix, trace bundle (tests-docs hub) | `/grill-testcase` |
31
+ | Playwright `*.spec.ts` ↔ TC ↔ PO (after `/test` green) | `/grill-test` |
32
+ | Unit tests (FE or BE lane) | `/grill-unit` or `/grill-api-unit` |
33
+ | Architecture / C4 / cross-service boundary | `/architecture-grill` |
34
+ | Shared rule Markdown (`common/patterns`) | `/common` — not YAML grill |
35
+
36
+ - **[STRICTLY FORBIDDEN]** Resolve all domains in one `/grill` chat.
37
+ - **[STRICTLY FORBIDDEN]** Use `/grill-docs` for first-pass spec — only **reconcile** after `/grill-bqa` + `/grill-dev`.
31
38
 
32
39
  ---
33
40
 
34
41
  ## Rule: Missing Information Protocol
35
42
 
36
- - **[MANDATORY]** All discovered gaps → trigger `AskQuestion` wizard per specialized skill guidelines. Present one question at a time with **≥3 options**.
37
- - **[MANDATORY]** After member answers → route to the appropriate specialized skill.
38
- - **[STRICTLY FORBIDDEN]** Do NOT invent business rules, API contracts, or UI copy during general grill.
43
+ - **[MANDATORY]** Delegate AskQuestion wizard to the target skill (≥3 options, Law 2 hard stop at ≥10 gaps).
44
+ - **[STRICTLY FORBIDDEN]** Invent business rules, API contracts, or UI copy in the router.
39
45
 
40
46
  ---
41
47
 
42
48
  ## Verification Checklist
43
49
 
44
- - [ ] Identified correct specialized grill for the gap type.
45
- - [ ] Gaps surfaced via AskQuestion wizard (≥3 options).
46
- - [ ] Routed to correct specialized skill with gap context.
50
+ - [ ] Exactly one specialized grill chosen for the reported gap type.
51
+ - [ ] Member told which audit CLI the target skill will run (`audit spec`, `cases:gate`, `audit e2e`, `audit api`, …).
52
+ - [ ] No SSOT files authored from this router.
@@ -1,15 +1,13 @@
1
1
  ---
2
2
  name: grill-api
3
- description: >-
4
- /grill-api — Discovery router for backend API grill. Routes to /grill-api-spec
5
- (Portal-backed) or /grill-integration-spec (webhook/partner/no FE) based on source.kind.
3
+ description: /grill-api — docs-hub router to /grill-api-spec only. BE code audit uses /audit-api on API repo.
6
4
  disable-model-invocation: true
7
5
  ---
8
6
 
9
7
  > [!CRITICAL] MANDATORY PRE-FLIGHT
10
8
  > **[MANDATORY]** Re-read this entire `SKILL.md` via file-read tool. STRICTLY FORBIDDEN to rely on memory.
11
9
 
12
- # /grill-api — Backend Grill Router
10
+ # /grill-api — Contract grill router (docs hub)
13
11
 
14
12
  ---
15
13
 
@@ -20,7 +18,7 @@ disable-model-invocation: true
20
18
  | Context | Route to |
21
19
  |---|---|
22
20
  | `feature.source.base` is Portal | `/grill-api-spec` |
23
- | `feature.source.base: none` / webhook / partner | `/grill-integration-spec` |
21
+ | `feature.source.base: none` / webhook / partner | `/grill-api-spec` |
24
22
 
25
- - **[MANDATORY]** If `01-backend-spec.yaml` does not exist yet → run `/api-spec` or `/api-integration` first.
23
+ - **[MANDATORY]** If `01-backend-spec.yaml` does not exist yet → run `/api-spec` first.
26
24
  - **[STRICTLY FORBIDDEN]** Do NOT attempt to audit the API contract from within this routing skill — delegate immediately.
@@ -1,57 +1,77 @@
1
1
  ---
2
2
  name: grill-api-spec
3
- description: EXCLUSIVE /grill-api-spec — ONLY for auditing backend API contracts under surfaces/ (Portal FE backed). DO NOT generate Markdown reports.
3
+ description: EXCLUSIVE /grill-api-spec — audit backend API contracts under surfaces/. DO NOT generate Markdown reports.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
7
  > [!CRITICAL] MANDATORY PRE-FLIGHT
8
8
  > **[MANDATORY]** Re-read this entire `SKILL.md` via file-read tool. STRICTLY FORBIDDEN to rely on memory.
9
- > **[MANDATORY]** Read entire `ir/design.yaml`. If `ir/` is missing, read entire `*.bundle.yaml`.
9
+ > **[MANDATORY]** Read `.cursor/extracts/api-codegen-readiness.md`, `api-codegen-tags.md`, `verify-gate.md`, and `api-contract.md`.
10
+ > **[MANDATORY]** When `feature.source.base` ≠ `none`: read entire `ir/design.yaml`. If `ir/` is missing, read entire `*.bundle.yaml`.
11
+ > **[MANDATORY]** When `feature.source.base: none` (webhook/partner/public API, no portal FE): do **not** use `ir/design.yaml` as BE contract — audit `01-backend-spec.yaml` only.
10
12
 
11
- # /grill-api-spec — API Contract Audit (Portal FE)
13
+ # /grill-api-spec — API Contract Audit
12
14
 
13
15
  After `/api-spec`. Before bộ code BE `/api`. No code implementation on docs hub.
14
16
 
15
- Shared extracts: `spec-evolution.md`, `api-spec-sync.md`, `entity-relationship.md`, `api-codegen-readiness.md`, `api-codegen-tags.md`, `agent-discipline.md`, `verify-gate.md`
17
+ Shared extracts: `spec-evolution.md`, `api-spec-sync.md`, `entity-relationship.md`, `api-codegen-readiness.md`, `api-codegen-tags.md`, `call-external.md`, `agent-discipline.md`, `verify-gate.md`
16
18
 
17
19
  ---
18
20
 
19
21
  ## Rule: Scope
20
22
 
21
- - **[MANDATORY]** Audit `…/api/<seq>/01-backend-spec.yaml`; never a `01` directly on the function slug leaf itself.
23
+ - **[MANDATORY]** Audit `…/api/<seq>/01-backend-spec.yaml` under any surface path (`surfaces/<surface>/…/api/<seq>/`, including dedicated external-channel surfaces).
22
24
  - **[STRICTLY FORBIDDEN]** No BQA 3-Pillars reports. No framework code snippets. No writing `ir/*`.
23
25
 
24
26
  ---
25
27
 
26
28
  ## Rule: Audit Steps
27
29
 
30
+ **Portal-backed (`feature.source.base` ≠ `none`):**
31
+
28
32
  - **[MANDATORY]** Step 1 — Reuse check: `#reuse-api` actions/items must have NO extra trio; `reuseFrom` must point to an existing `01`.
29
33
  - **[MANDATORY]** Step 2 — Cross-check requirements vs endpoints, entities, permissions, validations, errors.
30
- - **[MANDATORY]** Step 3 — Engineering & Error hashtag audit:
31
- - Verify `#call-external`, `#cross-service`, `#cross-entity-service`, `#derived-data`.
32
- - `#tech-debt:*` MUST be `#tech-debt:QA-<feature.id>-NNNN` with a matching file in `qa/open/`.
33
- - Endpoint error storming: `{id}` routes → `#err:not-found` (404) + `#err:idor-violation` (403); POST/PUT → `#err:validation` (422); authed routes → `#err:permission-denied` (403).
34
- - **[MANDATORY]** Step 4 — Enrich `01` with: `codegen.profile|entity|module`, `api.endpoints[].action`, `#gen:*` tags, `approval`.
35
- - **[MANDATORY]** Step 5 — Run gates:
36
- - `flowgrid check --spec surfaces/<surface>/CMP-*/<NN…>/api/<seq>/01-backend-spec.yaml`
37
- - `flowgrid openapi_gen --spec …/01-backend-spec.yaml`
38
- - `flowgrid openapi_render`
39
- - **[MANDATORY]** Only ask member for product decisions; resolve technical gaps from codebase/Portal evidence.
34
+ - **[MANDATORY]** Step 3 — Engineering & Error hashtag audit (`#call-external`, `#tech-debt:QA-*`, error storming matrix).
35
+ - **[MANDATORY]** Step 4 — Enrich `01` with `codegen.profile|entity|module`, `api.endpoints[].action`, `#gen:*`, `approval`.
36
+
37
+ **BE-only / external channel (`feature.source.base: none`):**
38
+
39
+ - **[MANDATORY]** Authentication, `securitySchemes`, idempotency keys, retry policies, non-CRUD actions.
40
+ - **[MANDATORY]** Enrich with `#gen:*`, `#manual-service`, `#call-external`, `codegen.profile|entity|module`, `endpoints[].action`.
41
+ - **[MANDATORY]** Partner/webhook error tags: `#err:signature-invalid`, `#err:rate-limit`, `#err:unauthorized` where applicable.
40
42
 
41
43
  ---
42
44
 
43
- ## Rule: Missing Information
45
+ ## Rule: Gates
46
+
47
+ Run from docs hub cwd (or pass `--docs-root`); paths relative to docs hub:
48
+
49
+ **Deterministic audit (lượng):**
50
+
51
+ 1. `flowgrid audit api <path-to-01-backend-spec.yaml>` — consume `gaps[]` / `confirms[]` on the contract.
52
+ 2. When portal-backed and sibling `*.bundle.yaml` exists: `flowgrid audit fe-be <bundle.yaml>` — `apiRef` ↔ `01` parity.
44
53
 
45
- - **[MANDATORY]** Unknown facts → `AskQuestion` wizard, one question at a time, ≥3 options: (1) Recommended, (2) Other, (3) "Log as Tech Debt".
46
- - **[STRICTLY FORBIDDEN]** No `openQuestions` in YAML. No inventing endpoint logic.
54
+ **Contract toolchain:**
55
+
56
+ 3. `flowgrid api:check --spec <path-to-01-backend-spec.yaml>`
57
+ 4. `flowgrid openapi_gen --spec <same-01>`
58
+ 5. `flowgrid openapi_render`
59
+
60
+ Re-run steps 1–5 after patching `01` until audit gaps are resolved or logged as `#tech-debt:QA-*`.
61
+
62
+ - **[STRICTLY FORBIDDEN]** Do **not** run `flowgrid check` on `01-backend-spec.yaml` — `flowgrid check` is for `*.bundle.yaml` IR sync only.
47
63
 
48
64
  ---
49
65
 
50
66
  ## Verification Checklist
51
67
 
52
- - [ ] `#reuse-api` actions have no extra trio; `reuseFrom` points to existing `01`.
53
- - [ ] Target: `01-backend-spec.yaml` under `…/api/<seq>/` or `…/common/yaml/<slug>/`.
54
- - [ ] Error matrix: `{id}` → 404 + 403 IDOR; POST/PUT → 422; global via OpenAPI `$ref`.
55
- - [ ] `#gen:*` + `action` populated on new `01` files.
56
- - [ ] Gates executed: `flowgrid check` + `openapi:gen` + `openapi:render` exit 0.
57
- - [ ] `approval.status` updated on new `01` YAML.
68
+ - [ ] Target: `01-backend-spec.yaml` under `…/api/<seq>/`.
69
+ - [ ] Portal-backed: `#reuse-api` + error matrix; BE-only: auth + idempotency + retry + `#call-external`.
70
+ - [ ] `audit api` (+ `audit fe-be` when portal bundle present) consumed; no silent structural gaps.
71
+ - [ ] Gates: `api:check` + `openapi_gen` + `openapi_render` exit 0.
72
+ - [ ] `approval.status` updated on `01` YAML.
73
+ - [ ] No `openQuestions` in YAML; no `.md` written directly.
74
+
75
+ ## Handoff
76
+
77
+ - `approval.status: approved` → bộ code BE `/api` with `--spec …/01-backend-spec.yaml`
@@ -26,17 +26,30 @@ disable-model-invocation: true
26
26
 
27
27
  ---
28
28
 
29
+ ## Rule: Audit Interlock (`flowgrid audit spec`)
30
+
31
+ - **[MANDATORY]** Before Step A: run `flowgrid audit spec <*.bundle.yaml> --type <pageType>`.
32
+ - `<pageType>` from `gen.codegen.profile` when set; else infer from prompt (list | create | detail | auth | admin-crud | …) — same table as `docs/workflows/grill-and-human-review.md`.
33
+ - If profile unknown → AskQuestion to lock profile **before** audit (do not use `--type unknown`).
34
+ - **[MANDATORY]** Consume `gaps[]` (patch bundle) and `confirms[]` (AskQuestion with `(Recommended)` from audit): `CONFIRM_UX_*` + **`CONFIRM_DB_*`** (`db-audit-wizard.md`).
35
+ - **[MANDATORY]** After any bundle patch in Step A or B: **re-run** `flowgrid audit spec` until structural `gaps[]` empty or deferred via `qa/<SHORT>_NNNN.yaml`.
36
+ - **[RECOMMENDED]** Resolve `warnings[]` (placeholders, missing metrics/non-goals) when BQA has answers; sync `userStories` if UX copy changed.
37
+ - **[MANDATORY]** After reconcile: `flowgrid split` + `flowgrid render` — stakeholder review uses `ir/generated/spec.md`.
38
+ - **[STRICTLY FORBIDDEN]** Skip audit and rely on manual zone review only.
39
+
40
+ ---
41
+
29
42
  ## Rule: Missing Information / Gap Handling & Workload Threshold (Law 2)
30
43
 
31
44
  - **[MANDATORY]** For `#missing_info` / open gaps: re-check ArtifactGraph → micro-scope → evaluate total gap volume:
32
45
  - **Small Scope (≤5 questions):** `AskQuestion` wizard in chat thread — **one question at a time**, **≥3 options**: (1) `(Recommended)`, (2) `Other` (free text), (3) `Log as Tech Debt (Pending)`.
33
46
  - **Large Scope (≥10 gaps):** **[MANDATORY HARD STOP IN CHAT]**. Do not spam single questions in chat. Generate an implementation plan / Plan Mode document partitioned into sequential Phases (3–5 gaps per phase) with disk offloading at boundaries.
34
- - **[MANDATORY]** If member selects "Log as Tech Debt" → create `qa-inbox.md` entry. Close later with `/qa-resolve`.
47
+ - **[MANDATORY]** If member selects "Log as Tech Debt" → copy from `.flowgrid/templates/qa-item.yaml` per `qa-authoring.md`; create `qa/<SHORT>_NNNN.yaml`. Close later with `/qa-resolve`.
35
48
  - **[STRICTLY FORBIDDEN]** Never write `openQuestions` in YAML. Never silently overwrite settled SSOT without explicit confirmation.
36
49
 
37
50
  ---
38
51
 
39
- ## Rule: UI Error Handling (3 Outcomes)
52
+ ## Rule: UI Error Handling (4-tier outcomes)
40
53
 
41
54
  - **[MANDATORY]** Every user action / API call in `design.yaml` MUST have the 6-block Action Flow and 4-tier outcomes documented:
42
55
  1. `preconditions`: UI validity, record status, RBAC permissions, disabled reason.
@@ -81,18 +94,19 @@ disable-model-invocation: true
81
94
  ## Workflow
82
95
 
83
96
  **Step A — fact-lock** (`grillStatus.bqaFacts`):
84
- 1. Compare `design.zones/behavior/actions` vs `legacy.ui` vs common UI; cross-check affordances via `flowgrid-ux-common.mdc` when DSL tags exist but behavior is thin.
85
- 2. Audit business focus (summary, requirements, CSS, error flows).
86
- 3. Cross-check common patterns.
87
- 4. Audit UI error handling flows (all 3 outcomes per action).
88
- 5. Patch bundle → `flowgrid split`.
89
- 6. Set `grillStatus.bqaFacts: done`.
97
+ 1. Run `flowgrid audit spec <bundle> --type <pageType>`; patch structural `gaps[]`.
98
+ 2. Compare `design.zones/behavior/actions` vs `legacy.ui` vs common UI; cross-check affordances via `flowgrid-ux-common.mdc` when DSL tags exist but behavior is thin.
99
+ 3. Audit business focus (summary, requirements, CSS, error flows).
100
+ 4. Cross-check common patterns.
101
+ 5. Audit UI error handling flows (4-tier outcomes per action).
102
+ 6. Patch bundle → re-run audit spec → `flowgrid split`.
103
+ 7. Set `grillStatus.bqaFacts: done`.
90
104
 
91
105
  **Step B — member wizard** (`grillStatus.bqaOpen`):
92
- 7. AskQuestion for remaining gaps (batches ≤5).
93
- 8. Apply member decisions to bundle.
94
- 9. Set `grillStatus.bqaOpen: done`.
95
- 10. User runs `docs_render` / `flowgrid render`.
106
+ 8. AskQuestion for remaining `confirms[]` / BQA gaps (batches ≤5).
107
+ 9. Apply member decisions to bundle → re-run `flowgrid audit spec`.
108
+ 10. Set `grillStatus.bqaOpen: done`.
109
+ 11. User runs `docs_render` / `flowgrid render`.
96
110
 
97
111
  ---
98
112
 
@@ -112,7 +126,8 @@ disable-model-invocation: true
112
126
 
113
127
  - [ ] Load policy complied (did not load codegen, legacy source code, or generated `*.md`).
114
128
  - [ ] Step A completed with `grillStatus.bqaFacts: done` before Step B.
115
- - [ ] Every action/API call in `design.yaml` has all 3 error outcomes (Success + CommonError + SpecificError).
129
+ - [ ] `flowgrid audit spec` run before Step A, after patches, and before handoff to `/grill-dev`.
130
+ - [ ] Every action/API call in `design.yaml` has 4-tier outcomes (success, business, security, system).
116
131
  - [ ] `summary` is 100% Non-tech; `spec.requirements` covers Validations, State Machine, Permissions, Edge Cases.
117
132
  - [ ] All gaps used AskQuestion wizard + member confirm (or `QA-*` pointer). No `openQuestions` in YAML.
118
133
  - [ ] `grillStatus.bqaOpen: done` after this pass.
@@ -1,43 +1,18 @@
1
1
  ---
2
2
  name: grill-common-spec
3
- description: EXCLUSIVE /grill-common-spec — Use this to audit and verify technical common bundles before code generation.
3
+ description: DEPRECATED — no common YAML bundles to grill. Route to /grill-bqa on function bundles or /common for pattern MD.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
- > [!CRITICAL] MANDATORY PRE-FLIGHT
8
- > **[MANDATORY]** Re-read this entire `SKILL.md` via file-read tool. STRICTLY FORBIDDEN to rely on memory.
7
+ # /grill-common-spec — DEPRECATED
9
8
 
10
- # /grill-common-spec — Common Bundle Audit
9
+ There is no `common/yaml` + IR grill path on the docs hub anymore.
11
10
 
12
- **Target Path:** `<LCA>/common/yaml/<slug>/<slug>.bundle.yaml` (see `.cursor/extracts/common-scope.md`).
11
+ | Gap | Route |
12
+ |-----|--------|
13
+ | Function screen/API spec | `/grill-bqa` · `/grill-dev` on `*.bundle.yaml` |
14
+ | Shared rule prose | `/common` (patterns Markdown) |
15
+ | UI affordance / pattern | `flowgrid-ux-common.mdc` + `/grill-bqa` |
16
+ | Registry / template drift | [custom-base](../../../docs/workflows/custom-base.md) |
13
17
 
14
- ---
15
-
16
- ## Rule: Audit Checks
17
-
18
- - **[MANDATORY]** Verify `schema` is set (e.g. `portal-feature-bundle/v1` or appropriate surface schema).
19
- - **[MANDATORY]** Verify `design.shell.tag` reflects the target platform:
20
- - Web Portal → `#shell: DataListPage`
21
- - WinForms → `#shell: KioskCheckIn`
22
- - Gateway → `#shell: OtAdapter`
23
- - **[MANDATORY]** Verify `spec.principles` and `spec.acceptance` are detailed enough to drive test cases and codegen.
24
- - **[MANDATORY]** Verify `design.patterns` and referenced middlewares point to valid, existing items.
25
- - **[STRICTLY FORBIDDEN]** Do NOT "fix" a module-common bundle by copying it to surface `common/`.
26
-
27
- ---
28
-
29
- ## Rule: Output
30
-
31
- - **[STRICTLY FORBIDDEN]** Do NOT output new files from this skill.
32
- - **[MANDATORY]** If issues are found → inform user + suggest fixes, or fix directly in `.bundle.yaml` if instructed.
33
- - **[MANDATORY]** If bundle passes → instruct user: run `flowgrid split -- <path>` (must emit `ir/design.yaml`), then bộ code FE `/gen-common`.
34
- - **[STRICTLY FORBIDDEN]** Do NOT send BE `/api` a common FE bundle.
35
-
36
- ---
37
-
38
- ## Verification Checklist
39
-
40
- - [ ] `schema` field set correctly.
41
- - [ ] `design.shell.tag` aligned with target surface type.
42
- - [ ] `spec.principles` and `spec.acceptance` are substantive.
43
- - [ ] All `design.patterns` / middleware references are valid and exist.
18
+ **If invoked:** STOP — do not load `surfaces/common/yaml`.
@@ -8,7 +8,7 @@ disable-model-invocation: true
8
8
  > [!CRITICAL] MANDATORY PRE-FLIGHT
9
9
  > **[MANDATORY]** Re-read this entire `SKILL.md` via file-read tool. STRICTLY FORBIDDEN to rely on memory.
10
10
  > **[MANDATORY]** Read entire `ir/design.yaml`. If `ir/` is missing, read entire `*.bundle.yaml`. NEVER filter partial keys.
11
- > **[MANDATORY]** Expect `grillStatus.bqaOpen: done` (or `bqaFacts`) before starting.
11
+ > **[MANDATORY]** Expect `grillStatus.bqaOpen: done` before starting. Do **not** start if only `bqaFacts` is set — finish `/grill-bqa` Step B first.
12
12
 
13
13
  # /grill-dev — Dev / Codegen Grill
14
14
 
@@ -30,11 +30,12 @@ disable-model-invocation: true
30
30
 
31
31
  ## Rule: Audit Interlock with Page Type
32
32
 
33
- - **[MANDATORY]** Before grilling, run: `flowgrid audit spec <bundle> --type <profile>`.
33
+ - **[MANDATORY]** Before grilling, run: `flowgrid audit spec <bundle> --type <profile>`. Treat `warnings[]` as non-blocking; nudge BQA via handoff if summary still has `[placeholder]` brackets.
34
+ - **[MANDATORY]** After `bundle.gen` patch: `flowgrid split` + `flowgrid render` (FE uses `ir/design.yaml`; BA PDF path uses `ir/generated/spec.md`).
34
35
  - `<profile>` lấy từ `gen.codegen.profile` đã xác nhận (list | create | detail | admin-crud | auth | ...).
35
36
  - Nếu profile chưa set → hỏi member xác định profile trước, KHÔNG chạy audit với `--type unknown`.
36
- - Script output `gaps[]` + `confirms[]` (includes `UX_*` / `CONFIRM_UX_*` affordance — see `flowgrid-ux-common.mdc`).
37
- - Agent patches structural `gaps[]`; UX confirms → wizard with `(Recommended)` from audit output.
37
+ - Script output `gaps[]` + `confirms[]` (`CONFIRM_UX_*`, **`CONFIRM_DB_*`** — `db-audit-wizard.md`).
38
+ - Agent patches structural `gaps[]`; UX/DB confirms → wizard; BE drift → `/api-update` then re-audit.
38
39
 
39
40
  ---
40
41
 
@@ -53,7 +54,7 @@ disable-model-invocation: true
53
54
  → **Proactively brainstorm** logical suggestions from business context in Vietnamese (e.g. login page → suggest `module: auth, entity: user`).
54
55
  - **Small Scope (≤5 questions):** Trigger `AskQuestion` wizard — **one question at a time**, ≥3 options: (1) `(Recommended)`, (2) `Other` (free text), (3) `Log as Tech Debt (Pending)`. Wait for member answer before showing next question.
55
56
  - **Large Scope (≥10 gaps/endpoints):** **[MANDATORY HARD STOP IN CHAT]**. Do not spam single questions in chat. Generate an implementation plan / Plan Mode document partitioned into sequential Phases (3–5 endpoints/gaps per phase) with disk offloading at boundaries.
56
- - ✅ If member selects "Log as Tech Debt" → create `qa/open/QA-<bundle.id>-NNNN.yaml`; maintain `grillStatus.dev: pending`.
57
+ - ✅ If member selects "Log as Tech Debt" → create `qa/<SHORT>_NNNN.yaml`; maintain `grillStatus.dev: pending`.
57
58
  - ❌ Do NOT set `grillStatus.dev: done` until profile + entity/module + endpoint actions are all verified and confirmed.
58
59
 
59
60
  ---
@@ -120,7 +121,7 @@ disable-model-invocation: true
120
121
 
121
122
  ## Rule: API Reuse & Explicit Suffix
122
123
 
123
- - **[MANDATORY]** Scan `common/yaml/` (LCA) + sibling `…/api/<seq>/` for existing `01` files. If found → tag `#reuse-api` + `reuseFrom` on page action/item; skip new trio.
124
+ - **[MANDATORY]** Scan sibling `…/api/<seq>/` (+ shared `01` on function leaf when present) for existing endpoints. If found → tag `#reuse-api` + `reuseFrom` on page action/item; skip new trio. Do not scan deprecated `common/yaml`.
124
125
  - **[MANDATORY]** All endpoint paths MUST use explicit suffixes: `/create`, `/{id}/update`, `/{id}/duplicate`, `/{id}/delete`, `/{id}/detail`.
125
126
 
126
127
  ---
@@ -155,7 +156,7 @@ disable-model-invocation: true
155
156
 
156
157
  - bộ code FE dry pass → `/prototype`
157
158
  - BQA↔Dev conflict → `/grill-docs`
158
- - Legacy fact gap → `/update-spec-legacy`
159
+ - Legacy fact gap → `/legacy /spec` or `/update-spec` (legacy evidence delta)
159
160
  - Confirmed common promote → `/docs-mark` (same session or before `/prototype`)
160
161
 
161
162
  ---
@@ -39,6 +39,13 @@ disable-model-invocation: true
39
39
 
40
40
  ---
41
41
 
42
+ ## Rule: Audit interlock (sau reconcile)
43
+
44
+ - **[MANDATORY]** After any bundle patch that touches `design.*`, `userStories`, `bundle.gen`, or `api` refs: run `flowgrid audit spec <bundle> --type <pageType>` (same profile rules as `/grill-dev`). Resolve `CONFIRM_DB_*` via `db-audit-wizard.md` before handoff.
45
+ - Patch structural `gaps[]`; defer remainder via `qa/` per Law 2.
46
+ - Address `warnings[]` when reconcile changes business prose (`summary`, `successMetrics`, `nonGoals`, `userStories`).
47
+ - ❌ Do not hand off FE until audit has been re-run post-reconcile.
48
+
42
49
  ## Rule: Codegen Gate
43
50
 
44
51
  - **[MANDATORY]** `bundle.gen.codegen.profile` (+ entity/module when required) MUST be set.
@@ -55,8 +62,8 @@ disable-model-invocation: true
55
62
  2. Reconcile common patterns (BQA flows ↔ Dev `#pattern`, `#split-hook:` tags).
56
63
  3. Reconcile `#reuse-api` on page actions/items (no duplicate `api/<seq>/` for reused APIs).
57
64
  4. Verify codegen gate: `bundle.gen.codegen.profile` set correctly.
58
- 5. Write/fix `bundle.gen` → `flowgrid_docs_bundle_split` → `docs_render`.
59
- 6. Handoff ID/path + recommendation to bộ code FE.
65
+ 5. Write/fix `bundle.gen` → `flowgrid audit spec` → `flowgrid_docs_bundle_split` → `docs_render`.
66
+ 6. Handoff ID/path + recommendation to bộ code FE (`gen:dry` on FE repo).
60
67
 
61
68
  ---
62
69
 
@@ -74,6 +81,6 @@ disable-model-invocation: true
74
81
 
75
82
  ## Verification Checklist
76
83
 
77
- - [ ] Conflicts reconciled in `*.bundle.yaml`, or deferred with `qa/open/QA-…`. No `openQuestions`.
84
+ - [ ] Conflicts reconciled in `*.bundle.yaml`, or deferred with `qa/<SHORT>_…`. No `openQuestions`.
78
85
  - [ ] `bundle.gen.codegen.profile` present and correct.
79
- - [ ] `flowgrid split` succeeded with zero errors.
86
+ - [ ] `flowgrid audit spec` re-run after reconcile; `flowgrid split` succeeded with zero errors.
@@ -11,9 +11,11 @@ extractBundle: architecture-core
11
11
 
12
12
  # /module — Business Module (CMP-*)
13
13
 
14
+ **Template:** `.cursor/extracts/tpl-module.md` (includes **Out of scope** + **Depends on**).
15
+
14
16
  **Target Paths:**
15
17
  - Module folder: `surfaces/[Surface]/[CMP-ID]/`
16
- - Main doc: `surfaces/[Surface]/[CMP-ID]/[CMP-ID].md`
18
+ - Main doc: `surfaces/[Surface]/[CMP-ID]/README.md` or `[CMP-ID].md` (team convention — MD only)
17
19
 
18
20
  ---
19
21
 
@@ -23,9 +23,10 @@ One generator: **OpenAPI 3.0.3** from `01-backend-spec.yaml`. Merge/UI stays `op
23
23
  # Or from docs hub root (all 01-backend-spec.yaml under surfaces):
24
24
  flowgrid openapi_gen
25
25
  # Validate only:
26
- flowgrid check --spec …/01-backend-spec.yaml
26
+ flowgrid api:check --spec …/01-backend-spec.yaml
27
27
  ```
28
28
  - **[MANDATORY]** After generation: run `flowgrid openapi_render` to merge fragments into `docs/openapi/api.yaml`.
29
+ - **[MANDATORY]** After contract change: run `flowgrid render` on docs hub so leaf `ir/generated/api.md` matches `01` for BA/Dev review (see `tpl-api-contract.md`).
29
30
 
30
31
  ---
31
32
 
@@ -10,10 +10,16 @@ extractBundle: architecture-core
10
10
 
11
11
  # /overview — Operational Areas Overview
12
12
 
13
- **Target Paths:** `overview/operational-areas/[Admin operations | Workforce operations | …]`
13
+ **Target Paths:** `overview/index.md`, `overview/operational-areas/<slug>.md` (copy from hub template `operational-areas/_template.md` on greenfield init).
14
14
 
15
15
  ---
16
16
 
17
+ ## Rule: arc42 §1 content
18
+
19
+ - **[MANDATORY]** `overview/index.md`: goals, stakeholders table, top 5 quality goals, persona summaries, product-level in/out scope, success metrics, link to operational areas.
20
+ - **[MANDATORY]** Each operational area file: personas, in/out scope, area metrics, `CMP-*` links, non-goals — per `_template.md`.
21
+ - **[RECOMMENDED]** Trước spec leaf lớn: overview + area đã có persona id mà `userStories.primary.asA` tham chiếu.
22
+
17
23
  ## Rule: Content Boundary
18
24
 
19
25
  - **[MANDATORY]** Overview MUST be a pure business document written in user domain language: personas, operational areas, high-level system purpose.