@pixel-point/toolcraft 0.0.2

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 (257) hide show
  1. package/LICENSE.md +98 -0
  2. package/README.md +41 -0
  3. package/bin/create-toolcraft-app.mjs +8 -0
  4. package/bin/toolcraft.mjs +8 -0
  5. package/package.json +24 -0
  6. package/scripts/prepare-pack.mjs +29 -0
  7. package/src/cli.mjs +392 -0
  8. package/src/cli.test.mjs +284 -0
  9. package/src/copy-recursive.mjs +86 -0
  10. package/src/generate.mjs +212 -0
  11. package/src/generate.test.mjs +322 -0
  12. package/src/import-map.mjs +14 -0
  13. package/src/package-json.mjs +80 -0
  14. package/src/package-json.test.mjs +67 -0
  15. package/src/rewrite-imports.mjs +85 -0
  16. package/src/rewrite-imports.test.mjs +58 -0
  17. package/templates/runtime/contracts/component-contracts.test.ts +1165 -0
  18. package/templates/runtime/contracts/component-contracts.ts +1340 -0
  19. package/templates/runtime/contracts/decision-contracts.test.ts +206 -0
  20. package/templates/runtime/contracts/decision-contracts.ts +283 -0
  21. package/templates/runtime/contracts/index.test.ts +14 -0
  22. package/templates/runtime/contracts/index.ts +3 -0
  23. package/templates/runtime/contracts/types.ts +56 -0
  24. package/templates/runtime/export/export.test.ts +203 -0
  25. package/templates/runtime/export/export.ts +132 -0
  26. package/templates/runtime/export/index.ts +1 -0
  27. package/templates/runtime/index.ts +14 -0
  28. package/templates/runtime/react/canvas-shell.test.tsx +424 -0
  29. package/templates/runtime/react/canvas-shell.tsx +408 -0
  30. package/templates/runtime/react/control-renderers.ts +31 -0
  31. package/templates/runtime/react/controls-panel.test.tsx +3736 -0
  32. package/templates/runtime/react/controls-panel.tsx +2327 -0
  33. package/templates/runtime/react/curve-geometry.test.ts +70 -0
  34. package/templates/runtime/react/index.ts +15 -0
  35. package/templates/runtime/react/layer-tree.ts +96 -0
  36. package/templates/runtime/react/layers-panel.test.tsx +487 -0
  37. package/templates/runtime/react/layers-panel.tsx +1348 -0
  38. package/templates/runtime/react/media-file.ts +82 -0
  39. package/templates/runtime/react/panel-host-config.ts +80 -0
  40. package/templates/runtime/react/panel-host-geometry.test.ts +66 -0
  41. package/templates/runtime/react/panel-host-geometry.ts +109 -0
  42. package/templates/runtime/react/panel-host-types.ts +74 -0
  43. package/templates/runtime/react/panel-host.test.tsx +102 -0
  44. package/templates/runtime/react/panel-host.tsx +353 -0
  45. package/templates/runtime/react/runtime-public-api.test.tsx +132 -0
  46. package/templates/runtime/react/settings-transfer.test.ts +150 -0
  47. package/templates/runtime/react/settings-transfer.ts +279 -0
  48. package/templates/runtime/react/storage-key-migration.ts +48 -0
  49. package/templates/runtime/react/theme-runtime.tsx +177 -0
  50. package/templates/runtime/react/timeline-panel.test.tsx +668 -0
  51. package/templates/runtime/react/timeline-panel.tsx +2953 -0
  52. package/templates/runtime/react/toolbar-panel.test.tsx +212 -0
  53. package/templates/runtime/react/toolbar-panel.tsx +205 -0
  54. package/templates/runtime/react/toolcraft-app.integration.test.tsx +350 -0
  55. package/templates/runtime/react/toolcraft-app.test.tsx +339 -0
  56. package/templates/runtime/react/toolcraft-app.tsx +81 -0
  57. package/templates/runtime/react/toolcraft-root.test.tsx +347 -0
  58. package/templates/runtime/react/toolcraft-root.tsx +203 -0
  59. package/templates/runtime/react/use-toolcraft.ts +41 -0
  60. package/templates/runtime/schema/define-toolcraft.test.ts +1524 -0
  61. package/templates/runtime/schema/define-toolcraft.ts +1442 -0
  62. package/templates/runtime/schema/keyframe-capability.test.ts +90 -0
  63. package/templates/runtime/schema/keyframe-capability.ts +51 -0
  64. package/templates/runtime/schema/runtime-targets.ts +40 -0
  65. package/templates/runtime/schema/types.ts +370 -0
  66. package/templates/runtime/state/canvas-zoom.ts +8 -0
  67. package/templates/runtime/state/create-template-state.test.ts +242 -0
  68. package/templates/runtime/state/create-template-state.ts +95 -0
  69. package/templates/runtime/state/keyframe-evaluation.test.ts +141 -0
  70. package/templates/runtime/state/keyframe-evaluation.ts +203 -0
  71. package/templates/runtime/state/persistence.test.ts +217 -0
  72. package/templates/runtime/state/persistence.ts +511 -0
  73. package/templates/runtime/state/reducer.test.ts +937 -0
  74. package/templates/runtime/state/reducer.ts +1212 -0
  75. package/templates/runtime/state/timeline-readiness.ts +43 -0
  76. package/templates/runtime/state/types.ts +242 -0
  77. package/templates/runtime/styles.css +125 -0
  78. package/templates/runtime/testing/performance.test.ts +1058 -0
  79. package/templates/runtime/testing/performance.ts +1078 -0
  80. package/templates/starter/AGENTS.md +186 -0
  81. package/templates/starter/LICENSE.md +98 -0
  82. package/templates/starter/NOTICE.md +8 -0
  83. package/templates/starter/docs/toolcraft/README.md +41 -0
  84. package/templates/starter/docs/toolcraft/acceptance-testing.md +205 -0
  85. package/templates/starter/docs/toolcraft/agent-worklog.md +81 -0
  86. package/templates/starter/docs/toolcraft/assembly-workflow.md +206 -0
  87. package/templates/starter/docs/toolcraft/component-rules.md +299 -0
  88. package/templates/starter/docs/toolcraft/custom-controls.md +71 -0
  89. package/templates/starter/docs/toolcraft/decision-contract.md +71 -0
  90. package/templates/starter/docs/toolcraft/performance.md +112 -0
  91. package/templates/starter/docs/toolcraft/renderer-technique.md +48 -0
  92. package/templates/starter/docs/toolcraft/schema-reference.md +265 -0
  93. package/templates/starter/docs/toolcraft/workflow.md +87 -0
  94. package/templates/starter/e2e/app-browser-acceptance.spec.ts +785 -0
  95. package/templates/starter/e2e/app-controls.spec.ts +41 -0
  96. package/templates/starter/e2e/app-performance.spec.ts +326 -0
  97. package/templates/starter/e2e/canvas-handle-helpers.ts +244 -0
  98. package/templates/starter/e2e/performance-helpers.ts +612 -0
  99. package/templates/starter/e2e/product-observable-helpers.ts +170 -0
  100. package/templates/starter/index.html +12 -0
  101. package/templates/starter/package.json +52 -0
  102. package/templates/starter/playwright.config.ts +43 -0
  103. package/templates/starter/scripts/check-ai-skills.mjs +95 -0
  104. package/templates/starter/scripts/check-toolcraft-docs.mjs +159 -0
  105. package/templates/starter/scripts/check-toolcraft-integrity.mjs +232 -0
  106. package/templates/starter/scripts/run-vite-on-free-port.mjs +48 -0
  107. package/templates/starter/scripts/toolcraft-port.mjs +54 -0
  108. package/templates/starter/scripts/toolcraft-port.test.mjs +73 -0
  109. package/templates/starter/src/app/starter-acceptance.test.ts +5959 -0
  110. package/templates/starter/src/app/starter-acceptance.ts +2646 -0
  111. package/templates/starter/src/app/starter-performance.test.ts +1390 -0
  112. package/templates/starter/src/app/starter-performance.ts +12 -0
  113. package/templates/starter/src/app/starter-schema.test.ts +70 -0
  114. package/templates/starter/src/app/starter-schema.ts +15 -0
  115. package/templates/starter/src/main.tsx +18 -0
  116. package/templates/starter/src/router.tsx +16 -0
  117. package/templates/starter/src/routes/index.tsx +7 -0
  118. package/templates/starter/src/routes/root.tsx +19 -0
  119. package/templates/starter/src/styles.css +120 -0
  120. package/templates/starter/tsconfig.json +11 -0
  121. package/templates/starter/vite.config.ts +13 -0
  122. package/templates/ui/components/composites/accordion.tsx +73 -0
  123. package/templates/ui/components/composites/alert-dialog.tsx +190 -0
  124. package/templates/ui/components/composites/alert.tsx +74 -0
  125. package/templates/ui/components/composites/aspect-ratio.tsx +22 -0
  126. package/templates/ui/components/composites/avatar.tsx +98 -0
  127. package/templates/ui/components/composites/badge.tsx +69 -0
  128. package/templates/ui/components/composites/breadcrumb.tsx +106 -0
  129. package/templates/ui/components/composites/card.tsx +91 -0
  130. package/templates/ui/components/composites/combobox.tsx +486 -0
  131. package/templates/ui/components/composites/command.tsx +296 -0
  132. package/templates/ui/components/composites/context-menu.tsx +247 -0
  133. package/templates/ui/components/composites/dialog.tsx +282 -0
  134. package/templates/ui/components/composites/dropdown-menu.tsx +299 -0
  135. package/templates/ui/components/composites/empty.tsx +110 -0
  136. package/templates/ui/components/composites/hover-card.tsx +44 -0
  137. package/templates/ui/components/composites/index.ts +30 -0
  138. package/templates/ui/components/composites/menubar.tsx +214 -0
  139. package/templates/ui/components/composites/navigation-menu.tsx +167 -0
  140. package/templates/ui/components/composites/pagination.tsx +131 -0
  141. package/templates/ui/components/composites/progress.tsx +72 -0
  142. package/templates/ui/components/composites/radio-group.tsx +84 -0
  143. package/templates/ui/components/composites/resizable.tsx +42 -0
  144. package/templates/ui/components/composites/sheet.tsx +153 -0
  145. package/templates/ui/components/composites/sidebar-structural.tsx +310 -0
  146. package/templates/ui/components/composites/sidebar.tsx +431 -0
  147. package/templates/ui/components/composites/sonner.tsx +35 -0
  148. package/templates/ui/components/composites/spinner.tsx +43 -0
  149. package/templates/ui/components/composites/table.tsx +108 -0
  150. package/templates/ui/components/composites/tabs.tsx +83 -0
  151. package/templates/ui/components/control-layout/index.tsx +437 -0
  152. package/templates/ui/components/controls/actions/actions-control.tsx +139 -0
  153. package/templates/ui/components/controls/actions/index.ts +9 -0
  154. package/templates/ui/components/controls/anchor-grid/anchor-grid-control.tsx +107 -0
  155. package/templates/ui/components/controls/anchor-grid/index.ts +4 -0
  156. package/templates/ui/components/controls/boolean/boolean-controls.tsx +79 -0
  157. package/templates/ui/components/controls/boolean/index.ts +4 -0
  158. package/templates/ui/components/controls/channel-mixer/channel-mixer-control.tsx +95 -0
  159. package/templates/ui/components/controls/channel-mixer/index.ts +4 -0
  160. package/templates/ui/components/controls/channel-tabs/channel-tabs.tsx +42 -0
  161. package/templates/ui/components/controls/channel-tabs/index.ts +6 -0
  162. package/templates/ui/components/controls/code-textarea/code-textarea-control.tsx +90 -0
  163. package/templates/ui/components/controls/code-textarea/index.ts +4 -0
  164. package/templates/ui/components/controls/color/color-control.tsx +571 -0
  165. package/templates/ui/components/controls/color/color-picker-popover.tsx +104 -0
  166. package/templates/ui/components/controls/color/index.ts +41 -0
  167. package/templates/ui/components/controls/color/palette-control-data.ts +436 -0
  168. package/templates/ui/components/controls/color/palette-control.tsx +535 -0
  169. package/templates/ui/components/controls/color/style-guide-color-picker-channel-utils.ts +162 -0
  170. package/templates/ui/components/controls/color/style-guide-color-picker-interactions.ts +190 -0
  171. package/templates/ui/components/controls/color/style-guide-color-picker-logic.ts +485 -0
  172. package/templates/ui/components/controls/color/style-guide-color-picker-parts.tsx +710 -0
  173. package/templates/ui/components/controls/color/style-guide-color-picker.tsx +503 -0
  174. package/templates/ui/components/controls/control-types.ts +43 -0
  175. package/templates/ui/components/controls/curves/curve-geometry.ts +355 -0
  176. package/templates/ui/components/controls/curves/curve-graph.tsx +390 -0
  177. package/templates/ui/components/controls/curves/curves-control.tsx +445 -0
  178. package/templates/ui/components/controls/curves/index.ts +6 -0
  179. package/templates/ui/components/controls/file-drop/file-drop-control.tsx +191 -0
  180. package/templates/ui/components/controls/file-drop/index.ts +5 -0
  181. package/templates/ui/components/controls/font-picker/font-catalog.json +15360 -0
  182. package/templates/ui/components/controls/font-picker/font-catalog.ts +116 -0
  183. package/templates/ui/components/controls/font-picker/font-picker-control.tsx +1202 -0
  184. package/templates/ui/components/controls/font-picker/font-preview-loader.ts +336 -0
  185. package/templates/ui/components/controls/font-picker/index.ts +24 -0
  186. package/templates/ui/components/controls/font-picker/use-hover-intent.ts +46 -0
  187. package/templates/ui/components/controls/gradient/gradient-control-utils.ts +190 -0
  188. package/templates/ui/components/controls/gradient/gradient-control.tsx +612 -0
  189. package/templates/ui/components/controls/gradient/gradient-stop-list.tsx +400 -0
  190. package/templates/ui/components/controls/gradient/gradient-toolbar.tsx +152 -0
  191. package/templates/ui/components/controls/gradient/index.ts +4 -0
  192. package/templates/ui/components/controls/image-picker/image-picker-control.tsx +139 -0
  193. package/templates/ui/components/controls/image-picker/index.ts +7 -0
  194. package/templates/ui/components/controls/index.ts +192 -0
  195. package/templates/ui/components/controls/range-input/index.ts +4 -0
  196. package/templates/ui/components/controls/range-input/range-input-control.tsx +173 -0
  197. package/templates/ui/components/controls/range-slider/index.ts +4 -0
  198. package/templates/ui/components/controls/range-slider/range-slider-control.tsx +122 -0
  199. package/templates/ui/components/controls/range-slider/range-slider-value.ts +61 -0
  200. package/templates/ui/components/controls/segmented/index.ts +8 -0
  201. package/templates/ui/components/controls/segmented/segmented-control.tsx +94 -0
  202. package/templates/ui/components/controls/select/index.ts +4 -0
  203. package/templates/ui/components/controls/select/select-control.tsx +223 -0
  204. package/templates/ui/components/controls/slider/index.ts +4 -0
  205. package/templates/ui/components/controls/slider/slider-control.tsx +150 -0
  206. package/templates/ui/components/controls/slider/slider-value.ts +56 -0
  207. package/templates/ui/components/controls/text-input/index.ts +4 -0
  208. package/templates/ui/components/controls/text-input/text-input-control.tsx +158 -0
  209. package/templates/ui/components/controls/use-measured-element-width.ts +42 -0
  210. package/templates/ui/components/controls/vector/index.ts +8 -0
  211. package/templates/ui/components/controls/vector/vector-control.tsx +401 -0
  212. package/templates/ui/components/panel/index.ts +19 -0
  213. package/templates/ui/components/panel/panel-actions.tsx +165 -0
  214. package/templates/ui/components/panel/panel-header.tsx +61 -0
  215. package/templates/ui/components/panel/panel-icon-button.tsx +96 -0
  216. package/templates/ui/components/panel/panel-section.tsx +168 -0
  217. package/templates/ui/components/panel/panel-surface.tsx +206 -0
  218. package/templates/ui/components/panel/panel.tsx +210 -0
  219. package/templates/ui/components/primitives/animated-loader.tsx +61 -0
  220. package/templates/ui/components/primitives/button-group.tsx +134 -0
  221. package/templates/ui/components/primitives/button.tsx +429 -0
  222. package/templates/ui/components/primitives/checkbox.tsx +62 -0
  223. package/templates/ui/components/primitives/editable-slider-value-label.tsx +337 -0
  224. package/templates/ui/components/primitives/field.tsx +225 -0
  225. package/templates/ui/components/primitives/index.ts +82 -0
  226. package/templates/ui/components/primitives/input-group.tsx +298 -0
  227. package/templates/ui/components/primitives/input.tsx +61 -0
  228. package/templates/ui/components/primitives/internal/button-loading.tsx +178 -0
  229. package/templates/ui/components/primitives/label.tsx +16 -0
  230. package/templates/ui/components/primitives/popover.tsx +126 -0
  231. package/templates/ui/components/primitives/portal-layer-context.tsx +33 -0
  232. package/templates/ui/components/primitives/primitive-arrow-icon.tsx +38 -0
  233. package/templates/ui/components/primitives/scroll-fade-logic.ts +441 -0
  234. package/templates/ui/components/primitives/scroll-fade-render.tsx +75 -0
  235. package/templates/ui/components/primitives/scroll-fade-types.ts +41 -0
  236. package/templates/ui/components/primitives/scroll-fade.tsx +72 -0
  237. package/templates/ui/components/primitives/select.tsx +408 -0
  238. package/templates/ui/components/primitives/selection-state.ts +31 -0
  239. package/templates/ui/components/primitives/separator.tsx +21 -0
  240. package/templates/ui/components/primitives/slider/index.ts +4 -0
  241. package/templates/ui/components/primitives/slider/slider-interaction.tsx +96 -0
  242. package/templates/ui/components/primitives/slider/slider-parts.tsx +303 -0
  243. package/templates/ui/components/primitives/slider/slider-reset.ts +152 -0
  244. package/templates/ui/components/primitives/slider/slider-value.ts +114 -0
  245. package/templates/ui/components/primitives/slider/slider.tsx +511 -0
  246. package/templates/ui/components/primitives/switch.tsx +35 -0
  247. package/templates/ui/components/primitives/textarea.tsx +49 -0
  248. package/templates/ui/components/primitives/toggle-group.tsx +114 -0
  249. package/templates/ui/components/primitives/toggle.tsx +46 -0
  250. package/templates/ui/components/primitives/tooltip.tsx +100 -0
  251. package/templates/ui/hooks/use-mobile.ts +21 -0
  252. package/templates/ui/index.ts +31 -0
  253. package/templates/ui/lib/control-outline.ts +3 -0
  254. package/templates/ui/lib/input-control-style.ts +131 -0
  255. package/templates/ui/lib/style-guide-color-utils.ts +111 -0
  256. package/templates/ui/lib/utils.ts +6 -0
  257. package/templates/ui/styles.css +291 -0
@@ -0,0 +1,186 @@
1
+ # Toolcraft App Template Assembly Guide
2
+
3
+ This is a standalone Toolcraft template app generated from the base starter.
4
+
5
+ ## Required Preflight
6
+
7
+ Treat this `AGENTS.md` as the active project contract. Before planning or editing app code, runtime code, controls, canvas, panels, renderer, timeline, layers, export, or tests, you must read:
8
+
9
+ 1. `docs/toolcraft/workflow.md`
10
+
11
+ Then follow `workflow.md` to choose the required contract docs and verification tier. Do not edit implementation files until this preflight is complete.
12
+
13
+ ## Quick Entry Contract
14
+
15
+ 1. Build through `defineToolcraft` and `ToolcraftApp`.
16
+ 2. Keep app state in Toolcraft runtime schema and commands.
17
+ 3. Keep product output in `canvasContent`; never render app UI there.
18
+ 4. Use built-in Toolcraft controls before custom controls.
19
+ 5. Do not hand-compose runtime surfaces or render built-in control components directly in app code; use `ToolcraftApp`, schema controls, `canvasContent`, `controlRenderers`, `onPanelAction`, and runtime commands.
20
+ 6. Before writing controls, make a Control Section Inventory that groups controls by product entity or workflow stage, not by UI component type.
21
+ 7. Keep control `label` short but semantically sufficient with the nearest visible section/group context, and put product-specific behavior help in schema `description`; runtime renders the label help tooltip only when that description adds meaning beyond the label.
22
+ 8. Enable layers and timeline only when product behavior requires them, then test the real UI.
23
+ 9. Animated preview renderers suspend or coalesce non-essential animation work during canvas drag, pan, pinch, zoom, and radar/center interactions, then resume without changing user playback state.
24
+ 10. If a Figma URL is provided, inspect the Figma file through MCP and rebuild from its structure; never implement from a screenshot or by eye.
25
+ 11. Choose an explicit persistence policy; use schema `persistence` for user-edited app settings that should survive reload, and test real reload restoration when localStorage is enabled.
26
+ 12. Use schema `settingsTransfer: "auto"` for complex apps that need import/export of control settings; never implement settings import/export through `panelActions` or route-local file inputs. After adding, removing, or reorganizing controls, sections, timeline, or layers, recalculate settings-transfer eligibility. The runtime threshold is 12 product controls, 5 product sections, or weighted score 18. Visible `Canvas width` and `Canvas height` inputs are owned by `editable-output` canvas sizing, not by settings transfer. When settings transfer and editable-output canvas sizing are both enabled, the first technical `Setup` runtime section contains `Export Settings`, `Import Settings`, `Canvas width`, and `Canvas height` in that order and renders without a visible section heading.
27
+ 13. Product apps expose `Background` color and `Include background` controls and wire them into PNG export; live preview, workspace canvas backing, and video export keep the background.
28
+ 14. Keep `docs/toolcraft/agent-worklog.md` current with a decision trail, product decisions, evidence, verification, and risks.
29
+ 15. Prove every visible entity through acceptance, browser, and performance coverage.
30
+ 16. Workload performance scenarios must declare `stressFixture`; browser perf tests must use `getToolcraftPerformanceStressValue(appPerformance, scenarioId)` so heavy-case tests cannot use toy values.
31
+ 17. Classify every implementation pass with a verification tier before editing. Use targeted checks for incremental edits and the full final gate only for final delivery, exports, or architecture/runtime/template changes.
32
+
33
+ ## Starter Baseline
34
+
35
+ The generated folder starts as a neutral Toolcraft shell: canvas upload plus toolbar. It intentionally does not include demo controls, prompt fields, layers, or timeline. Do not treat test fixtures or documentation examples as product requirements. Add controls, timeline, layers, sticky actions, persistence, and custom renderers only after the requested product or reference app requires them.
36
+
37
+ When the folder becomes a real product, update `src/app/app-acceptance.ts` from `appProductReadiness.mode: "starter"` to `mode: "product"` and fill `productName`, `productSummary`, and `requestedBehavior`. Renamed product folders are not allowed to keep neutral starter readiness.
38
+
39
+ ## License
40
+
41
+ This project includes Toolcraft source code governed by the Toolcraft Designer License in `LICENSE.md`. `NOTICE.md` explains that generated apps include Toolcraft runtime, starter, UI component, documentation, and template source code. Designer client work is permitted under the license, and using AI coding assistants or agents such as Codex, Claude, ChatGPT, Cursor, or similar tools to work on generated apps is permitted. Platform, generator, AI software product, app-builder, website-builder, template-marketplace, and resale uses require a separate commercial license from Pixel Point.
42
+
43
+ ## Local Reference Docs
44
+
45
+ Use this `AGENTS.md` as the entry contract. Use local docs for detail; the app must remain buildable without the website.
46
+
47
+ - `docs/toolcraft/workflow.md` — required preflight, task routing, worklog gate, and verification routing.
48
+ - `docs/toolcraft/assembly-workflow.md` — runtime assembly, canvas output, and reference clone path.
49
+ - `docs/toolcraft/decision-contract.md` — rule ids, levels, and enforcement expectations.
50
+ - `docs/toolcraft/schema-reference.md` — schema authoring rules for `src/app/app-schema.ts`.
51
+ - `docs/toolcraft/component-rules.md` — slider, segmented, color, upload, image picker, vector, layers, timeline, and footer action rules.
52
+ - `docs/toolcraft/acceptance-testing.md` — app entity matrix and browser acceptance for `src/app/app-acceptance.ts`.
53
+ - `docs/toolcraft/performance.md` — performance roles, scenarios, and workload coverage for `src/app/app-performance.ts`.
54
+ - `docs/toolcraft/renderer-technique.md` — DOM, SVG, Canvas 2D, WebGL, and mixed renderer choices.
55
+ - `docs/toolcraft/agent-worklog.md` — implementation decision trail, evidence, verification, and remaining risks.
56
+ - `docs/toolcraft/custom-controls.md` — custom control registration through `controlRenderers`.
57
+
58
+ ## Edit Surface
59
+
60
+ - Build the product by editing `src/app/app-schema.ts` and app-specific files under `src/app` and `src/routes`.
61
+ - Keep route files thin: routes compose schema-backed app screens and product renderers.
62
+ - Keep `src/app/app-acceptance.ts` aligned with every visible product entity.
63
+ - Keep `src/app/app-performance.ts` as app-specific performance matrix config only.
64
+ - Do not paste, restore, or duplicate runtime validators inside `src/app/app-performance.ts`.
65
+ - Do not edit `src/toolcraft` unless you are intentionally changing the local copied Toolcraft runtime.
66
+ - Before final delivery, replace the starter worklog with `Mode: product`, add `Decision Trail` entries for significant implementation passes, and record concrete decisions for renderer, timeline, layers, controls, export, and performance. Each decision-trail iteration must name the user-visible result, source/reference checked, contract rules applied, rejected alternatives, and state/output mapping. `pnpm test` fails if the worklog is missing, lacks the decision trail, or still describes the neutral starter.
67
+ - `pnpm test` includes Toolcraft source integrity and local docs checks. If a desired control style is missing, fix the schema or regenerate from the upstream template/runtime; do not patch copied `src/toolcraft` files for one app.
68
+
69
+ ## Decision Contract Rule IDs
70
+
71
+ These ids mirror `TOOLCRAFT_DECISION_CONTRACT` in `@/toolcraft/runtime`. Keep this list synced so standalone instructions do not drift from runtime validators.
72
+
73
+ - `runtime-shell-required`
74
+ - `canvas-no-app-ui`
75
+ - `canvas-surface-preserved`
76
+ - `canvas-handle-placement`
77
+ - `panel-host-behavior`
78
+ - `layers-enable-only-when-needed`
79
+ - `layers-enabled-behavior`
80
+ - `timeline-mode-choice`
81
+ - `timeline-enabled-behavior`
82
+ - `controls-product-coverage`
83
+ - `output-export-required`
84
+ - `controls-layout-heuristics`
85
+ - `renderer-technique-inventory`
86
+ - `reference-clone-source-of-truth`
87
+ - `acceptance-product-observable`
88
+ - `performance-coverage-levels`
89
+ - `persistence-policy-explicit`
90
+ - `workflow-required`
91
+
92
+ ## Runtime Contract
93
+
94
+ - Use `defineToolcraft` from `@/toolcraft/runtime`.
95
+ - Render the app through `ToolcraftApp` from `@/toolcraft/runtime/react`.
96
+ - Use `<ToolcraftApp schema={appSchema} />` for schema-only apps.
97
+ - Use `<ToolcraftApp schema={appSchema} canvasContent={<ProductRenderer />} />` for custom product renderers.
98
+ - Use `renderDefaultCanvasMedia={false}` when a custom renderer replaces the default media preview.
99
+ - Use `ToolcraftApp onPanelAction` for sticky footer product actions such as Generate, Apply, Export, Copy, or Download.
100
+ - Keep final app behavior in the schema and runtime command bus, not in isolated local control state.
101
+ - For animated products, write an Animation Intent Inventory before coding: use top playback timeline for product transport, keyframes timeline for editable property animation, and no timeline only for explicitly autonomous decorative output.
102
+ - For keyframes timeline apps, renderers read keyframed settings through Toolcraft evaluated-value helpers/hooks. Do not parse timeline `valueLabel` strings or read raw `state.values` for keyframed targets.
103
+ - Use schema `defaultValue` for every resettable control.
104
+ - Route editor-owned actions through runtime commands such as `controls.reset`, `media.import`, `media.delete`, `canvas.center`, `history.undo`, and `history.redo`.
105
+
106
+ ## Required AI Workflow Skills
107
+
108
+ AI must work on this app through the required workflow skills when the environment supports Codex skills. These skills are part of the task process, not optional reading.
109
+
110
+ - Before writing or changing an app spec, use `brainstorming` to decide product behavior, canvas sizing mode, panels, media flow, controls, export/copy behavior, renderer technique, timeline/layer choice, and ambiguous requirements.
111
+ - Before editing code from an approved spec, use `writing-plans` to produce a deterministic implementation plan focused on app files, tests, build, and browser verification.
112
+ - Before fixing any broken control, failed test, build failure, visual mismatch, export issue, or runtime regression, use `systematic-debugging` to find the root cause first.
113
+ - When the prompt includes a Figma URL, use Figma MCP/design context before implementation. Read the actual node, layer, component, variable, and asset structure; screenshots are only for final visual QA, not the source of truth.
114
+ - After implementation, use the `browser` workflow or equivalent local browser verification to test the running app, not only typecheck/build output. The automated browser gates are `pnpm test:browser` and `pnpm test:browser:perf`.
115
+ - Run `pnpm ai:check` before app generation or major changes.
116
+ - If a required skill is missing and the environment supports skill installation, install it before implementation and restart or refresh the session if the skill list does not update.
117
+ - If skill installation is not available, stop before implementation and tell the user exactly which required skills are missing.
118
+ - Do not silently skip required workflow skills, and do not replace them with an ad hoc plan.
119
+ - The Toolcraft app contract overrides generic brainstorming approval and visual-companion rituals. If the user asks to build or port an app, that request is approval to produce the spec, plan, implementation, tests, build, and local run unless a product-critical ambiguity remains.
120
+ - Do not ask the user to confirm decisions already covered by this contract, the prompt, or the reference app. Record the decision in the spec and continue.
121
+ - Do not ask whether to enable a browser companion during brainstorming. Browser verification is mandatory after the app runs locally.
122
+ - In standalone folders that are not git repositories, save spec/plan files without asking about commit requirements.
123
+
124
+ ## Verification Tier Classifier
125
+
126
+ Before editing, write a short verification note:
127
+
128
+ ```md
129
+ Verification tier: Tier N
130
+ Reason: <changed surface and expected blast radius>
131
+ Run: <commands and browser checks>
132
+ Skip: <checks not needed for this pass and why>
133
+ ```
134
+
135
+ Choose the tier by blast radius, not by line count. If uncertain, move one tier higher, not automatically to the full final gate.
136
+
137
+ | Tier | Use When | Required Checks |
138
+ | --- | --- | --- |
139
+ | Tier 0 — docs/copy | Documentation, comments, copy, labels, or titles change without schema targets, values, runtime behavior, renderer output, or layout mechanics. | Targeted docs/typecheck or targeted app test. Browser is not required unless visual text fitting is the risk. |
140
+ | Tier 1 — local control presentation | One control or panel visual state changes: spacing, hover, focus, disabled, marker visibility, label fit, or component variant display. Runtime state shape and product renderer are unchanged. | Targeted unit/component test plus one focused browser check for the affected control or panel. |
141
+ | Tier 2 — schema/product behavior | Controls, sections, defaults, persistence, panel actions, export actions, acceptance rows, or product behavior mapping changes. | `pnpm verify:quick` plus relevant browser acceptance. Run perf only when the changed control affects renderer workload or responsiveness. |
142
+ | Tier 3 — renderer/canvas/runtime feature | Custom renderer, animation loop, canvas sizing, upload/media, timeline, layers, toolbar, export bytes, WebGL/Canvas/SVG output, zoom, radar, history, heavy control behavior changes, or a post-generation iteration that touches renderer workload or viewport stability. | `pnpm verify:quick`, targeted browser acceptance, and relevant `pnpm verify:perf` scenarios for touched workload/viewport/export paths. |
143
+ | Tier 4 — final delivery/template architecture | Fresh generated app completion, folder export, commit-ready delivery, dependency changes, runtime/template/contract/CLI changes, broad refactors, or major post-generation iterations that rewrite renderer, canvas, animation, timeline/keyframes, layers, media, export, or control mapping. | Fresh folders run `pnpm install` once, then `pnpm verify:final`, then start `pnpm dev` to provide the local URL. |
144
+
145
+ Do not rerun `pnpm install` after every edit. Run it after fresh export, dependency changes, lockfile changes, or a missing package error.
146
+
147
+ Do not run the full browser performance suite for Tier 0-2 edits unless a performance checkpoint trigger applies.
148
+
149
+ Run a full performance checkpoint with `pnpm verify:perf` when the first working version of an app exists, when renderer/canvas/animation/export/timeline/layers change, after fixing a bug that previously broke functionality, after any performance optimization, or when the user asks to optimize performance, fix lag, remove jank, speed up animation, or stabilize drag/zoom.
150
+
151
+ Fast feature loops may defer full performance only when none of the checkpoint triggers above apply. Record the deferred check and reason in the verification note or worklog.
152
+
153
+ ## Required Checks
154
+
155
+ For final delivery, run:
156
+
157
+ ```bash
158
+ pnpm verify:final
159
+ pnpm dev
160
+ ```
161
+
162
+ Use `pnpm install` before this final gate when the folder is fresh or dependencies changed.
163
+
164
+ `pnpm test` must include `node scripts/check-toolcraft-docs.mjs`, `node scripts/check-toolcraft-integrity.mjs`, and app tests. `pnpm verify:ui` / `pnpm test:browser` must run against the real app UI and product output. `pnpm verify:perf` / `pnpm test:browser:perf` must run the performance browser suite sequentially so budgets are measured without parallel e2e noise.
165
+
166
+ Do not stop or kill existing local servers to free a port. `pnpm dev`, `pnpm preview`, and browser verification prefer port `3002`, but automatically move to the next free port when it is busy. Use `TOOLCRAFT_PORT`, `TOOLCRAFT_DEV_PORT`, or `TOOLCRAFT_TEST_PORT` only to change the preferred starting port.
167
+
168
+ ## App Completion Bar
169
+
170
+ The app is complete only when:
171
+
172
+ - the Toolcraft runtime shell is present;
173
+ - `canvasContent` contains product output only;
174
+ - the runtime canvas backing remains visible behind product output;
175
+ - every visible control affects runtime state and product output or a command side effect;
176
+ - reset returns schema controls to `defaultValue`;
177
+ - sticky footer export actions operate on final product output at `state.canvas.size`;
178
+ - still products expose Export PNG; animated products expose Export Video plus Export PNG;
179
+ - PNG export uses `Background` and `Include background` runtime controls with the standard export helper, while live preview, workspace canvas backing, and video keep background;
180
+ - all export paths use retina output dimensions from the standard export helper;
181
+ - layers are absent for single-layer apps and fully working when enabled;
182
+ - timeline is absent, playback, keyframes, or custom reference timeline according to product behavior;
183
+ - performance checks cover workload and responsiveness for all relevant controls;
184
+ - detail-heavy or animated custom renderers pass real viewport drag and zoom stress checks;
185
+ - workload browser perf tests use the declared `stressFixture` value from `app-performance.ts`;
186
+ - browser tests verify upload/clear, controls, canvas sizing, toolbar, timeline/layers when enabled, sticky actions, output dimensions, and viewport stability.
@@ -0,0 +1,98 @@
1
+ # Toolcraft Designer License
2
+
3
+ Copyright (c) 2026 Pixel Point
4
+
5
+ This license governs Toolcraft, including the CLI, starter template, runtime,
6
+ UI components, documentation, and any generated application code that includes
7
+ Toolcraft source code.
8
+
9
+ ## 1. Permitted Designer Use
10
+
11
+ You may use Toolcraft for personal, educational, internal evaluation, and
12
+ designer client work.
13
+
14
+ Designer client work means using Toolcraft as part of paid design, development,
15
+ consulting, or creative services to create a custom application for a specific
16
+ client.
17
+
18
+ Designers, freelancers, agencies, and studios may deliver generated
19
+ applications to their clients, and those clients may use the delivered
20
+ application for their own business, website, marketing, internal workflows, or
21
+ product presentation.
22
+
23
+ ## 2. Generated Applications
24
+
25
+ A generated application may be modified, deployed, and used by the designer or
26
+ the designer's client as a custom client deliverable.
27
+
28
+ You may not sell, sublicense, redistribute, publish, or offer generated
29
+ applications as standalone products, stock templates, starter kits, theme packs,
30
+ marketplace items, or reusable application templates.
31
+
32
+ ## 3. AI-Assisted Development
33
+
34
+ You may use AI coding assistants, AI agents, design assistants, large language
35
+ models, editors, IDE assistants, and similar tools to create, inspect, modify,
36
+ refactor, test, document, deploy, or maintain generated applications for any use
37
+ permitted by this license.
38
+
39
+ This includes tools such as Codex, Claude, ChatGPT, Cursor, and similar
40
+ assistants. Using those tools to work on Toolcraft projects or generated
41
+ applications does not, by itself, make your use a prohibited AI software, AI app
42
+ builder, AI design tool, code generation platform, or competing generator tool.
43
+
44
+ This section does not allow you to package, embed, host, or provide Toolcraft or
45
+ generated applications as part of a paid AI software product, AI app builder, AI
46
+ design tool, code generation platform, or competing generator service.
47
+
48
+ ## 4. Prohibited Uses
49
+
50
+ You may not use Toolcraft, generated applications, or any Toolcraft runtime,
51
+ starter, UI, or template code as part of:
52
+
53
+ - paid AI software;
54
+ - AI app builders;
55
+ - AI design tools;
56
+ - website builders;
57
+ - app builders;
58
+ - design-to-code SaaS products;
59
+ - code generation platforms;
60
+ - template marketplaces;
61
+ - competing generator tools;
62
+ - any product or service whose primary purpose is to let third parties generate,
63
+ resell, or reuse applications based on Toolcraft.
64
+
65
+ These uses require a separate commercial license from Pixel Point.
66
+
67
+ ## 5. No Hosted Generator or Resale Rights
68
+
69
+ You may not provide Toolcraft or substantially similar functionality to third
70
+ parties as a hosted service, API, plugin, marketplace product, or downloadable
71
+ generator without a separate commercial license.
72
+
73
+ ## 6. No Trademark Rights
74
+
75
+ This license does not grant rights to use the Pixel Point or Toolcraft names,
76
+ logos, branding, or trademarks except to identify Toolcraft as the tool used to
77
+ create a project.
78
+
79
+ ## 7. Ownership
80
+
81
+ You own the original design, content, configuration, and product-specific code
82
+ that you create.
83
+
84
+ Pixel Point retains ownership of Toolcraft, including the CLI, starter template,
85
+ runtime, UI components, documentation, and copied Toolcraft source code included
86
+ in generated applications.
87
+
88
+ ## 8. Commercial Licensing
89
+
90
+ If your intended use is not allowed by this license, you must obtain a separate
91
+ commercial license before using Toolcraft for that purpose.
92
+
93
+ Contact: licensing@pixel-point.com
94
+
95
+ ## 9. No Warranty
96
+
97
+ Toolcraft is provided "as is", without warranty of any kind. Pixel Point is not
98
+ liable for damages arising from use of Toolcraft or generated applications.
@@ -0,0 +1,8 @@
1
+ # Toolcraft Notice
2
+
3
+ This application was generated with Toolcraft and includes Toolcraft runtime,
4
+ starter, UI component, documentation, and template source code.
5
+
6
+ Use of that Toolcraft code is governed by `LICENSE.md`. Product-specific design,
7
+ content, configuration, and application code that you create remain yours, but
8
+ the Toolcraft source copied into this project remains owned by Pixel Point.
@@ -0,0 +1,41 @@
1
+ # Toolcraft Template Local Docs
2
+
3
+ This folder is the local operational reference for a standalone Toolcraft template app.
4
+
5
+ Use `../../AGENTS.md` as the entry contract, then read `workflow.md` before planning or editing app work. Use the remaining docs when a decision needs more detail:
6
+
7
+ The starter app itself is intentionally neutral. It should show the Toolcraft canvas/upload/toolbar baseline only until the product schema is authored. Demo controls, prompt inputs, layers, and timeline belong in tests/docs or in a real generated product that needs them.
8
+
9
+ 1. `workflow.md` — required preflight, task routing, worklog gate, and verification routing.
10
+ 2. `assembly-workflow.md` — how the app must be assembled.
11
+ 3. `decision-contract.md` — hard rules, defaults, heuristics, and escape hatches.
12
+ 4. `schema-reference.md` — how to write `src/app/app-schema.ts`.
13
+ 5. `component-rules.md` — component-specific layout and behavior rules.
14
+ 6. `acceptance-testing.md` — how every visible entity proves it works.
15
+ 7. `performance.md` — performance matrix and responsiveness gates.
16
+ 8. `renderer-technique.md` — how to choose DOM, SVG, Canvas 2D, WebGL, WebGPU, or mixed rendering.
17
+ 9. `agent-worklog.md` — implementation decision trail, evidence, verification, and risks.
18
+ 10. `custom-controls.md` — how to register custom controls without editing `src/toolcraft`.
19
+
20
+ `agent-worklog.md` starts as a neutral starter template. Once the folder becomes a product, change it to `Mode: product`, add `Decision Trail` entries for significant implementation passes, and record concrete renderer, timeline, layers, controls, export, and performance decisions with evidence. Each iteration must explain the user-visible result, source/reference checked, contract rules applied, rejected alternatives, and state/output mapping so later debugging can reconstruct why the app was built that way. The final test gate fails if this worklog is missing, stale, lacks decision-trail fields, or lacks verification.
21
+
22
+ Every implementation pass must choose a verification tier before editing. Use the smallest tier that covers the changed surface, and move one tier higher when unsure.
23
+
24
+ | Tier | Use for | Typical command |
25
+ | --- | --- | --- |
26
+ | Tier 0 | Docs/copy only | targeted docs/typecheck |
27
+ | Tier 1 | One control or panel visual state | targeted test + focused browser check |
28
+ | Tier 2 | Schema, defaults, persistence, actions, product mapping | `pnpm verify:quick` + relevant browser acceptance |
29
+ | Tier 3 | Renderer, canvas, timeline, layers, upload, export, zoom, heavy controls, or a performance checkpoint trigger | `pnpm verify:quick` + targeted browser/perf scenarios |
30
+ | Tier 4 | Final delivery, fresh export, runtime/template/contract changes, broad renderer/product rewrites | `pnpm verify:final` |
31
+
32
+ Run `pnpm verify:perf` when a performance checkpoint is triggered: first working app version, renderer/canvas/animation/export/timeline/layers changes, a fix for previously broken functionality, any performance optimization, or a user request to optimize performance, fix lag, remove jank, speed up animation, or stabilize drag/zoom.
33
+
34
+ Fresh folders or dependency changes need `pnpm install` before verification. Final delivery still starts the local app after the gate:
35
+
36
+ ```bash
37
+ pnpm verify:final
38
+ pnpm dev
39
+ ```
40
+
41
+ Do not kill existing local servers to free `3002`. Dev, preview, and browser verification prefer `3002`, then move to the next free port automatically.
@@ -0,0 +1,205 @@
1
+ # Acceptance Testing
2
+
3
+ Every visible product entity must prove it works. A control is not accepted because it renders; it is accepted only when tests prove user interaction changes runtime state and the final product output, command side effect, timeline frame, layer result, media lifecycle, or canvas viewport.
4
+
5
+ ## Required Files
6
+
7
+ - `src/app/app-acceptance.ts`
8
+ - `src/app/app-acceptance.test.ts`
9
+ - `src/app/app-performance.ts`
10
+ - `src/app/app-performance.test.ts`
11
+ - `docs/toolcraft/agent-worklog.md`
12
+ - `e2e/app-browser-acceptance.spec.ts`
13
+ - `e2e/app-controls.spec.ts`
14
+ - `e2e/app-performance.spec.ts`
15
+ - `e2e/product-observable-helpers.ts`
16
+
17
+ `pnpm verify:final` must pass before final delivery. Incremental edits use the verification tier classifier from `assembly-workflow.md`: run targeted browser acceptance for the changed entity, and add `pnpm verify:perf` whenever a performance checkpoint is triggered.
18
+
19
+ A performance checkpoint is triggered by the first working app version, renderer/canvas/animation/export/timeline/layers changes, a fix for previously broken functionality, any performance optimization, or a user request to optimize performance, fix lag, remove jank, speed up animation, or stabilize drag/zoom.
20
+
21
+ ## Product Readiness
22
+
23
+ The exported starter may keep `appProductReadiness.mode: "starter"` only while it is still a neutral template. A real product must switch it to `mode: "product"` and fill:
24
+
25
+ - `productName`;
26
+ - `productSummary`;
27
+ - `requestedBehavior`.
28
+
29
+ Product readiness also requires product surface: controls, layers, timeline, `canvasContent`, or acceptance coverage. A renamed product folder must not pass tests as a neutral starter.
30
+
31
+ ## Implementation Worklog
32
+
33
+ Product apps must update `docs/toolcraft/agent-worklog.md` before final delivery. The file records why the app chose its renderer, timeline mode, layer policy, control grouping, export behavior, and performance strategy.
34
+
35
+ The worklog must declare `Mode: product`. Every `Decision Trail` iteration must include `Request:`, `Task type:`, `User-visible result:`, `Source/reference checked:`, `Docs/contracts read:`, `Contract rules applied:`, `Decision:`, `Alternatives rejected:`, `State/output mapping:`, `Files changed:`, `Verification:`, `Skipped checks:`, and `Risks:`. `State/output mapping:` names how controls, commands, timeline, layers, media, or renderer state reaches the visible product or export. Each decision section (`Renderer`, `Timeline`, `Layers`, `Controls`, `Export`, `Performance`) must include `Decision:`, `Reason:`, and `Evidence:` entries. `Evidence` should name files, reference behavior, contract rules, browser checks, performance checks, or exact commands. `Verification` must list concrete checks such as `pnpm verify:quick`, `pnpm verify:perf`, browser tests, or Playwright scenarios. `Risks` must include either `Risk:` entries or `None:` with a reason.
36
+
37
+ The acceptance gate fails if the worklog is missing, still says `Mode: starter`, or lacks concrete decision evidence.
38
+
39
+ ## Acceptance Rows
40
+
41
+ Every visible schema control, custom renderer feature, media lifecycle, timeline behavior, layer behavior, canvas sizing behavior, toolbar command, sticky action, and product editing handle needs an acceptance row.
42
+
43
+ Each row should name:
44
+
45
+ - stable `id`;
46
+ - `kind`;
47
+ - runtime `target` when the entity edits state;
48
+ - `componentType`;
49
+ - fixture data;
50
+ - real user action;
51
+ - expected product-level observable;
52
+ - evidence type;
53
+ - exact `automatedTestName`;
54
+ - exact `browserTestName`.
55
+ - `controlPartCoverage` when the control is compound.
56
+ - `canvasSizingCoverage: "fixed-output-size"` when `canvas.sizing.mode` is `fixed-output`.
57
+ - `persistenceCoverage: "reload"` when schema `persistence.storage` is `"localStorage"`.
58
+
59
+ The test gate rejects rows without matching automated and browser test names.
60
+
61
+ `fixed-output` canvas sizing must be deliberate. Its runtime acceptance row must explain why width and height are non-editable. A default size from the prompt should use `editable-output`, which keeps the runtime Canvas width and Canvas height controls.
62
+
63
+ When localStorage persistence is enabled, add a runtime acceptance row that proves reload behavior. The browser test must change a real user-facing setting, wait for persistence to write, call a real page reload, and verify the restored control value or product output. Importing a settings JSON file is not persistence coverage.
64
+
65
+ ## Compound Controls
66
+
67
+ Compound controls have multiple semantic value parts inside one visible control. Their acceptance row must declare `controlPartCoverage`, and the browser test must explicitly exercise each required part against product output.
68
+
69
+ Required parts:
70
+
71
+ | Control | Required `controlPartCoverage` |
72
+ | --- | --- |
73
+ | `anchorGrid` | `anchorGrid.position` |
74
+ | `channelMixer` | `channelMixer.activeChannel`, `channelMixer.values`; only for RGB channel matrix behavior |
75
+ | `colorOpacity` | `colorOpacity.hex`, `colorOpacity.opacity` |
76
+ | `curves` | RGB variant: `curves.activeChannel`, `curves.points`; `variant: "single"`: `curves.points` |
77
+ | `fontPicker` | `fontPicker.fontId`, `fontPicker.fontWeight`, `fontPicker.fontSize`, `fontPicker.letterSpacing`, `fontPicker.lineHeight`, `fontPicker.textCase`, `fontPicker.color`, `fontPicker.opacity` |
78
+ | `gradient` | `gradient.gradientType`, `gradient.angle`, `gradient.stops.position`, `gradient.stops.color`, `gradient.stops.opacity` |
79
+ | `palette` | `palette.family`, `palette.shade` |
80
+ | `rangeInput` | `rangeInput.start`, `rangeInput.end` |
81
+ | `rangeSlider` | `rangeSlider.lower`, `rangeSlider.upper` |
82
+ | `vector` | `vector.x`, `vector.y` |
83
+
84
+ Testing only one sub-control is not enough. For example, a `gradient` test that changes only a stop color must fail if the app also renders Gradient type, Angle, Position, or Opacity controls.
85
+
86
+ For `curves`, the acceptance row must match the intended variant. Semantic one-dimensional curves such as acceleration, bend, easing, response, depth, mask, opacity, threshold, or remap curves must set `variant: "single"` and prove `curves.points`; RGB active-channel coverage is reserved for color-correction or channel-specific curves.
87
+
88
+ For `fontPicker`, product output evidence must come from actual rendered/exported product text after changing the font, weight, size, letter spacing, line height, text case, color, and opacity. Runtime value changes, selected labels, or popup font previews are preflight checks, not final acceptance.
89
+
90
+ ## Control Selection Gates
91
+
92
+ Acceptance must catch wrong-substitution failures. If the prompt, spec, or app behavior needs a value model owned by a built-in control, the schema must use that built-in or include a documented built-in fit check.
93
+
94
+ High-confidence wrong-substitution cases:
95
+
96
+ - gradient, stops, angle, fill transition, or adjustable gradient without `gradient`;
97
+ - typography without `fontPicker`;
98
+ - sibling typography controls that split case, color, opacity, size, weight, letter spacing, or line height away from `fontPicker`;
99
+ - color plus opacity without `colorOpacity`;
100
+ - from/to range without `rangeSlider` or `rangeInput`;
101
+ - curve, remap, easing, or response without `curves`;
102
+ - position, direction, focus, or vector without `vector`;
103
+ - source upload without `fileDrop`;
104
+ - app-wide transport in the controls panel instead of timeline;
105
+ - segmented choices that clip instead of falling back to `select`;
106
+ - custom controls recreating built-ins.
107
+
108
+ Rows that use custom controls must include `customControlCoverage` and typed `builtInFitCheck`.
109
+
110
+ ```ts
111
+ builtInFitCheck: {
112
+ checkedBuiltIns: ["fileDrop", "imagePicker", "select"],
113
+ closestBuiltIn: "fileDrop",
114
+ whyInsufficient:
115
+ "FileDrop imports source files, but it does not provide ordering, preview, remove, and density mapping in one runtime value.",
116
+ productObservable:
117
+ "Ordering uploaded glyphs changes the rendered glyph ramp output.",
118
+ }
119
+ ```
120
+
121
+ The fit check names real checked built-ins, the closest built-in or `"none"`, why it is insufficient, and the product-observable evidence that proves the custom control works.
122
+
123
+ ## Valid Evidence
124
+
125
+ Valid acceptance evidence includes:
126
+
127
+ - rendered product pixels;
128
+ - exported image/video bytes;
129
+ - canvas hash or DOM-visible product result;
130
+ - clipboard, file, or blob payload;
131
+ - cleared media preview and canvas;
132
+ - selected layer output;
133
+ - changed canvas viewport;
134
+ - changed timeline playback state plus rendered frame.
135
+ - restored persisted value or product output after browser reload.
136
+
137
+ Product apps must include output delivery acceptance. Still-output apps need `Export PNG` evidence. Animated apps need both `Export Video` evidence and `Export PNG` evidence. Clipboard copy can be tested as an additional behavior, but it cannot replace export coverage.
138
+
139
+ Async Export, Download, Copy, Generate, or Apply acceptance must prove the sticky footer top accent indicator is visible while the returned `onPanelAction` Promise is pending, advances when `reportProgress(0..1)` is called, and hides after it settles. Video export acceptance must prove frame-based progress updates during render/encode instead of only toggling a pending state.
140
+
141
+ Animated app acceptance must also exercise the separate `Video Export` section: choose at least two `export.video.format` values, choose at least two `export.video.resolution` values, verify unsupported MIME/container choices fall back safely, and assert exported video bytes, dimensions, MIME/container, and duration match runtime timeline state. The duration assertion must load the exported blob as a video, wait for metadata, and compare `video.duration` with the edited timeline duration; `blobSize > 0`, `blobType`, WebM parser fallback, or assigning the expected duration when metadata is missing are not enough.
142
+
143
+ Footer action acceptance must not include Reset. Reset is already available in the controls panel header and uses schema `defaultValue`; duplicating it in sticky `panelActions` fails acceptance.
144
+
145
+ Local `actions` acceptance must click every visible action and prove the nearby entity changed through runtime state or product output. A section-level `Randomize palette` must change palette output, `Normalize weights` must change weights/output, and `Clear selection` must clear only the scoped selection. Do not accept a test that only proves the button rendered.
146
+
147
+ PNG export tests must prove runtime background behavior: changing the background color affects preview/export, turning `export.includeBackground` off creates transparent PNG output while live preview, workspace canvas backing, and video keep the background, turning it on includes the current background color in PNG, and exported pixel dimensions are retina size, at least `state.canvas.size * 2`.
148
+
149
+ Invalid final acceptance evidence:
150
+
151
+ - control exists;
152
+ - `data-*` attribute changed;
153
+ - runtime state was mutated directly;
154
+ - DOM text changed but product output did not;
155
+ - shader uniform changed without output proof;
156
+ - helper fixture proves a function but not the app behavior.
157
+
158
+ If a behavior cannot be proven through product output or a side effect, remove the entity or ask whether it is required.
159
+
160
+ ## Browser Gate
161
+
162
+ Browser tests must open the running app and interact with the real UI by pointer, keyboard, file upload, canvas drag, toolbar click, timeline scrub, or layer drag.
163
+
164
+ Do not dispatch runtime commands directly for browser acceptance unless the entity is itself a command API. Browser tests must exercise what the user actually sees.
165
+
166
+ Every browser test should prove:
167
+
168
+ - the interaction is possible;
169
+ - runtime state changes through the expected target;
170
+ - product output or command side effect changes;
171
+ - canvas zoom, offset, and output dimensions do not jump unexpectedly.
172
+
173
+ Acceptance rows with `product-output`, `rendered-pixels`, or `timeline-output` evidence must use `expectToolcraftProductObservableToChange` or explicit before/after snapshots from `getToolcraftProductObservableSnapshot` in `e2e/product-observable-helpers.ts`. Runtime state, selected labels, row counts, canvas existence, or generic hashes without the shared product observable helper are not final proof.
174
+
175
+ Animated viewport tests must also prove that canvas drag, pan, pinch, zoom, and radar/center interactions suspend or coalesce non-essential animation preview work without changing the user's play/pause state. After the interaction, the renderer must resume from the correct timeline or autonomous time and keep canvas zoom/offset stable.
176
+
177
+ ## Timeline And Layers
178
+
179
+ When animation controls exist without `panels.timeline`, acceptance validation requires `starterTransferMode.animationIntent.mode = "autonomous"`. That intent must explain why the animation is decorative/self-running and must cover no user-facing transport, no play/pause, no scrub, no duration control, no loop control, and no export-at-time.
180
+
181
+ Playback timeline coverage must prove play/pause, scrub, duration, loop, restart when exposed, non-looping Play at the end restarts from 0, and export/copy at selected time when relevant. Duration coverage must edit the real `Edit timeline duration` control, prove the playback range changes, and prove the renderer maps one full product animation cycle to `state.timeline.durationSeconds`. Tests should compare visible or exported output at 0, midpoint, and end after changing the timeline duration. Do not accept a renderer that uses a separate fixed local duration while the timeline displays another duration, and do not accept a renderer effect that watches `state.timeline.durationSeconds` only to dispatch `timeline.setDuration` back to a computed local value.
182
+
183
+ Keyframe timeline coverage must prove diamond creation, expanded rows, keyframe updates on control change, scrub/playback evaluation, and product output changes for every inferred keyframe-capable control. Tests must prove renderers consume typed evaluated values from the Toolcraft keyframe evaluator; checking `valueLabel`, row count, or source strings is not enough.
184
+
185
+ Layer browser coverage must use the real LayersPanel UI: click rows, toggle visibility, drag rows to reorder, and drag rows into groups.
186
+
187
+ ## Component Variants
188
+
189
+ Component variants are acceptance requirements.
190
+
191
+ - Discrete sliders must render `[data-slot="slider"][data-variant="discrete"]`, show the expected full-width markers, and remain smooth while dragging.
192
+ - Schema sliders must stay full-width and stacked; only `fontPicker` may pair its internal letter-spacing and line-height footer sliders.
193
+ - Continuous stepped sliders must not render discrete markers.
194
+ - Range sliders must stay full-width, start with different lower and upper defaults, and accept built-in manual range separators such as slash, hyphen, spaces, and dashes.
195
+ - Segmented controls must preserve cell padding and avoid label collision.
196
+ - Select, segmented, and image-picker controls should cover every visible option unless options come from separately tested runtime data.
197
+ - Custom controls must declare `customControlCoverage` and `builtInFitCheck`. Coverage proves the custom control is not a built-in replacement, uses kit chrome, keeps only necessary UI, writes through runtime state, and changes product output; the fit check proves which built-ins were considered and why the custom interaction is necessary.
198
+
199
+ Performance browser tests must assert budgets through `expectToolcraftScenarioPerformanceBudget(..., appPerformance, scenarioId)`. Workload browser tests must apply values from `getToolcraftPerformanceStressValue(appPerformance, scenarioId)`. Do not hardcode budget numbers or toy workload values in e2e tests; `app-performance.ts` is the single source of truth.
200
+
201
+ ## Fixtures
202
+
203
+ Use fixtures that make each behavior visible. For example, background character-size controls need visible background characters, transparency needs alpha-sensitive pixels, selected-layer controls need multiple layers, timeline controls need deterministic playback or keyframe fixtures, and mode-specific controls need fixtures for every mode branch. Conditional coverage must prove visible controls, hidden controls, disabled controls, preserved values after switching away and back, and renderer output for the active branch. Count-controlled control banks must test both the low-count UI state and the expanded-count UI state; the test fails if inactive controls remain visible while the renderer ignores them.
204
+
205
+ Generic hash differences are not enough for semantic controls. If a control promises a direction, test that direction.
@@ -0,0 +1,81 @@
1
+ # Implementation Worklog
2
+
3
+ This file records product decisions and the evidence behind them. Keep it short, factual, and current. Update it after schema, renderer, timeline, layer, export, performance, or acceptance decisions.
4
+
5
+ ## Status
6
+
7
+ Mode: starter
8
+
9
+ The neutral starter has no product renderer, timeline, layers, export behavior, or performance workload yet. Replace this status with `Mode: product` when the folder becomes a real app.
10
+
11
+ ## Decision Trail
12
+
13
+ No product iterations yet. When this folder becomes a product, replace this note with iteration entries:
14
+
15
+ ### Iteration 1 — <short task name>
16
+
17
+ - Request:
18
+ - Task type:
19
+ - User-visible result:
20
+ - Source/reference checked:
21
+ - Docs/contracts read:
22
+ - Contract rules applied:
23
+ - Decision:
24
+ - Alternatives rejected:
25
+ - State/output mapping:
26
+ - Files changed:
27
+ - Verification:
28
+ - Skipped checks:
29
+ - Risks:
30
+
31
+ ## Decisions
32
+
33
+ ### Renderer
34
+
35
+ - Decision: No product renderer yet.
36
+ - Reason: The starter is intentionally neutral.
37
+ - Evidence: No `canvasContent` product renderer is declared.
38
+
39
+ ### Timeline
40
+
41
+ - Decision: No timeline yet.
42
+ - Reason: The starter has no product animation behavior.
43
+ - Evidence: `panels.timeline` is omitted.
44
+
45
+ ### Layers
46
+
47
+ - Decision: No layers yet.
48
+ - Reason: The starter has no layer workflow.
49
+ - Evidence: `panels.layers` is omitted.
50
+
51
+ ### Controls
52
+
53
+ - Decision: No product controls yet.
54
+ - Reason: Controls are added only after the requested product behavior is known.
55
+ - Evidence: The starter schema exposes no product control sections.
56
+
57
+ ### Export
58
+
59
+ - Decision: No product export yet.
60
+ - Reason: Export actions are added when the app has product output.
61
+ - Evidence: No sticky product `panelActions` are declared.
62
+
63
+ ### Performance
64
+
65
+ - Decision: No product performance workload yet.
66
+ - Reason: Performance scenarios depend on renderer and control workload.
67
+ - Evidence: The starter performance matrix is a neutral baseline.
68
+
69
+ ## Evidence
70
+
71
+ - Source reviewed: neutral starter schema and local Toolcraft docs.
72
+ - Contract applied: starter baseline remains neutral until product behavior exists.
73
+
74
+ ## Verification
75
+
76
+ - Run: `pnpm verify:quick` for starter baseline checks.
77
+ - Run: `pnpm verify:final` after turning this folder into a product app.
78
+
79
+ ## Risks
80
+
81
+ - Risk: This template must be replaced with product-specific decisions before final delivery.