create-flowdular 0.2.4 → 0.2.5

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 (269) 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 +3 -1
  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/package.json +6 -2
  268. package/template/default/platform/octane.config.ts +17 -6
  269. package/template/default/platform/package.json +2 -1
@@ -0,0 +1,30 @@
1
+ schemaVersion: 1
2
+ # Ids equal GateId in packages/sandbox/src/server/gates.ts. The sandbox runs the
3
+ # gates a role lists in its front matter after every turn that changed files;
4
+ # from the repository root run the command column yourself. Nothing executes
5
+ # this file; it documents the contract.
6
+ gates:
7
+ - id: spec-schema
8
+ command: pnpm flowdular spec validate --all --json
9
+ sandbox: pnpm flowdular spec validate --all --json --root <session workspace>
10
+ required: true
11
+ - id: module-schema
12
+ command: pnpm flowdular module validate --json
13
+ sandbox: pnpm flowdular module validate --json --root <session workspace>
14
+ required: true
15
+ - id: dependencies
16
+ command: 'grep the imports under src/** and compare with package.json dependencies (no CLI command yet)'
17
+ sandbox: checkDeclaredDependencies(modulePath) in packages/sandbox/src/server/dependencies.ts, run after every turn that changed files, plus a pnpm install when a package.json changed
18
+ required: true
19
+ - id: typecheck
20
+ command: pnpm --filter @flowdular/module-{module} typecheck
21
+ sandbox: node_modules/.bin/tsrx-tsc --noEmit -p tsconfig.json (cwd module)
22
+ required: true
23
+ - id: tests
24
+ command: pnpm --filter @flowdular/module-{module} test
25
+ sandbox: node_modules/.bin/vitest run --passWithNoTests (cwd module; zero tests still pass)
26
+ required: true
27
+ - id: format
28
+ command: pnpm format:check
29
+ sandbox: prettier --check . (cwd module)
30
+ required: true
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "required": ["moduleId", "change", "name", "destructive"],
6
+ "properties": {
7
+ "moduleId": {
8
+ "type": "string",
9
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$"
10
+ },
11
+ "change": {
12
+ "type": "string",
13
+ "enum": ["table", "column", "index", "constraint"]
14
+ },
15
+ "name": {
16
+ "type": "string",
17
+ "pattern": "^[a-z][a-z0-9_]*$"
18
+ },
19
+ "destructive": {
20
+ "const": false
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "required": [
6
+ "blueprint",
7
+ "moduleId",
8
+ "constant",
9
+ "upFile",
10
+ "downFile",
11
+ "guarded",
12
+ "gates"
13
+ ],
14
+ "properties": {
15
+ "blueprint": {
16
+ "const": "add-migration@1.0.0"
17
+ },
18
+ "moduleId": {
19
+ "type": "string",
20
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$"
21
+ },
22
+ "constant": {
23
+ "type": "string",
24
+ "pattern": "^[A-Z][A-Z0-9_]*_MIGRATION_[0-9]{3}[A-Z0-9_]*$"
25
+ },
26
+ "upFile": {
27
+ "type": "string",
28
+ "pattern": "^migrations/[0-9]{4}_[a-z0-9_]+\\.up\\.sql$"
29
+ },
30
+ "downFile": {
31
+ "type": "string",
32
+ "pattern": "^migrations/[0-9]{4}_[a-z0-9_]+\\.down\\.sql$"
33
+ },
34
+ "guarded": {
35
+ "type": "boolean"
36
+ },
37
+ "gates": {
38
+ "type": "array",
39
+ "minItems": 1,
40
+ "items": {
41
+ "type": "string",
42
+ "enum": [
43
+ "spec-schema",
44
+ "module-schema",
45
+ "dependencies",
46
+ "typecheck",
47
+ "tests",
48
+ "format"
49
+ ]
50
+ },
51
+ "uniqueItems": true
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,18 @@
1
+ schemaVersion: 1
2
+ required:
3
+ - src/services/migration.ts (new byte-identical constant and ordered migrations entry appended; old constants untouched)
4
+ - src/services/database-repository.ts (row interface, fromRow, statement lists; migrations still run from the runtime migration lease)
5
+ - migrations/000N_{module}_{name}.up.sql
6
+ - migrations/000N_{module}_{name}.down.sql
7
+ - tests/migrations.test.ts (byte parity, fresh apply, pre-ledger adoption, second start)
8
+ - tests/module.test.ts (the createPgliteTestProvider() fixture proves the new data rule and tenant isolation)
9
+ - spec/module.yaml (invariant, specVersion)
10
+ rules:
11
+ - PostgreSQL only; CREATE TABLE IF NOT EXISTS
12
+ - tenant_id TEXT NOT NULL on tenant-owned tables
13
+ - UNIQUE and indexes start with tenant_id, indexes end with id
14
+ - a new tenant table enables and forces row-level security and adds a <table>_tenant_policy on current_setting('coreloom.tenant_id', true)
15
+ - ALTER TABLE ADD COLUMN runs once through the ledger; inspectExisting detects an existing column
16
+ - applied migration bytes are immutable; a change always gets a new number
17
+ - inspectExisting returns complete only for every effect, absent only for none, partial for anything mixed
18
+ - numbering 0001, 0002, ... per module, append-only
@@ -0,0 +1,13 @@
1
+ schemaVersion: 1
2
+ status:
3
+ allowed:
4
+ - approved
5
+ requiredKeys:
6
+ - dataOwnership
7
+ - invariants
8
+ capabilities:
9
+ mustInclude:
10
+ - database
11
+ onChange:
12
+ invariants: one sentence per new uniqueness, range or tenancy rule
13
+ specVersion: minor bump
@@ -0,0 +1,62 @@
1
+ schemaVersion: 1
2
+ steps:
3
+ - id: design
4
+ role: backend-engineer
5
+ action: Name the table or column, its type, CHECK, default and index; confirm the change is additive.
6
+ inputs:
7
+ - 'spec/module.yaml'
8
+ outputs:
9
+ - 'SQL draft'
10
+ - id: sql
11
+ role: backend-engineer
12
+ action: Write migrations/000N_{module}_{name}.up.sql first as one additive unit and .down.sql as documentation of the reverse; never edit an existing migration.
13
+ inputs:
14
+ - 'SQL draft'
15
+ outputs:
16
+ - 'migrations/000N_*.up.sql'
17
+ - 'migrations/000N_*.down.sql'
18
+ - id: mirror
19
+ role: backend-engineer
20
+ action: Append X_MIGRATION_00N to src/services/migration.ts with bytes identical to the .up.sql file and append its ordered { id, sql, inspectExisting } entry to databaseMigrations, with sql.postgresql set to the constant and inspectExisting built from postgresTenantTableState. Migrations run from the runtime migration lease, never from the repository.
21
+ inputs:
22
+ - 'migrations/000N_*.up.sql'
23
+ outputs:
24
+ - 'src/services/migration.ts'
25
+ - id: plumb
26
+ role: backend-engineer
27
+ action: Extend the row interface, fromRow, INSERT and SELECT lists, domain type, service validation and endpoint parsing.
28
+ inputs:
29
+ - 'SQL draft'
30
+ outputs:
31
+ - 'src/services/database-repository.ts'
32
+ - 'src/domain/types.ts'
33
+ - 'src/services/*-service.ts'
34
+ - 'src/api/endpoints.ts'
35
+ gates:
36
+ - 'typecheck'
37
+ - 'tests'
38
+ - 'format'
39
+ - id: prove
40
+ role: backend-engineer
41
+ action: Add migration tests proving SQL byte parity, fresh apply, safe adoption of a populated pre-ledger schema, and a clean second start. Add module tests for the new rule and tenant isolation; inspect migration status against a copy of the existing database before applying.
42
+ inputs:
43
+ - 'migrations/000N_*.up.sql'
44
+ outputs:
45
+ - 'tests/migrations.test.ts'
46
+ - 'tests/module.test.ts'
47
+ gates:
48
+ - 'tests'
49
+ - id: land
50
+ role: orchestrator
51
+ action: 'Sandbox: eject. Direct path: flowdular migration verify, pnpm verify, then a pull request stating that the schema applies on next boot.'
52
+ inputs:
53
+ - 'diff'
54
+ outputs:
55
+ - 'pull request'
56
+ gates:
57
+ - 'spec-schema'
58
+ - 'module-schema'
59
+ - 'dependencies'
60
+ - 'typecheck'
61
+ - 'tests'
62
+ - 'format'
@@ -0,0 +1,5 @@
1
+ # author-spec
2
+
3
+ Turn an agreed business request into `modules/<dir>/spec/module.yaml`. In the sandbox this is the first turn of a `new-module` session, taken by `business-manager`; at the repository root it is `spec-author` following `.ai/agents/spec-author.md`. The blueprint creates or revises the specification only. It never creates implementation files and never sets `status: approved`; approval belongs to a human owner (the sandbox approve button, or an edit in the pull request).
4
+
5
+ The result must validate against `packages/contracts/schemas/module-spec.schema.json` (`pnpm flowdular spec validate --all --json`) and be decision complete: permissions with one read and one manage id per entity, invariants for tenancy and uniqueness, data ownership, and acceptance scenarios that include a denial and a tenant isolation case. Unknown business decisions stay explicit questions in the handoff, never guesses. `templates/module.yaml` is a starting point with the keys the schema knows; `.ai/agents/sandbox/business-manager.md` carries a complete minimal example.
@@ -0,0 +1,7 @@
1
+ schemaVersion: 1
2
+ write:
3
+ - modules/{module}/spec/**
4
+ deny:
5
+ - modules/{module}/src/**
6
+ - modules/{module}/migrations/**
7
+ - .ai/**
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "../../../packages/contracts/schemas/blueprint.schema.json",
3
+ "schemaVersion": 1,
4
+ "id": "author-spec",
5
+ "version": "1.0.0",
6
+ "architecture": "0.2.0",
7
+ "risk": "workspace-write",
8
+ "owner": "platform-architecture",
9
+ "agentRoles": ["business-manager", "spec-author"],
10
+ "executorProfiles": ["sandbox-specialist", "repo-agent"],
11
+ "requiredReviewers": ["business-owner", "platform-owner"],
12
+ "requiresApprovedSpec": false,
13
+ "status": "approved"
14
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "moduleId": "sales.orders",
3
+ "businessOutcome": "Orders",
4
+ "actors": []
5
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "moduleId": "sales.orders",
3
+ "businessOutcome": "Let sales operators capture and confirm tenant-scoped customer orders.",
4
+ "actors": ["sales-operator", "sales-manager"],
5
+ "constraints": ["Every order belongs to exactly one tenant."]
6
+ }
@@ -0,0 +1,13 @@
1
+ schemaVersion: 1
2
+ # Nothing executes this file; it documents the contract.
3
+ gates:
4
+ - id: spec-schema
5
+ command: pnpm flowdular spec validate --all --json
6
+ sandbox: pnpm flowdular spec validate --all --json --root <session workspace>
7
+ required: true
8
+ - id: unresolved-decisions
9
+ assertion: the handoff lists zero open business questions
10
+ required: true
11
+ - id: human-approval
12
+ assertion: status is draft or in-review; an agent never wrote approved
13
+ required: true
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "required": ["moduleId", "businessOutcome", "actors"],
6
+ "properties": {
7
+ "moduleId": {
8
+ "type": "string",
9
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$"
10
+ },
11
+ "businessOutcome": { "type": "string", "minLength": 20 },
12
+ "actors": {
13
+ "type": "array",
14
+ "minItems": 1,
15
+ "items": { "type": "string", "minLength": 1 },
16
+ "uniqueItems": true
17
+ },
18
+ "constraints": { "type": "array", "items": { "type": "string" } }
19
+ }
20
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "required": ["specPath", "openQuestions", "acceptanceScenarioCount"],
6
+ "properties": {
7
+ "specPath": {
8
+ "type": "string",
9
+ "pattern": "^modules/[a-z0-9-]+/spec/module\\.yaml$"
10
+ },
11
+ "openQuestions": { "type": "array", "items": { "type": "string" } },
12
+ "acceptanceScenarioCount": { "type": "integer", "minimum": 1 }
13
+ }
14
+ }
@@ -0,0 +1,6 @@
1
+ schemaVersion: 1
2
+ create:
3
+ - modules/{module}/spec/module.yaml
4
+ forbid:
5
+ - modules/{module}/src/**
6
+ - modules/{module}/module.json
@@ -0,0 +1,35 @@
1
+ schemaVersion: 1
2
+ # Keys below exist in packages/contracts/schemas/module-spec.schema.json.
3
+ status:
4
+ initial: draft
5
+ allowed:
6
+ - draft
7
+ - in-review
8
+ agentMayApprove: false
9
+ requiredKeys:
10
+ - schemaVersion
11
+ - id
12
+ - specVersion
13
+ - status
14
+ - name
15
+ - description
16
+ - profile
17
+ - capabilities
18
+ - dependencies
19
+ - tenancy
20
+ - locales
21
+ - invariants
22
+ - permissions
23
+ - dataOwnership
24
+ - acceptanceScenarios
25
+ identifiers:
26
+ id: ^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$
27
+ permissions: <module>.<entity>.read and <module>.<entity>.manage
28
+ acceptanceScenarios: ^[A-Z][A-Z0-9-]+$
29
+ acceptanceScenarios:
30
+ minimum: 3
31
+ mustInclude:
32
+ - denial
33
+ - tenant isolation
34
+ openQuestions:
35
+ policy: stay in the handoff message; never guessed into the file
@@ -0,0 +1,28 @@
1
+ schemaVersion: 1
2
+ steps:
3
+ - id: collect
4
+ role: business-manager
5
+ action: Validate the brief against input.schema.json (module id, outcome, actors); list the business facts still missing.
6
+ inputs: [brief]
7
+ outputs: [open questions]
8
+ - id: ask
9
+ role: business-manager
10
+ action: Stop and ask for every unresolved business or security decision instead of guessing.
11
+ inputs: [open questions]
12
+ outputs: [answers]
13
+ - id: draft
14
+ role: business-manager
15
+ action: Write spec/module.yaml from templates/module.yaml with status draft; permissions, invariants, dataOwnership, acceptanceScenarios complete.
16
+ inputs: [answers]
17
+ outputs: [spec/module.yaml]
18
+ gates: [spec-schema]
19
+ - id: validate
20
+ role: orchestrator
21
+ action: pnpm flowdular spec validate --all --json (the sandbox spec-schema gate).
22
+ inputs: [spec/module.yaml]
23
+ outputs: [gate evidence]
24
+ - id: handoff
25
+ role: business-manager
26
+ action: Leave status as draft or in-review; end with HANDOFF to backend-engineer (or ux-designer for a ui profile) and let the operator approve.
27
+ inputs: [spec/module.yaml]
28
+ outputs: [handoff line]
@@ -0,0 +1,45 @@
1
+ # Replace every {placeholder}. Keys are the ones module-spec.schema.json knows;
2
+ # nothing else is accepted. Keep status: draft; a human approves.
3
+ schemaVersion: 1
4
+ id: '{moduleId}'
5
+ specVersion: 0.1.0
6
+ status: draft
7
+ name: '{name}'
8
+ description: '{businessOutcome}'
9
+ profile: full
10
+ capabilities:
11
+ - api
12
+ - database
13
+ - client
14
+ - translations
15
+ dependencies:
16
+ - id: system.core
17
+ range: ^0.1.0
18
+ - id: auth.core
19
+ range: ^0.1.0
20
+ tenancy: required
21
+ locales:
22
+ - en
23
+ - pl
24
+ invariants:
25
+ - Every {entity} is owned by exactly one tenant and every query uses the trusted tenant identifier.
26
+ permissions:
27
+ - id: '{module}.{entities}.read'
28
+ description: Read {entities} in the active tenant.
29
+ - id: '{module}.{entities}.manage'
30
+ description: Create and update {entities} in the active tenant.
31
+ dataOwnership:
32
+ - '{moduleId} owns {entity} identity and lifecycle status.'
33
+ acceptanceScenarios:
34
+ - id: '{MODULE}-LIST'
35
+ given: Tenant-scoped {entities} exist.
36
+ when: An authorized principal lists {entities}.
37
+ then: Only {entities} owned by the active tenant are returned in deterministic order.
38
+ - id: '{MODULE}-CREATE'
39
+ given: An authorized principal supplies valid {entity} data.
40
+ when: The {entity} is created.
41
+ then: A tenant-owned active {entity} is persisted and returned with a generated identifier.
42
+ - id: '{MODULE}-DENY'
43
+ given: A principal is unauthenticated or lacks the required permission.
44
+ when: The principal reads or mutates {entities}.
45
+ then: The server denies the operation before repository access.
@@ -0,0 +1,5 @@
1
+ # bug-fix
2
+
3
+ Fix a defect at the owning layer with a regression test that fails before the fix. In the sandbox this is an `edit-module` session whose brief describes a symptom; at the repository root it is `.ai/skills/bug-hunt/SKILL.md` followed by a pull request. A defect in `packages/**` switches to `core-extend` for the paths and gates, and keeps this blueprint's steps.
4
+
5
+ No behaviour beyond the fix travels in the change: no refactors, no renames, no reformatting of untouched code.
@@ -0,0 +1,29 @@
1
+ schemaVersion: 1
2
+ write:
3
+ - modules/{module}/**
4
+ deny:
5
+ - platform/**
6
+ - packages/**
7
+ - infra/**
8
+ - .github/**
9
+ - docs/**
10
+ - specs/**
11
+ - .ai/**
12
+ - flowdular.json
13
+ - pnpm-workspace.yaml
14
+ - modules/!({module})/**
15
+ notes:
16
+ - a defect under packages/** follows core-extend allowed-paths.yaml
17
+ # Written only by CLI commands, never by hand. The eject and the direct path
18
+ # both run the commands; the files still travel in the same commit.
19
+ cliOwned:
20
+ - path: flowdular.json
21
+ command: pnpm flowdular module enable <id> --apply
22
+ - path: platform/package.json
23
+ command: pnpm flowdular module enable <id> --apply
24
+ - path: platform/src/generated/modules.server.ts
25
+ command: pnpm flowdular module sync --apply
26
+ - path: platform/src/generated/modules.client.ts
27
+ command: pnpm flowdular module sync --apply
28
+ - path: pnpm-lock.yaml
29
+ command: pnpm install
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "../../../packages/contracts/schemas/blueprint.schema.json",
3
+ "schemaVersion": 1,
4
+ "architecture": "0.2.0",
5
+ "owner": "platform-architecture",
6
+ "status": "approved",
7
+ "id": "bug-fix",
8
+ "version": "1.0.0",
9
+ "risk": "workspace-write",
10
+ "agentRoles": ["backend-engineer", "frontend-engineer", "module-executor"],
11
+ "executorProfiles": ["sandbox-specialist", "repo-agent"],
12
+ "requiredReviewers": ["reviewer"],
13
+ "requiresApprovedSpec": false
14
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "scope": "module",
3
+ "target": "catalog.core"
4
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "blueprint": "bug-fix@1.0.0",
3
+ "rootCause": "A guess without reproduction.",
4
+ "owningLayer": "service",
5
+ "regressionTest": "",
6
+ "siblings": [],
7
+ "gates": ["typecheck"]
8
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "scope": "module",
3
+ "target": "catalog.core",
4
+ "symptom": "POST /api/catalog/items returns 500 when sku is longer than 64 characters.",
5
+ "reproduction": "createCatalogItem with a 70 character sku through route.handler(createContext(...))."
6
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "blueprint": "bug-fix@1.0.0",
3
+ "rootCause": "requiredString max for sku is missing so the service throws a generic error after the HTTP layer accepted the value.",
4
+ "owningLayer": "http",
5
+ "regressionTest": "tests/module.test.ts: rejects a sku above 64 characters with INVALID_INPUT",
6
+ "siblings": ["modules/parties/src/api/endpoints.ts"],
7
+ "gates": ["typecheck", "tests", "format"]
8
+ }
@@ -0,0 +1,30 @@
1
+ schemaVersion: 1
2
+ # Ids equal GateId in packages/sandbox/src/server/gates.ts. The sandbox runs the
3
+ # gates a role lists in its front matter after every turn that changed files;
4
+ # from the repository root run the command column yourself. Nothing executes
5
+ # this file; it documents the contract.
6
+ gates:
7
+ - id: spec-schema
8
+ command: pnpm flowdular spec validate --all --json
9
+ sandbox: pnpm flowdular spec validate --all --json --root <session workspace>
10
+ required: true
11
+ - id: module-schema
12
+ command: pnpm flowdular module validate --json
13
+ sandbox: pnpm flowdular module validate --json --root <session workspace>
14
+ required: true
15
+ - id: dependencies
16
+ command: 'grep the imports under src/** and compare with package.json dependencies (no CLI command yet)'
17
+ sandbox: checkDeclaredDependencies(modulePath) in packages/sandbox/src/server/dependencies.ts, run after every turn that changed files, plus a pnpm install when a package.json changed
18
+ required: true
19
+ - id: typecheck
20
+ command: pnpm --filter @flowdular/module-{module} typecheck
21
+ sandbox: node_modules/.bin/tsrx-tsc --noEmit -p tsconfig.json (cwd module)
22
+ required: true
23
+ - id: tests
24
+ command: pnpm --filter @flowdular/module-{module} test
25
+ sandbox: node_modules/.bin/vitest run --passWithNoTests (cwd module; zero tests still pass)
26
+ required: true
27
+ - id: format
28
+ command: pnpm format:check
29
+ sandbox: prettier --check . (cwd module)
30
+ required: true
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "required": ["scope", "target", "symptom"],
6
+ "properties": {
7
+ "scope": {
8
+ "type": "string",
9
+ "enum": ["module", "package"]
10
+ },
11
+ "target": {
12
+ "type": "string",
13
+ "minLength": 1
14
+ },
15
+ "symptom": {
16
+ "type": "string",
17
+ "minLength": 8,
18
+ "maxLength": 4000
19
+ },
20
+ "reproduction": {
21
+ "type": "string",
22
+ "maxLength": 4000
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "required": [
6
+ "blueprint",
7
+ "rootCause",
8
+ "owningLayer",
9
+ "regressionTest",
10
+ "siblings",
11
+ "gates"
12
+ ],
13
+ "properties": {
14
+ "blueprint": {
15
+ "const": "bug-fix@1.0.0"
16
+ },
17
+ "rootCause": {
18
+ "type": "string",
19
+ "minLength": 8
20
+ },
21
+ "owningLayer": {
22
+ "type": "string",
23
+ "enum": ["http", "service", "repository", "client", "composition", "core"]
24
+ },
25
+ "regressionTest": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "siblings": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "string"
33
+ },
34
+ "uniqueItems": true
35
+ },
36
+ "gates": {
37
+ "type": "array",
38
+ "minItems": 1,
39
+ "items": {
40
+ "type": "string",
41
+ "enum": [
42
+ "spec-schema",
43
+ "module-schema",
44
+ "dependencies",
45
+ "typecheck",
46
+ "tests",
47
+ "format"
48
+ ]
49
+ },
50
+ "uniqueItems": true
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,7 @@
1
+ schemaVersion: 1
2
+ required:
3
+ - tests/module.test.ts (or a new tests/*.test.ts) containing the regression test
4
+ changed:
5
+ - exactly the files of the owning layer named in the plan
6
+ forbidden:
7
+ - unrelated refactors, renames, reformatting of untouched code
@@ -0,0 +1,7 @@
1
+ schemaVersion: 1
2
+ status:
3
+ allowed:
4
+ - approved
5
+ onFix:
6
+ specVersion: patch bump when the fix changes observable behaviour named in a scenario
7
+ acceptanceScenarios: add one only when the bug shows a missing scenario; never rewrite existing ones