create-flowdular 0.2.4 → 0.2.6

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 (271) hide show
  1. package/README.md +11 -0
  2. package/agent-template/.agents/skills/agent-tool-design/SKILL.md +203 -0
  3. package/agent-template/.agents/skills/auth-security-review/SKILL.md +90 -0
  4. package/agent-template/.agents/skills/auto-review/SKILL.md +103 -0
  5. package/agent-template/.agents/skills/bug-hunt/SKILL.md +104 -0
  6. package/agent-template/.agents/skills/business-agent-design/SKILL.md +182 -0
  7. package/agent-template/.agents/skills/cli-extension/SKILL.md +108 -0
  8. package/agent-template/.agents/skills/core-extend/SKILL.md +99 -0
  9. package/agent-template/.agents/skills/database-adapter/SKILL.md +198 -0
  10. package/agent-template/.agents/skills/database-adapter/references/first-run-and-matrix.md +105 -0
  11. package/agent-template/.agents/skills/migration-authoring/SKILL.md +161 -0
  12. package/agent-template/.agents/skills/module-new/SKILL.md +171 -0
  13. package/agent-template/.agents/skills/module-update/SKILL.md +91 -0
  14. package/agent-template/.agents/skills/perf-audit/SKILL.md +98 -0
  15. package/agent-template/.agents/skills/release-eject-pr/SKILL.md +107 -0
  16. package/agent-template/.agents/skills/spec-approval/SKILL.md +106 -0
  17. package/agent-template/.agents/skills/test-hardening/SKILL.md +79 -0
  18. package/agent-template/.agents/skills/translations-i18n/SKILL.md +78 -0
  19. package/agent-template/.agents/skills/ux-design/SKILL.md +92 -0
  20. package/agent-template/.agents/skills/variables/SKILL.md +156 -0
  21. package/agent-template/.agents/skills/workflow-development/SKILL.md +192 -0
  22. package/agent-template/.ai/README.md +62 -0
  23. package/agent-template/.ai/agents/README.md +27 -0
  24. package/agent-template/.ai/agents/module-executor.md +36 -0
  25. package/agent-template/.ai/agents/reviewer.md +23 -0
  26. package/agent-template/.ai/agents/sandbox/agentic-engineer.md +31 -0
  27. package/agent-template/.ai/agents/sandbox/backend-engineer.md +36 -0
  28. package/agent-template/.ai/agents/sandbox/business-manager.md +23 -0
  29. package/agent-template/.ai/agents/sandbox/frontend-engineer.md +27 -0
  30. package/agent-template/.ai/agents/sandbox/ux-designer.md +23 -0
  31. package/agent-template/.ai/agents/spec-author.md +29 -0
  32. package/agent-template/.ai/blueprints/add-migration/README.md +5 -0
  33. package/agent-template/.ai/blueprints/add-migration/allowed-paths.yaml +23 -0
  34. package/agent-template/.ai/blueprints/add-migration/blueprint.json +14 -0
  35. package/agent-template/.ai/blueprints/add-migration/examples/invalid/input-destructive.json +6 -0
  36. package/agent-template/.ai/blueprints/add-migration/examples/invalid/plan-unnumbered-file.json +9 -0
  37. package/agent-template/.ai/blueprints/add-migration/examples/valid/input.json +6 -0
  38. package/agent-template/.ai/blueprints/add-migration/examples/valid/plan.json +9 -0
  39. package/agent-template/.ai/blueprints/add-migration/gates.yaml +30 -0
  40. package/agent-template/.ai/blueprints/add-migration/input.schema.json +23 -0
  41. package/agent-template/.ai/blueprints/add-migration/plan.schema.json +54 -0
  42. package/agent-template/.ai/blueprints/add-migration/required-files.yaml +18 -0
  43. package/agent-template/.ai/blueprints/add-migration/spec-requirements.yaml +13 -0
  44. package/agent-template/.ai/blueprints/add-migration/steps.yaml +62 -0
  45. package/agent-template/.ai/blueprints/author-spec/README.md +5 -0
  46. package/agent-template/.ai/blueprints/author-spec/allowed-paths.yaml +7 -0
  47. package/agent-template/.ai/blueprints/author-spec/blueprint.json +14 -0
  48. package/agent-template/.ai/blueprints/author-spec/examples/invalid/input-missing-outcome.json +5 -0
  49. package/agent-template/.ai/blueprints/author-spec/examples/valid/input.json +6 -0
  50. package/agent-template/.ai/blueprints/author-spec/gates.yaml +13 -0
  51. package/agent-template/.ai/blueprints/author-spec/input.schema.json +20 -0
  52. package/agent-template/.ai/blueprints/author-spec/plan.schema.json +14 -0
  53. package/agent-template/.ai/blueprints/author-spec/required-files.yaml +6 -0
  54. package/agent-template/.ai/blueprints/author-spec/spec-requirements.yaml +35 -0
  55. package/agent-template/.ai/blueprints/author-spec/steps.yaml +28 -0
  56. package/agent-template/.ai/blueprints/author-spec/templates/module.yaml +45 -0
  57. package/agent-template/.ai/blueprints/bug-fix/README.md +5 -0
  58. package/agent-template/.ai/blueprints/bug-fix/allowed-paths.yaml +29 -0
  59. package/agent-template/.ai/blueprints/bug-fix/blueprint.json +14 -0
  60. package/agent-template/.ai/blueprints/bug-fix/examples/invalid/input-no-symptom.json +4 -0
  61. package/agent-template/.ai/blueprints/bug-fix/examples/invalid/plan-no-test.json +8 -0
  62. package/agent-template/.ai/blueprints/bug-fix/examples/valid/input.json +6 -0
  63. package/agent-template/.ai/blueprints/bug-fix/examples/valid/plan.json +8 -0
  64. package/agent-template/.ai/blueprints/bug-fix/gates.yaml +30 -0
  65. package/agent-template/.ai/blueprints/bug-fix/input.schema.json +25 -0
  66. package/agent-template/.ai/blueprints/bug-fix/plan.schema.json +53 -0
  67. package/agent-template/.ai/blueprints/bug-fix/required-files.yaml +7 -0
  68. package/agent-template/.ai/blueprints/bug-fix/spec-requirements.yaml +7 -0
  69. package/agent-template/.ai/blueprints/bug-fix/steps.yaml +51 -0
  70. package/agent-template/.ai/blueprints/core-extend/README.md +5 -0
  71. package/agent-template/.ai/blueprints/core-extend/allowed-paths.yaml +49 -0
  72. package/agent-template/.ai/blueprints/core-extend/blueprint.json +14 -0
  73. package/agent-template/.ai/blueprints/core-extend/examples/invalid/input-unknown-package.json +5 -0
  74. package/agent-template/.ai/blueprints/core-extend/examples/invalid/plan-missing-gates.json +7 -0
  75. package/agent-template/.ai/blueprints/core-extend/examples/valid/input.json +6 -0
  76. package/agent-template/.ai/blueprints/core-extend/examples/valid/plan.json +10 -0
  77. package/agent-template/.ai/blueprints/core-extend/gates.yaml +16 -0
  78. package/agent-template/.ai/blueprints/core-extend/input.schema.json +54 -0
  79. package/agent-template/.ai/blueprints/core-extend/plan.schema.json +39 -0
  80. package/agent-template/.ai/blueprints/core-extend/required-files.yaml +36 -0
  81. package/agent-template/.ai/blueprints/core-extend/spec-requirements.yaml +17 -0
  82. package/agent-template/.ai/blueprints/core-extend/steps.yaml +54 -0
  83. package/agent-template/.ai/blueprints/edit-module/README.md +9 -0
  84. package/agent-template/.ai/blueprints/edit-module/allowed-paths.yaml +27 -0
  85. package/agent-template/.ai/blueprints/edit-module/blueprint.json +20 -0
  86. package/agent-template/.ai/blueprints/edit-module/examples/invalid/input-unknown-change.json +5 -0
  87. package/agent-template/.ai/blueprints/edit-module/examples/invalid/plan-touches-platform.json +15 -0
  88. package/agent-template/.ai/blueprints/edit-module/examples/valid/input.json +5 -0
  89. package/agent-template/.ai/blueprints/edit-module/examples/valid/plan.json +25 -0
  90. package/agent-template/.ai/blueprints/edit-module/gates.yaml +30 -0
  91. package/agent-template/.ai/blueprints/edit-module/input.schema.json +31 -0
  92. package/agent-template/.ai/blueprints/edit-module/plan.schema.json +65 -0
  93. package/agent-template/.ai/blueprints/edit-module/required-files.yaml +80 -0
  94. package/agent-template/.ai/blueprints/edit-module/spec-requirements.yaml +15 -0
  95. package/agent-template/.ai/blueprints/edit-module/steps.yaml +115 -0
  96. package/agent-template/.ai/blueprints/new-module/README.md +7 -0
  97. package/agent-template/.ai/blueprints/new-module/allowed-paths.yaml +27 -0
  98. package/agent-template/.ai/blueprints/new-module/blueprint.json +20 -0
  99. package/agent-template/.ai/blueprints/new-module/examples/invalid/input-spec-outside-modules.json +4 -0
  100. package/agent-template/.ai/blueprints/new-module/examples/invalid/plan-unknown-gate.json +8 -0
  101. package/agent-template/.ai/blueprints/new-module/examples/valid/input.json +5 -0
  102. package/agent-template/.ai/blueprints/new-module/examples/valid/plan.json +22 -0
  103. package/agent-template/.ai/blueprints/new-module/gates.yaml +30 -0
  104. package/agent-template/.ai/blueprints/new-module/input.schema.json +21 -0
  105. package/agent-template/.ai/blueprints/new-module/plan.schema.json +58 -0
  106. package/agent-template/.ai/blueprints/new-module/required-files.yaml +73 -0
  107. package/agent-template/.ai/blueprints/new-module/spec-requirements.yaml +30 -0
  108. package/agent-template/.ai/blueprints/new-module/steps.yaml +138 -0
  109. package/agent-template/.ai/blueprints/release/README.md +5 -0
  110. package/agent-template/.ai/blueprints/release/allowed-paths.yaml +19 -0
  111. package/agent-template/.ai/blueprints/release/blueprint.json +14 -0
  112. package/agent-template/.ai/blueprints/release/examples/invalid/input-bad-version.json +4 -0
  113. package/agent-template/.ai/blueprints/release/examples/invalid/plan-bad-branch.json +7 -0
  114. package/agent-template/.ai/blueprints/release/examples/valid/input.json +5 -0
  115. package/agent-template/.ai/blueprints/release/examples/valid/plan.json +20 -0
  116. package/agent-template/.ai/blueprints/release/gates.yaml +20 -0
  117. package/agent-template/.ai/blueprints/release/input.schema.json +24 -0
  118. package/agent-template/.ai/blueprints/release/plan.schema.json +46 -0
  119. package/agent-template/.ai/blueprints/release/required-files.yaml +19 -0
  120. package/agent-template/.ai/blueprints/release/spec-requirements.yaml +8 -0
  121. package/agent-template/.ai/blueprints/release/steps.yaml +47 -0
  122. package/agent-template/.ai/blueprints/security-review/README.md +5 -0
  123. package/agent-template/.ai/blueprints/security-review/allowed-paths.yaml +6 -0
  124. package/agent-template/.ai/blueprints/security-review/blueprint.json +14 -0
  125. package/agent-template/.ai/blueprints/security-review/examples/invalid/input-unknown-kind.json +4 -0
  126. package/agent-template/.ai/blueprints/security-review/examples/invalid/plan-finding-without-scenario.json +14 -0
  127. package/agent-template/.ai/blueprints/security-review/examples/valid/input.json +4 -0
  128. package/agent-template/.ai/blueprints/security-review/examples/valid/plan.json +19 -0
  129. package/agent-template/.ai/blueprints/security-review/gates.yaml +22 -0
  130. package/agent-template/.ai/blueprints/security-review/input.schema.json +20 -0
  131. package/agent-template/.ai/blueprints/security-review/plan.schema.json +65 -0
  132. package/agent-template/.ai/blueprints/security-review/required-files.yaml +6 -0
  133. package/agent-template/.ai/blueprints/security-review/spec-requirements.yaml +9 -0
  134. package/agent-template/.ai/blueprints/security-review/steps.yaml +38 -0
  135. package/agent-template/.ai/examples/README.md +8 -0
  136. package/agent-template/.ai/examples/bad/client-imports-server/README.md +20 -0
  137. package/agent-template/.ai/examples/bad/client-imports-server/api.ts +12 -0
  138. package/agent-template/.ai/examples/bad/missing-acl/README.md +23 -0
  139. package/agent-template/.ai/examples/bad/missing-acl/endpoints.ts +12 -0
  140. package/agent-template/.ai/examples/bad/tenant-from-body/README.md +19 -0
  141. package/agent-template/.ai/examples/bad/tenant-from-body/endpoints.ts +33 -0
  142. package/agent-template/.ai/examples/client-contribution/CustomerListView.tsrx +34 -0
  143. package/agent-template/.ai/examples/client-contribution/README.md +11 -0
  144. package/agent-template/.ai/examples/client-contribution/contribution.tsrx +48 -0
  145. package/agent-template/.ai/examples/client-contribution/index.ts +20 -0
  146. package/agent-template/.ai/examples/client-contribution/permissions.ts +8 -0
  147. package/agent-template/.ai/examples/customer-cli-extension/README.md +14 -0
  148. package/agent-template/.ai/examples/customer-cli-extension/commands.json +17 -0
  149. package/agent-template/.ai/examples/customer-cli-extension/index.ts +36 -0
  150. package/agent-template/.ai/examples/module-create/task-packet.json +11 -0
  151. package/agent-template/.ai/guides/application-development.md +97 -0
  152. package/agent-template/.ai/policies/capabilities.yaml +164 -0
  153. package/agent-template/.ai/policies/model-routing.yaml +72 -0
  154. package/agent-template/.ai/policies/path-ownership.yaml +65 -0
  155. package/agent-template/.ai/policies/task-budgets.yaml +37 -0
  156. package/agent-template/.ai/references/catalog/LICENSE +21 -0
  157. package/agent-template/.ai/references/catalog/migrations/0001_catalog_core.down.sql +2 -0
  158. package/agent-template/.ai/references/catalog/migrations/0001_catalog_core.up.sql +21 -0
  159. package/agent-template/.ai/references/catalog/migrations/0002_catalog_history.down.sql +3 -0
  160. package/agent-template/.ai/references/catalog/migrations/0002_catalog_history.up.sql +20 -0
  161. package/agent-template/.ai/references/catalog/migrations/0003_catalog_history_service_actors.down.sql +3 -0
  162. package/agent-template/.ai/references/catalog/migrations/0003_catalog_history_service_actors.up.sql +36 -0
  163. package/agent-template/.ai/references/catalog/migrations/0004_catalog_idempotency_ledger.down.sql +3 -0
  164. package/agent-template/.ai/references/catalog/migrations/0004_catalog_idempotency_ledger.up.sql +19 -0
  165. package/agent-template/.ai/references/catalog/migrations/README.md +3 -0
  166. package/agent-template/.ai/references/catalog/module.json +27 -0
  167. package/agent-template/.ai/references/catalog/package.json +49 -0
  168. package/agent-template/.ai/references/catalog/spec/module.yaml +86 -0
  169. package/agent-template/.ai/references/catalog/src/acl/permissions.ts +6 -0
  170. package/agent-template/.ai/references/catalog/src/agent/tools.ts +164 -0
  171. package/agent-template/.ai/references/catalog/src/api/endpoints.ts +243 -0
  172. package/agent-template/.ai/references/catalog/src/client/CatalogHistoryDrawer.tsrx +123 -0
  173. package/agent-template/.ai/references/catalog/src/client/CatalogItemForm.tsrx +190 -0
  174. package/agent-template/.ai/references/catalog/src/client/CatalogView.tsrx +473 -0
  175. package/agent-template/.ai/references/catalog/src/client/api.ts +111 -0
  176. package/agent-template/.ai/references/catalog/src/client/contribution.tsrx +61 -0
  177. package/agent-template/.ai/references/catalog/src/client/index.ts +18 -0
  178. package/agent-template/.ai/references/catalog/src/client/navigation-copy.ts +9 -0
  179. package/agent-template/.ai/references/catalog/src/client/state.ts +24 -0
  180. package/agent-template/.ai/references/catalog/src/domain/types.ts +32 -0
  181. package/agent-template/.ai/references/catalog/src/domain/variables.ts +111 -0
  182. package/agent-template/.ai/references/catalog/src/index.ts +31 -0
  183. package/agent-template/.ai/references/catalog/src/platform.ts +35 -0
  184. package/agent-template/.ai/references/catalog/src/server/index.ts +4 -0
  185. package/agent-template/.ai/references/catalog/src/server/runtime.ts +86 -0
  186. package/agent-template/.ai/references/catalog/src/services/catalog-service.ts +306 -0
  187. package/agent-template/.ai/references/catalog/src/services/database-repository.ts +440 -0
  188. package/agent-template/.ai/references/catalog/src/services/index.ts +4 -0
  189. package/agent-template/.ai/references/catalog/src/services/migration.ts +171 -0
  190. package/agent-template/.ai/references/catalog/src/services/repository.ts +36 -0
  191. package/agent-template/.ai/references/catalog/src/services/target-idempotency.ts +59 -0
  192. package/agent-template/.ai/references/catalog/tests/agent-tools.test.ts +277 -0
  193. package/agent-template/.ai/references/catalog/tests/endpoints.test.ts +320 -0
  194. package/agent-template/.ai/references/catalog/tests/idempotency.test.ts +297 -0
  195. package/agent-template/.ai/references/catalog/tests/migrations.test.ts +149 -0
  196. package/agent-template/.ai/references/catalog/tests/module.test.ts +271 -0
  197. package/agent-template/.ai/references/catalog/tests/support/database.ts +76 -0
  198. package/agent-template/.ai/references/catalog/translations/en.json +101 -0
  199. package/agent-template/.ai/references/catalog/translations/pl.json +101 -0
  200. package/agent-template/.ai/references/catalog/tsconfig.json +15 -0
  201. package/agent-template/.ai/references/catalog/vitest.config.ts +16 -0
  202. package/agent-template/.ai/references/catalog.provenance.json +55 -0
  203. package/agent-template/.ai/rules/flowdular.md +86 -0
  204. package/agent-template/.ai/skills/README.md +36 -0
  205. package/agent-template/.ai/skills/agent-tool-design/SKILL.md +209 -0
  206. package/agent-template/.ai/skills/auth-security-review/SKILL.md +96 -0
  207. package/agent-template/.ai/skills/auto-review/SKILL.md +112 -0
  208. package/agent-template/.ai/skills/bug-hunt/SKILL.md +110 -0
  209. package/agent-template/.ai/skills/business-agent-design/SKILL.md +188 -0
  210. package/agent-template/.ai/skills/cli-extension/SKILL.md +114 -0
  211. package/agent-template/.ai/skills/core-extend/SKILL.md +104 -0
  212. package/agent-template/.ai/skills/database-adapter/SKILL.md +204 -0
  213. package/agent-template/.ai/skills/database-adapter/references/first-run-and-matrix.md +105 -0
  214. package/agent-template/.ai/skills/migration-authoring/SKILL.md +167 -0
  215. package/agent-template/.ai/skills/module-new/SKILL.md +180 -0
  216. package/agent-template/.ai/skills/module-update/SKILL.md +100 -0
  217. package/agent-template/.ai/skills/perf-audit/SKILL.md +105 -0
  218. package/agent-template/.ai/skills/release-eject-pr/SKILL.md +113 -0
  219. package/agent-template/.ai/skills/spec-approval/SKILL.md +112 -0
  220. package/agent-template/.ai/skills/test-hardening/SKILL.md +86 -0
  221. package/agent-template/.ai/skills/translations-i18n/SKILL.md +85 -0
  222. package/agent-template/.ai/skills/ux-design/SKILL.md +97 -0
  223. package/agent-template/.ai/skills/variables/SKILL.md +164 -0
  224. package/agent-template/.ai/skills/workflow-development/SKILL.md +199 -0
  225. package/agent-template/.claude/skills/agent-tool-design/SKILL.md +203 -0
  226. package/agent-template/.claude/skills/auth-security-review/SKILL.md +90 -0
  227. package/agent-template/.claude/skills/auto-review/SKILL.md +103 -0
  228. package/agent-template/.claude/skills/bug-hunt/SKILL.md +104 -0
  229. package/agent-template/.claude/skills/business-agent-design/SKILL.md +182 -0
  230. package/agent-template/.claude/skills/cli-extension/SKILL.md +108 -0
  231. package/agent-template/.claude/skills/core-extend/SKILL.md +99 -0
  232. package/agent-template/.claude/skills/database-adapter/SKILL.md +198 -0
  233. package/agent-template/.claude/skills/database-adapter/references/first-run-and-matrix.md +105 -0
  234. package/agent-template/.claude/skills/migration-authoring/SKILL.md +161 -0
  235. package/agent-template/.claude/skills/module-new/SKILL.md +171 -0
  236. package/agent-template/.claude/skills/module-update/SKILL.md +91 -0
  237. package/agent-template/.claude/skills/perf-audit/SKILL.md +98 -0
  238. package/agent-template/.claude/skills/release-eject-pr/SKILL.md +107 -0
  239. package/agent-template/.claude/skills/spec-approval/SKILL.md +106 -0
  240. package/agent-template/.claude/skills/test-hardening/SKILL.md +79 -0
  241. package/agent-template/.claude/skills/translations-i18n/SKILL.md +78 -0
  242. package/agent-template/.claude/skills/ux-design/SKILL.md +92 -0
  243. package/agent-template/.claude/skills/variables/SKILL.md +156 -0
  244. package/agent-template/.claude/skills/workflow-development/SKILL.md +192 -0
  245. package/agent-template/AGENTS.md +77 -0
  246. package/agent-template/CLAUDE.md +77 -0
  247. package/agent-template/docs/adr/0001-development-reload.md +16 -0
  248. package/agent-template/docs/adr/0002-durable-agent-execution.md +21 -0
  249. package/agent-template/docs/adr/0003-module-settings.md +22 -0
  250. package/agent-template/docs/adr/0004-enterprise-access-and-audit.md +36 -0
  251. package/agent-template/docs/adr/0005-sandbox-runtime-and-coding-agents.md +81 -0
  252. package/agent-template/docs/adr/0006-agentic-workflows.md +1702 -0
  253. package/agent-template/docs/adr/0007-module-owned-agents.md +429 -0
  254. package/agent-template/docs/adr/0008-database-adapter-contract.md +90 -0
  255. package/agent-template/docs/agent-contract.md +45 -0
  256. package/agent-template/docs/configuration.md +122 -0
  257. package/agent-template/docs/database-adapters.md +346 -0
  258. package/agent-template/docs/design-system.md +217 -0
  259. package/agent-template/docs/modules.md +146 -0
  260. package/agent-template/platform/scripts/build.mjs +38 -0
  261. package/agent-template/rulesync.jsonc +11 -0
  262. package/dist/bin.js +40 -2
  263. package/package.json +3 -2
  264. package/template/default/.prettierignore +9 -0
  265. package/template/default/README.md +12 -0
  266. package/template/default/flowdular.json +3 -3
  267. package/template/default/modules/example/package.json +2 -2
  268. package/template/default/package.json +6 -2
  269. package/template/default/platform/octane.config.ts +17 -6
  270. package/template/default/platform/package.json +3 -2
  271. package/template/default/pnpm-workspace.yaml +1 -0
@@ -0,0 +1,34 @@
1
+ /* Minimal view and widget so the contribution example resolves. A real screen
2
+ follows .ai/references/catalog/src/client/CatalogView.tsrx and the record-screen
3
+ recipe in .ai/skills/ux-design/SKILL.md. */
4
+ import { EmptyState, Kpi, PageHeader } from '@flowdular/sdk/ui';
5
+
6
+ export interface CustomerListViewProps {
7
+ readonly csrfToken: string;
8
+ }
9
+
10
+ export function CustomerListView(props: CustomerListViewProps) @{
11
+ void props.csrfToken;
12
+ <div class="ui-view">
13
+ <PageHeader
14
+ eyebrow="Master data"
15
+ title="Customers"
16
+ description="Customer records of the active tenant."
17
+ />
18
+ <section class="ui-card">
19
+ <EmptyState icon="parties" title="No customers yet">
20
+ Create the first customer.
21
+ </EmptyState>
22
+ </section>
23
+ </div>
24
+ }
25
+
26
+ export function CustomerDashboardWidget() @{
27
+ <Kpi
28
+ label="Customers"
29
+ value="0"
30
+ note="Customer records in this organization."
31
+ href="/customers"
32
+ linkLabel="Open customers"
33
+ />
34
+ }
@@ -0,0 +1,11 @@
1
+ # Client contribution example
2
+
3
+ Mirror of `.ai/references/catalog/src/client/{contribution.tsrx,index.ts}`, flattened into one directory. In a module the files live at `src/client/contribution.tsrx`, `src/client/index.ts`, `src/client/CustomerListView.tsrx`, and the permissions at `src/acl/permissions.ts`.
4
+
5
+ What it shows:
6
+
7
+ - `createClientContribution(context: ModuleClientContext)` in `index.ts` is the entry the generated composition imports (`packages/cli/src/module-sync.ts`); it threads `context.csrfToken` into the factory, which passes it to every view that mutates.
8
+ - `glyph: 'parties'` is a key of `ICON_PATHS` (`packages/ui/src/icons/Icon.tsrx`); an unknown key renders the `modules` icon silently.
9
+ - Ids: `customers.navigation`, view `customers` (the URL slug), widget `customers.dashboard.summary`; `slot` is one of `WORKSPACE_SLOTS`; `scope` is the module's read permission.
10
+
11
+ These files are not part of any `tsconfig.json` and are not compiled; `.ai/references/catalog` is the compiled reference.
@@ -0,0 +1,48 @@
1
+ /* Mirror of .ai/references/catalog/src/client/contribution.tsrx. In a module this file
2
+ is src/client/contribution.tsrx, the permissions come from
3
+ src/acl/permissions.ts, and the views from sibling .tsrx files. */
4
+ import type { ModuleClientContribution } from '@flowdular/sdk/client';
5
+ import { CUSTOMER_PERMISSIONS } from './permissions.ts';
6
+ import {
7
+ CustomerDashboardWidget,
8
+ CustomerListView,
9
+ } from './CustomerListView.tsrx';
10
+
11
+ export interface CustomerClientContributionOptions {
12
+ readonly csrfToken: string;
13
+ }
14
+
15
+ export function createCustomerClientContribution(
16
+ options: CustomerClientContributionOptions,
17
+ ): ModuleClientContribution {
18
+ return {
19
+ moduleId: 'customers.core',
20
+ navigation: [
21
+ {
22
+ id: 'customers.navigation',
23
+ viewId: 'customers',
24
+ group: 'Operations',
25
+ label: 'Customers',
26
+ glyph: 'parties',
27
+ description: 'Customer master data',
28
+ scope: CUSTOMER_PERMISSIONS.read,
29
+ order: 30,
30
+ },
31
+ ],
32
+ views: [
33
+ {
34
+ id: 'customers',
35
+ render: () => <CustomerListView csrfToken={options.csrfToken} />,
36
+ },
37
+ ],
38
+ widgets: [
39
+ {
40
+ id: 'customers.dashboard.summary',
41
+ slot: 'dashboard.metrics',
42
+ scope: CUSTOMER_PERMISSIONS.read,
43
+ order: 30,
44
+ render: () => <CustomerDashboardWidget />,
45
+ },
46
+ ],
47
+ };
48
+ }
@@ -0,0 +1,20 @@
1
+ /* Mirror of .ai/references/catalog/src/client/index.ts: the canonical entry the
2
+ generated composition imports as createClientContribution from
3
+ <package>/client. */
4
+ export { createCustomerClientContribution } from './contribution.tsrx';
5
+ export type { CustomerClientContributionOptions } from './contribution.tsrx';
6
+ export {
7
+ CustomerDashboardWidget,
8
+ CustomerListView,
9
+ } from './CustomerListView.tsrx';
10
+ import type {
11
+ ModuleClientContext,
12
+ ModuleClientContribution,
13
+ } from '@flowdular/sdk/client';
14
+ import { createCustomerClientContribution as canonicalContribution } from './contribution.tsrx';
15
+
16
+ export function createClientContribution(
17
+ context: ModuleClientContext,
18
+ ): ModuleClientContribution {
19
+ return canonicalContribution({ csrfToken: context.csrfToken });
20
+ }
@@ -0,0 +1,8 @@
1
+ /* In a module this is src/acl/permissions.ts. The strings equal
2
+ spec/module.yaml permissions[].id. */
3
+ export const CUSTOMER_PERMISSIONS = {
4
+ read: 'customers.records.read',
5
+ manage: 'customers.records.manage',
6
+ } as const;
7
+
8
+ export const permissions = Object.freeze(Object.values(CUSTOMER_PERMISSIONS));
@@ -0,0 +1,14 @@
1
+ # Module CLI extension example
2
+
3
+ `commands.json` is the catalog (`module.json` `cli.catalog`, validated against `packages/contracts/schemas/cli-extension.schema.json` without running code) and `index.ts` is the implementation (`cli.entry`, imported only when the command runs). The module manifest declares both:
4
+
5
+ ```json
6
+ {
7
+ "capabilities": ["api", "cli"],
8
+ "cli": { "catalog": "src/cli/commands.json", "entry": "src/cli/index.ts" }
9
+ }
10
+ ```
11
+
12
+ Rules from `packages/cli/src/extensions.ts`: the command path starts with the module namespace (`customer` for `customer.core`), the capability id starts with `customer.`, the module must be enabled in `flowdular.json`, and `path` plus the whole `capability` object must be identical in both files. `requiresApprovedSpec: true` means `pnpm flowdular customer export --spec modules/customer/spec/module.yaml` (and `--apply` to write). Full procedure: `.ai/skills/cli-extension/SKILL.md`. Real modules: `modules/auth/src/cli`, `modules/agents/src/cli`, `modules/sandbox/src/cli`.
13
+
14
+ Not compiled or tested here; `packages/cli/tests/extensions.test.ts` covers the catalog rules.
@@ -0,0 +1,17 @@
1
+ {
2
+ "protocolVersion": 1,
3
+ "moduleId": "customer.core",
4
+ "commands": [
5
+ {
6
+ "path": ["customer", "export"],
7
+ "capability": {
8
+ "id": "customer.export",
9
+ "version": 1,
10
+ "summary": "Export tenant-scoped customer records to an approved workspace path.",
11
+ "risk": "workspace-write",
12
+ "requiresApprovedSpec": true,
13
+ "supportsDryRun": true
14
+ }
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,36 @@
1
+ /* In a module this is src/cli/index.ts. Every field of `capability` and the
2
+ `path` must equal the entry in commands.json; packages/cli/src/extensions.ts
3
+ (loadCliCommand) refuses the command otherwise. */
4
+ import { defineCliExtension } from '@flowdular/sdk/cli-protocol';
5
+
6
+ export const cliExtension = defineCliExtension({
7
+ protocolVersion: 1,
8
+ moduleId: 'customer.core',
9
+ commands: [
10
+ {
11
+ path: ['customer', 'export'],
12
+ capability: {
13
+ id: 'customer.export',
14
+ version: 1,
15
+ summary:
16
+ 'Export tenant-scoped customer records to an approved workspace path.',
17
+ risk: 'workspace-write' as const,
18
+ requiresApprovedSpec: true,
19
+ supportsDryRun: true,
20
+ },
21
+ execute: ({ apply, arguments: arguments_, workspaceRoot }) => ({
22
+ data: {
23
+ applied: apply,
24
+ format: arguments_[0] ?? 'json',
25
+ target: `${workspaceRoot}/.flowdular/data/exports/customers.${arguments_[0] ?? 'json'}`,
26
+ },
27
+ evidence: ['modules/customer/spec/module.yaml'],
28
+ warnings: apply
29
+ ? []
30
+ : ['Dry run only. Pass --apply after reviewing the target.'],
31
+ }),
32
+ },
33
+ ],
34
+ });
35
+
36
+ export default cliExtension;
@@ -0,0 +1,11 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "taskId": "example-sales-orders",
4
+ "capability": "module.create",
5
+ "blueprint": "new-module@1.0.0",
6
+ "spec": "modules/sales-orders/spec/module.yaml",
7
+ "specStatus": "approved",
8
+ "allowedPaths": ["modules/sales-orders/**"],
9
+ "steps": ["dry-run", "apply", "implement acceptance scenarios", "run gates"],
10
+ "gates": ["module-schema", "spec-schema", "typecheck", "tests", "format"]
11
+ }
@@ -0,0 +1,97 @@
1
+ # Developing a generated application
2
+
3
+ Use this map when working in an application created by `create-flowdular`.
4
+ Choose one task skill from `.ai/skills/README.md` for the current phase. Read the
5
+ owning code and the relevant section below; do not preload every skill.
6
+
7
+ ## Establish the actual project layout
8
+
9
+ 1. Read root `package.json`, `flowdular.json` and the target module's
10
+ `package.json`, `module.json` and `spec/module.yaml`.
11
+ 2. Identify existing behavior, requested changes, permissions and affected
12
+ locales. A new module needs an explicitly approved specification before
13
+ implementation. Ask for missing business decisions before inventing fields,
14
+ roles, calculations or workflow transitions.
15
+ 3. Work in `modules/<directory>`. The starter is `modules/example`, with package
16
+ name `@app/module-example`; other modules may use another naming convention.
17
+ Never derive a pnpm package selector from an SDK import or module id.
18
+ 4. `platform/src/App.tsrx`, `platform/src/generated/**`, generated composition and
19
+ enabled-module dependencies are CLI-owned. Use `pnpm flowdular module sync
20
+ --apply` to regenerate composition after a declared contract change.
21
+ 5. Core modules and platform packages are installed under
22
+ `platform/node_modules/@flowdular/sdk`. Upstream paths in shared skills such
23
+ as `modules/auth` and `packages/server` refer to that read-only tree. Public
24
+ exports are listed in its `package.json`. Import them through
25
+ `@flowdular/sdk/server`, `@flowdular/sdk/client`, `@flowdular/sdk/ui`,
26
+ `@flowdular/sdk/database` and the relevant exported subpath. Never patch
27
+ installed source to deliver a feature. CLI and sandbox internals require an
28
+ upstream Flowdular change, not a new application-local copy.
29
+
30
+ ## Choose the smallest complete change
31
+
32
+ Paths below are relative to the module directory. Keep the approved spec and
33
+ manifest aligned. An implementation must include observable regression evidence.
34
+
35
+ | Requested change | Task skill | Owning files and completion evidence |
36
+ | ---------------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
37
+ | New module | `module-new` | Approved `spec/module.yaml`; run scaffold preview then apply; implement the remaining business behavior; validate, enable and grant explicitly |
38
+ | New entity field or endpoint | `module-update` | `src/domain`, `src/services`, `src/api/endpoints.ts`, client consumers and spec; reject invalid inputs and preserve existing behavior |
39
+ | New permission or protected action | `auth-security-review` | `src/acl/permissions.ts`, endpoint identity/permission, spec and UI availability; prove unauthenticated, denied and cross-tenant cases |
40
+ | Database table or column | `migration-authoring` | New immutable `migrations/*.sql`, matching `databaseMigrations`, repository mapping and spec; test fresh migration and tenant isolation |
41
+ | Persistence query | `database-adapter` | `src/services/database-repository.ts` and repository port; bound SQL and transactions using the authenticated tenant; exercise the real test provider |
42
+ | Screen, table or edit form | `ux-design` | `src/client/*View.tsrx`, `state.ts`, `api.ts`, `contribution.tsrx`; use shared UI, inspect loading/empty/error/populated/denied states and keyboard interaction |
43
+ | Navigation or translated copy | `translations-i18n` | `src/client/contribution.tsrx`, all configured `translations/*.json` and consumers; validate matching keys and plural forms |
44
+ | Workflow or automation | `workflow-development` | Module-owned workflow definition and invocation through public capabilities; test publication, execution, failures and permission boundaries |
45
+ | Agent tool | `agent-tool-design` | Tool registration, input/output contract, permission ceiling, idempotency and audit; test actual harness invocation and denial |
46
+ | Business agent | `business-agent-design` | Agent declaration, public tools and tenant-bound provider; test allowed and forbidden behavior, revisions and cleanup |
47
+ | Module CLI command | `cli-extension` | `src/cli/commands.json`, handler, module export and manifest; test dry run, authorization and applied effects |
48
+ | Defect or failed check | `bug-hunt` | First reproduce at the owning layer, then fix and rerun the failing test; inspect sibling paths |
49
+ | Final delivery | `auto-review` | Review the whole diff against requirements and executable evidence; report unresolved findings and actual check results |
50
+
51
+ For a multi-part feature, finish each bounded implementation phase, then select
52
+ the next skill. In sandbox sessions, follow the assigned role's write paths and
53
+ handoff list. A backend role must hand a client fix to the frontend role; a failed
54
+ gate does not expand its authority. Direct coding agents still keep module
55
+ boundaries and preserve other contributors' changes.
56
+
57
+ ## Verification in this application
58
+
59
+ For the example module, run:
60
+
61
+ ```sh
62
+ pnpm --filter @app/module-example typecheck
63
+ pnpm --filter @app/module-example test
64
+ pnpm flowdular module validate
65
+ pnpm verify
66
+ pnpm build
67
+ ```
68
+
69
+ For another module substitute its actual package name. A green command with no
70
+ tests is not evidence. Test public behavior, input bounds, permission denial and
71
+ tenant isolation. Database tests use isolated embedded PostgreSQL or the
72
+ configured test provider, never the application's local demo or hosted database.
73
+ Do not claim a hosted PostgreSQL check ran when only embedded tests ran.
74
+
75
+ `pnpm build` uses isolated temporary state and ephemeral build keys. `pnpm
76
+ flowdular setup` configures the application. Local demo reset requires stopping
77
+ the application and must never target a deployed database.
78
+
79
+ Inspect rendered UI after changing a screen. Run the `auto-review` skill as a
80
+ separate phase after implementation. Report changed behavior, checks actually
81
+ run, remaining failures and any required operator action. Commit/push or open a
82
+ PR only within the user's authorization; agent changes do not grant themselves
83
+ spec approval or production access.
84
+
85
+ ## Maintain the agent guidance
86
+
87
+ Edit `.ai/rules` and `.ai/skills`, then run `pnpm rules:generate` and
88
+ `pnpm rules:check`. Codex reads `AGENTS.md` and `.agents/skills`; Claude Code reads
89
+ `CLAUDE.md` and `.claude/skills`. Keep generated copies synchronized. `.ai/agents`
90
+ contains reusable role instructions; `.ai/blueprints` and `.ai/policies` are
91
+ project-local inputs referenced by `flowdular.json`.
92
+
93
+ Split a skill when it contains independent procedures with different owning
94
+ files, write scopes or verification commands. Keep shared requirements in the
95
+ rules and concrete recipes in the task skill. Each recipe should state its
96
+ trigger, inputs, touch list, ordered steps, failure cases and completion checks.
97
+ Do not add a skill that only renames an existing procedure.
@@ -0,0 +1,164 @@
1
+ schemaVersion: 1
2
+ # What the CLI actually exposes and how the runner gates it. Consumed by nobody:
3
+ # packages/cli/src/doctor.ts only checks that this file exists
4
+ # (policy.capabilities). The real policy is code: core descriptors in
5
+ # packages/cli/src/capabilities.ts, module descriptors in each
6
+ # modules/*/src/cli/commands.json, approval logic in packages/cli/src/runner.ts
7
+ # (runExtensionCommand). Keep this file in step with those three places.
8
+ default: deny
9
+
10
+ # packages/cli/src/capabilities.ts
11
+ core:
12
+ module.search:
13
+ command: pnpm flowdular module search [query]
14
+ risk: read
15
+ note: host-only official HTTPS catalog lookup; does not grant sandbox network access
16
+ module.info:
17
+ command: pnpm flowdular module info <id>
18
+ risk: read
19
+ module.install:
20
+ command: pnpm flowdular module install <id[@version]> [--apply]
21
+ risk: workspace-write
22
+ supportsDryRun: true
23
+ note: host-only source installation; no scripts, activation, permissions or database changes
24
+ module.update:
25
+ command: pnpm flowdular module update <id[@version]> [--apply]
26
+ risk: workspace-write
27
+ supportsDryRun: true
28
+ note: rejects local edits, changed historical migrations and downgrades
29
+ module.recover:
30
+ command: pnpm flowdular module recover [--apply]
31
+ risk: workspace-write
32
+ supportsDryRun: true
33
+ note: requires the original installation process to have exited
34
+ workspace.doctor:
35
+ command: pnpm flowdular doctor
36
+ risk: read
37
+ spec.validate:
38
+ command: pnpm flowdular spec validate --all
39
+ risk: read
40
+ blueprint.validate:
41
+ command: pnpm flowdular blueprint validate --all
42
+ risk: read
43
+ note: validates every .ai/blueprints/*/blueprint.json and checks the companion files exist
44
+ module.validate:
45
+ command: pnpm flowdular module validate
46
+ risk: read
47
+ note: 'schema plus composition entries (PLATFORM_SERVER_ENTRY_MISSING, PLATFORM_EXPORT_MISSING, PLATFORM_CLIENT_ENTRY_MISSING, PLATFORM_CLIENT_EXPORT_MISSING), PACKAGE_NAME_MISMATCH, SPEC_ID_MISMATCH, TRANSLATION_FILE_MISSING, TRANSLATION_KEYS_MISMATCH; warnings SPEC_VERSION_DRIFT, LOCALE_NOT_IN_PROJECT (packages/cli/src/module-validate.ts)'
48
+ module.create:
49
+ command: pnpm flowdular module new <id> --spec <path> [--apply]
50
+ risk: workspace-write
51
+ requiresApprovedSpec: true
52
+ supportsDryRun: true
53
+ migration.status:
54
+ command: pnpm flowdular migration status [--module <id>] [--json]
55
+ risk: read
56
+ note: 'per module database, each migration is applied, adopted (its objects already exist, so the runner will only record it), pending, or mismatch; fails with MIGRATION_CHECKSUM_MISMATCH when an applied migration was edited (packages/cli/src/migration.ts)'
57
+ migration.verify:
58
+ command: pnpm flowdular migration verify
59
+ risk: read
60
+ note: 'checks every ledger row against the checksum of the migration in the workspace; failure code MIGRATION_LEDGER_INVALID with mismatched and unknown ids per module'
61
+ migration.apply.local:
62
+ command: pnpm flowdular migration apply --module <id> [--apply]
63
+ risk: process
64
+ localOnly: true
65
+ supportsDryRun: true
66
+ effect: applies or adopts the outstanding migrations of one module against the configured PostgreSQL (embedded PGlite outside production) and writes the _coreloom_migrations_v2 ledger; without --apply it reports the plan and writes nothing
67
+ workspace.state.migrate:
68
+ command: pnpm flowdular setup migrate-state [--apply --confirm migrate-legacy-state]
69
+ risk: destructive
70
+ localOnly: true
71
+ confirmation: migrate-legacy-state
72
+ supportsDryRun: true
73
+ effect: copies recognized pre-Flowdular databases and vault keys into .flowdular/data, verifies their hashes, and preserves every source file; refuses links, collisions, and database sidecar files
74
+
75
+ # Commands dispatched by packages/cli/src/runner.ts without a capability descriptor.
76
+ commandsWithoutDescriptor:
77
+ - pnpm flowdular help
78
+ - pnpm flowdular capability list|describe <id>|run <id>
79
+ - pnpm flowdular blueprint list
80
+ - pnpm flowdular module list
81
+ - pnpm flowdular module sync [--apply]
82
+ - pnpm flowdular module enable <id> [--apply] (with --apply also runs auth.scopes.sync; result field scopes, failure code MODULE_SCOPES_SYNC_FAILED)
83
+ - pnpm flowdular module disable <id> [--apply]
84
+ - pnpm flowdular setup check
85
+ - pnpm flowdular setup quick (alias of auth.greenfield.reset)
86
+
87
+ # modules/*/src/cli/commands.json, loaded only for modules enabled in flowdular.json
88
+ modules:
89
+ auth.core:
90
+ auth.scopes.list:
91
+ command: pnpm flowdular auth scopes
92
+ risk: read
93
+ auth.scopes.sync:
94
+ command: pnpm flowdular auth sync-scopes --module <id> [--apply]
95
+ risk: process
96
+ supportsDryRun: true
97
+ effect: grants the module spec permissions to every tenant owner in the auth database
98
+ auth.greenfield.reset:
99
+ command: pnpm flowdular auth greenfield --apply --confirm reset-local-auth
100
+ risk: destructive
101
+ localOnly: true
102
+ confirmation: reset-local-auth
103
+ supportsDryRun: true
104
+ effect: resets .flowdular/data/auth.db and seeds demo tenants and accounts
105
+ agents.core:
106
+ agents.status:
107
+ command: pnpm flowdular agents status
108
+ risk: read
109
+ agents.audit.verify:
110
+ command: pnpm flowdular agents audit-verify --tenant <id>
111
+ risk: read
112
+ localOnly: true
113
+ sandbox.core:
114
+ sandbox.access.list:
115
+ command: pnpm flowdular sandbox access
116
+ risk: read
117
+ sandbox.access.grant:
118
+ command: pnpm flowdular sandbox grant [--apply]
119
+ risk: process
120
+ supportsDryRun: true
121
+ sandbox.access.revoke:
122
+ command: pnpm flowdular sandbox revoke [--apply]
123
+ risk: process
124
+ supportsDryRun: true
125
+ sandbox.sessions.list:
126
+ command: pnpm flowdular sandbox sessions
127
+ risk: read
128
+ sandbox.sessions.archive:
129
+ command: pnpm flowdular sandbox session-archive [--apply]
130
+ risk: process
131
+ supportsDryRun: true
132
+ sandbox.sessions.delete:
133
+ command: pnpm flowdular sandbox session-delete [--apply]
134
+ risk: process
135
+ supportsDryRun: true
136
+ sandbox.audit.verify:
137
+ command: pnpm flowdular sandbox audit-verify --tenant <id>
138
+ risk: read
139
+ localOnly: true
140
+
141
+ # packages/cli/src/runner.ts, runExtensionCommand, in evaluation order.
142
+ approvals:
143
+ external: refused with APPROVAL_VERIFIER_REQUIRED (no signed approval verifier exists)
144
+ destructive-not-local: refused with APPROVAL_VERIFIER_REQUIRED
145
+ localOnly: refused with LOCAL_ONLY_CAPABILITY unless FD_ENV or NODE_ENV is development or test (unset counts as development)
146
+ requiresApprovedSpec: needs --spec <path>; APPROVED_SPEC_REQUIRED, SPEC_VALIDATION_FAILED or SPEC_NOT_APPROVED otherwise
147
+ destructive-apply: --apply needs --confirm <descriptor.confirmation>; CONFIRMATION_REQUIRED otherwise
148
+ non-read-without-dry-run: EXPLICIT_APPLY_REQUIRED without --apply
149
+ dry-run: non-read with supportsDryRun and no --apply runs with apply=false and warns "Dry run only. No writes were authorized."
150
+
151
+ moduleExtensions:
152
+ discovery: module.json cli.catalog (src/cli/commands.json), schema-validated without executing code
153
+ loadImplementation: module.json cli.entry imported only when the command runs (packages/cli/src/extensions.ts loadCliCommand)
154
+ namespace: first segment of the module id; reserved groups help, doctor, capability, spec, blueprint, module, migration, setup
155
+ metadataIdentical: path and capability object must equal the catalog entry
156
+ requireEnabledModule: true
157
+
158
+ # Planned, no code today. Listed so nobody documents them as available.
159
+ planned:
160
+ - migration.plan (served by "migration apply" without --apply, which is a read-only dry run)
161
+ - migration.apply.remote
162
+ - destructive.execute (signed approval receipts)
163
+ - redaction of *_TOKEN, *_SECRET, *_PASSWORD, DATABASE_URL in a shared logger (only packages/ai-provider/src/errors.ts redactSecrets exists)
164
+ - persisted CLI audit (CommandEnvelope carries a random auditId and evidence per invocation; nothing stores it)
@@ -0,0 +1,72 @@
1
+ schemaVersion: 1
2
+ # Consumed by nobody: packages/cli/src/doctor.ts checks that the file exists
3
+ # (policy.model-routing). The sandbox decides drivers, models and roles in code:
4
+ # - driver per session, changeable per turn (packages/sandbox/src/server/routes.ts)
5
+ # - model from the session (session.model) or the driver default
6
+ # (packages/sandbox/src/server/turns.ts, packages/coding-agent/src/drivers/*)
7
+ # - role per turn by deterministic rules (packages/sandbox/src/server/planning.ts
8
+ # routeRole, planHandoff), overridable for one turn in the composer
9
+ # This file documents that behaviour so nobody expects a policy engine.
10
+
11
+ drivers:
12
+ claude-code:
13
+ binary: claude
14
+ modes: [loopback]
15
+ tools: [Read, Write, Edit, Glob, Grep]
16
+ commands: never (no Bash tool; gates run by the sandbox)
17
+ source: packages/coding-agent/src/drivers/claude-code.ts
18
+ codex:
19
+ binary: codex
20
+ modes: [loopback]
21
+ sandbox: workspace-write
22
+ commands: possible inside the workspace; the role contract forbids it but only the sandbox filesystem boundary enforces it
23
+ source: packages/coding-agent/src/drivers/codex.ts
24
+ byok:
25
+ modes: [loopback, self-hosted]
26
+ kinds: [anthropic, openai, azure, openai-compatible, vercel]
27
+ tools: sandbox-owned file tools (list 400 files, read 128 KB per file)
28
+ commands: never
29
+ source: packages/coding-agent/src/drivers/byok.ts, packages/ai-provider/src/catalog.ts
30
+
31
+ # Profiles referenced by .ai/blueprints/*/blueprint.json executorProfiles.
32
+ profiles:
33
+ sandbox-specialist:
34
+ runs: one of the five roles in .ai/agents/sandbox on the session driver
35
+ mayApproveSpecs: false
36
+ mayChangeArchitecture: false
37
+ mayRunCommands: false
38
+ landing: eject
39
+ repo-agent:
40
+ runs: .ai/agents/module-executor.md or spec-author.md in a checkout with a shell (RuleSync generates each driver's root instructions from .ai/rules)
41
+ mayApproveSpecs: false
42
+ mayChangeArchitecture: only through core-extend with an ADR
43
+ mayRunCommands: true
44
+ landing: pnpm verify, pull request
45
+ reviewer:
46
+ runs: .ai/agents/reviewer.md
47
+ mayImplement: false
48
+ output: findings by severity, verdict
49
+
50
+ # Who takes the first sandbox turn (planning.ts classifyByRules) and how the
51
+ # next role is chosen (planHandoff): the HANDOFF line when it names a
52
+ # registered role, otherwise routeRole by module state, and a failed gate
53
+ # always returns to the same role.
54
+ routing:
55
+ new-module: business-manager
56
+ edit-module: business-manager
57
+ spec-words: business-manager
58
+ agent-words: agentic-engineer
59
+ ui-words: frontend-engineer when src/client/contribution.tsrx exists, else ux-designer
60
+ no-server: backend-engineer
61
+ no-client: frontend-engineer
62
+ default: backend-engineer
63
+
64
+ enforced:
65
+ - gates listed in a role's front matter plus dependencies, per draft module (turns.ts runSessionGates)
66
+ - HANDOFF line parsing (packages/coding-agent/src/roles/handoff.ts) and the role's handoff list (planning.ts; self-handoff and roles outside the list fall back to state routing)
67
+ - approval stop for every new or edited module until the current specification matches the operator-approved SHA-256 hash
68
+ - writes outside the active role allowedPaths are quarantined and restored before gates, checkpoints, preview or delivery
69
+ - message length 1 to 20000 characters, brief at least 8 characters
70
+ - at most four chained automatic turns per operator message (session chainDepth)
71
+ notEnforced:
72
+ - model choice per role (one model per session)
@@ -0,0 +1,65 @@
1
+ schemaVersion: 1
2
+ # Consumed by nobody (zero references under packages/). Review guidance: who
3
+ # answers for a path and which role may write it.
4
+ owners:
5
+ packages/contracts/**: platform-architecture
6
+ packages/kernel/**: platform-architecture
7
+ packages/server/**: platform-runtime
8
+ packages/client/**: platform-ui
9
+ packages/ui/**: platform-ui
10
+ packages/dev-console/**: platform-ui
11
+ packages/cli/**: platform-tooling
12
+ packages/cli-protocol/**: platform-tooling
13
+ packages/sandbox/**: sandbox-runtime
14
+ packages/coding-agent/**: sandbox-runtime
15
+ packages/ai-provider/**: agent-runtime
16
+ packages/harness/**: agent-runtime
17
+ modules/auth/**: platform-runtime
18
+ modules/system/**: platform-architecture
19
+ modules/users/**: platform-runtime
20
+ modules/agents/**: agent-runtime
21
+ modules/sandbox/**: sandbox-runtime
22
+ modules/{module}/**: module:{module}
23
+ platform/**: platform-composition
24
+ infra/**: platform-operations
25
+ .github/**: platform-operations
26
+ docs/**: platform-architecture
27
+ specs/**: platform-architecture
28
+ .ai/**: platform-architecture
29
+ rulesync.jsonc: platform-architecture
30
+ AGENTS.md: generated
31
+ CLAUDE.md: generated
32
+ .agents/skills/**: generated
33
+ .claude/skills/**: generated
34
+ # Inside a module built or changed in the sandbox, the role front matter in
35
+ # .ai/agents/sandbox/*.md says who writes what. Advisory at run time.
36
+ moduleRoles:
37
+ modules/{module}/spec/**: [business-manager, agentic-engineer]
38
+ modules/{module}/translations/**: [business-manager]
39
+ modules/{module}/src/acl/**: [backend-engineer]
40
+ modules/{module}/src/api/**: [backend-engineer]
41
+ modules/{module}/src/server/**: [backend-engineer]
42
+ modules/{module}/src/services/**: [backend-engineer]
43
+ modules/{module}/src/domain/**: [backend-engineer]
44
+ modules/{module}/src/platform.ts: [backend-engineer, agentic-engineer]
45
+ modules/{module}/src/index.ts: [backend-engineer]
46
+ modules/{module}/migrations/**: [backend-engineer]
47
+ modules/{module}/src/client/**: [ux-designer, frontend-engineer]
48
+ modules/{module}/src/agent/**: [agentic-engineer]
49
+ modules/{module}/tests/**:
50
+ [backend-engineer, frontend-engineer, agentic-engineer]
51
+ modules/{module}/module.json: [backend-engineer, agentic-engineer]
52
+ modules/{module}/package.json:
53
+ [backend-engineer, frontend-engineer, agentic-engineer]
54
+ cliOwned:
55
+ flowdular.json: pnpm flowdular module enable|disable --apply
56
+ platform/package.json: pnpm flowdular module enable --apply
57
+ platform/src/generated/**: pnpm flowdular module sync --apply
58
+ packages/coding-agent/src/roles/defaults.ts: role defaults sync script (.ai/README.md)
59
+ packages/ui/src/brand/mark.ts: node packages/ui/scripts/gen-mark.mjs
60
+ AGENTS.md: pnpm rules:generate
61
+ CLAUDE.md: pnpm rules:generate
62
+ .agents/skills/**: pnpm rules:generate
63
+ .claude/skills/**: pnpm rules:generate
64
+ crossOwnerChanges:
65
+ requireReviewer: true
@@ -0,0 +1,37 @@
1
+ schemaVersion: 1
2
+ # Consumed by nobody (zero references under packages/). The values are the
3
+ # review expectation for a change; the sandbox enforces only the limits marked
4
+ # as code.
5
+ defaults:
6
+ maxChangedFiles: 18
7
+ maxRepairLoops: 2
8
+ maxNewDependencies: 0
9
+ requireTests: true
10
+ requireTypecheck: true
11
+ overrides:
12
+ new-module:
13
+ maxChangedFiles: 30
14
+ maxNewDependencies: 0
15
+ note: a full module is about 25 files (.ai/references/catalog has 28 including migrations and translations)
16
+ edit-module:
17
+ maxChangedFiles: 12
18
+ add-migration:
19
+ maxChangedFiles: 8
20
+ bug-fix:
21
+ maxChangedFiles: 4
22
+ requireTests: true
23
+ author-spec:
24
+ maxChangedFiles: 1
25
+ requireTests: false
26
+ core-extend:
27
+ maxChangedFiles: 40
28
+ note: consumers migrate in the same change; count them
29
+ sandbox:
30
+ code:
31
+ messageLength: 1 to 20000 characters (packages/sandbox/src/server/turns.ts)
32
+ briefLength: at least 8 characters (planning.ts assertBrief)
33
+ gateTimeout: 5 minutes per gate, output capped at 12000 characters (gates.ts)
34
+ gateFailure: the same role repairs; no automatic limit on repair turns
35
+ byokReads: 400 listed files, 128 KB per read (packages/coding-agent/src/drivers/byok.ts)
36
+ review:
37
+ chainedTurns: stop and read the transcript after four automatic handoffs on one brief