create-substrate 0.1.2 → 0.1.4

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.
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # create-substrate
2
+
3
+ Scaffold a [Substrate](https://substrate.georgedrury.co.uk) playground: a Vite + React project with a creative surface, the toolbar and panels around it, and agent skills pre-installed.
4
+
5
+ ```bash
6
+ npx create-substrate
7
+ ```
8
+
9
+ You are asked for a project name, a surface type and a package manager. Pass flags to skip the prompts:
10
+
11
+ ```bash
12
+ npx create-substrate my-editor --surface canvas-2d --pm pnpm
13
+ ```
14
+
15
+ ## Surfaces
16
+
17
+ | `--surface` | For |
18
+ | --- | --- |
19
+ | `canvas-2d` | Shape editors, whiteboards, diagram tools |
20
+ | `3d-scene` | Product viewers, architectural tools, shader playgrounds |
21
+ | `animation` | Keyframe editors, motion graphics, easing explorers |
22
+ | `node-editor` | Visual programming, shader graphs, data pipelines |
23
+ | `data-vis` | Charts, dashboards, analytics explorers |
24
+ | `image-gen` | AI image tools, prompt-driven workflows |
25
+ | `blank` | Scaffold only; bring your own surface |
26
+
27
+ ## Options
28
+
29
+ | Flag | Description |
30
+ | --- | --- |
31
+ | `--surface <type>` | Surface type from the table above |
32
+ | `--pm <manager>` | Package manager: `npm`, `pnpm` or `bun` |
33
+ | `--skip-install` | Skip dependency installation |
34
+ | `--skip-git` | Don't initialise a git repository |
35
+
36
+ ## What you get
37
+
38
+ - A starter page for the chosen surface, built from Substrate components copied into `src/components/substrate/`
39
+ - `CLAUDE.md` and `.claude/skills/` so coding agents know which components exist and how to compose them
40
+ - `.mcp.json` registering the Substrate MCP server
41
+ - [`@substrate-kit/cli`](https://www.npmjs.com/package/@substrate-kit/cli) as a dev dependency, for adding more components later:
42
+
43
+ ```bash
44
+ npx substrate-kit add colour-picker timeline
45
+ ```
46
+
47
+ To add Substrate to an existing project instead, run `npx @substrate-kit/cli init`.
48
+
49
+ Docs: [substrate.georgedrury.co.uk/docs/create-substrate](https://substrate.georgedrury.co.uk/docs/create-substrate)
50
+
51
+ ## Licence
52
+
53
+ MIT
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ const program = new Command();
6
6
  program
7
7
  .name("create-substrate")
8
8
  .description("Scaffold a Substrate creative tool playground")
9
- .version("0.1.0")
9
+ .version("0.1.4")
10
10
  .argument("[project-name]", "Name for the new project")
11
11
  .option("--surface <type>", "Surface type (canvas-2d, 3d-scene, animation, node-editor, data-vis, image-gen, blank)")
12
12
  .option("--pm <manager>", "Package manager (npm, pnpm, bun)")
package/dist/scaffold.js CHANGED
@@ -88,7 +88,7 @@ export async function scaffold(projectName, options) {
88
88
  log.success(`Installed ${skillNames.length} skills`);
89
89
  }
90
90
  catch {
91
- log.warn("Could not install skills — run 'npx substrate-kit init' to add them later");
91
+ log.warn("Could not install skills — run 'npx @substrate-kit/cli init' to add them later");
92
92
  }
93
93
  // 5. Write CLAUDE.md
94
94
  writeFile(join(projectDir, "CLAUDE.md"), claudeMd());
@@ -132,6 +132,7 @@ function packageJson(name, config, options) {
132
132
  "@types/react-dom": "^19",
133
133
  vite: "^6.3.0",
134
134
  "@vitejs/plugin-react": "^4.4.0",
135
+ "@substrate-kit/cli": "^0.1.1",
135
136
  tailwindcss: "^4",
136
137
  "@tailwindcss/vite": "^4",
137
138
  ...config.extraDevDeps,
@@ -375,6 +376,7 @@ Substrate skills are installed in \`.claude/skills/\`. They are organised into t
375
376
  - **scaffold-playground** — bootstrapping a new playground
376
377
  - **canvas-2d** / **3d-scene** / **animation** / **image-generation** / **data-visualisation** — surface-specific architecture
377
378
  - **composing-panels** / **wire-interactions** / **create-custom-tool** / **theming** — workflow guides
379
+ - **install-components** — full catalogue of available components + how to install via \`substrate-kit add\`
378
380
 
379
381
  ### Component reference (what to use)
380
382
 
@@ -387,17 +389,24 @@ Substrate skills are installed in \`.claude/skills/\`. They are organised into t
387
389
 
388
390
  ## Install components
389
391
 
392
+ **Always prefer existing Substrate components over writing custom ones.** Substrate ships sliders, number inputs, toggles, colour pickers, context menus, command palettes, toolbars, panels, timelines, and more — see the \`install-components\` skill for the full catalogue.
393
+
390
394
  \`\`\`bash
391
395
  # Core scaffold
392
396
  npx substrate-kit add design-canvas toolbar panel pane action slider
393
397
 
394
398
  # Surface components
395
399
  npx substrate-kit add surface timeline gallery colour-picker easing-curve-editor
400
+
401
+ # Interactive picker (no args)
402
+ npx substrate-kit add
396
403
  \`\`\`
397
404
 
405
+ Do **not** run \`npx shadcn@latest add\` directly for Substrate components — always go through \`substrate-kit add\`.
406
+
398
407
  ## Registry
399
408
 
400
- Components are installed from \`substrate.georgedrury.co.uk/r/\` via the shadcn CLI.
409
+ Components are installed from \`substrate.georgedrury.co.uk/r/\` via the Substrate CLI, which wraps shadcn under the hood.
401
410
  `;
402
411
  }
403
412
  //# sourceMappingURL=scaffold.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACjG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAuB,MAAM,sBAAsB,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAoB,MAAM,qBAAqB,CAAA;AAShE,MAAM,aAAa,GAAG,uCAAuC,CAAA;AAE7D,SAAS,WAAW;IAClB,MAAM,MAAM,GAAG;QACb,sCAAsC;QACtC,qCAAqC;QACrC,sCAAsC;QACtC,sCAAsC;KACvC,CAAA;IACD,OAAO,CAAC,GAAG,EAAE,CAAA;IACb,KAAK,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EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI,CAAA;AACV,CAAC;AAED,SAAS,QAAQ;IACf,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CR,CAAA;AACD,CAAC"}
@@ -172,8 +172,8 @@ export default function App() {
172
172
 
173
173
  <StatusBar>
174
174
  <StatusBarSection>
175
- <StatusBarItem label="Mode" value={mode} />
176
- {selected && <StatusBarItem label="Selected" value={selected.id} />}
175
+ <StatusBarItem>Mode: {mode}</StatusBarItem>
176
+ {selected && <StatusBarItem>Selected: {selected.id}</StatusBarItem>}
177
177
  </StatusBarSection>
178
178
  </StatusBar>
179
179
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/surfaces/animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,eAAO,MAAM,SAAS,EAAE,aAiNvB,CAAA"}
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/surfaces/animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,eAAO,MAAM,SAAS,EAAE,aAoNvB,CAAA"}
@@ -135,7 +135,10 @@ export default function App() {
135
135
  <PaneContent>
136
136
  <div className="grid grid-cols-2 gap-2">
137
137
  <NumberInput label="Frame" value={currentFrame} onChange={setCurrentFrame} min={0} max={totalFrames} />
138
- <NumberInput label="Value" defaultValue={0} />
138
+ <div>
139
+ <label className="text-xs font-medium">Value</label>
140
+ <NumberInput value={0} onChange={() => {}} />
141
+ </div>
139
142
  </div>
140
143
  </PaneContent>
141
144
  </Pane>
@@ -180,11 +183,11 @@ export default function App() {
180
183
 
181
184
  <StatusBar>
182
185
  <StatusBarSection>
183
- <StatusBarItem label="Frame" value={\`\${currentFrame} / \${totalFrames}\`} />
184
- <StatusBarItem label="State" value={playing ? "Playing" : "Stopped"} />
186
+ <StatusBarItem>Frame: {currentFrame} / {totalFrames}</StatusBarItem>
187
+ <StatusBarItem>State: {playing ? "Playing" : "Stopped"}</StatusBarItem>
185
188
  </StatusBarSection>
186
189
  <StatusBarSection>
187
- <HistoryControls canUndo={false} canRedo={false} onUndo={() => {}} onRedo={() => {}} />
190
+ <HistoryControls size="sm" />
188
191
  </StatusBarSection>
189
192
  </StatusBar>
190
193
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"animation.js","sourceRoot":"","sources":["../../src/surfaces/animation.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAkB;IACtC,UAAU,EAAE;QACV,SAAS;QACT,OAAO;QACP,MAAM;QACN,UAAU;QACV,qBAAqB;QACrB,QAAQ;QACR,cAAc;QACd,kBAAkB;QAClB,YAAY;KACb;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;KAChB;IACD,GAAG,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiMZ;CACA,CAAA"}
1
+ {"version":3,"file":"animation.js","sourceRoot":"","sources":["../../src/surfaces/animation.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAkB;IACtC,UAAU,EAAE;QACV,SAAS;QACT,OAAO;QACP,MAAM;QACN,UAAU;QACV,qBAAqB;QACrB,QAAQ;QACR,cAAc;QACd,kBAAkB;QAClB,YAAY;KACb;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;KAChB;IACD,GAAG,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoMZ;CACA,CAAA"}
@@ -61,7 +61,7 @@ export default function App() {
61
61
 
62
62
  <StatusBar>
63
63
  <StatusBarSection>
64
- <StatusBarItem label="Tool" value={tool} />
64
+ <StatusBarItem>Tool: {tool}</StatusBarItem>
65
65
  </StatusBarSection>
66
66
  </StatusBar>
67
67
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"canvas-2d.d.ts","sourceRoot":"","sources":["../../src/surfaces/canvas-2d.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,eAAO,MAAM,QAAQ,EAAE,aAyItB,CAAA"}
1
+ {"version":3,"file":"canvas-2d.d.ts","sourceRoot":"","sources":["../../src/surfaces/canvas-2d.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,eAAO,MAAM,QAAQ,EAAE,aA8ItB,CAAA"}
@@ -57,6 +57,11 @@ const TOOLS = [
57
57
  export default function App() {
58
58
  const [tool, setTool] = useState("select")
59
59
  const [zoom, setZoom] = useState(1)
60
+ const [x, setX] = useState(0)
61
+ const [y, setY] = useState(0)
62
+ const [w, setW] = useState(100)
63
+ const [h, setH] = useState(100)
64
+ const [fill, setFill] = useState("#6366f1")
60
65
 
61
66
  return (
62
67
  <div className="flex h-screen flex-col bg-background text-foreground">
@@ -90,10 +95,10 @@ export default function App() {
90
95
  </PaneHeader>
91
96
  <PaneContent>
92
97
  <div className="grid grid-cols-2 gap-2">
93
- <NumberInput label="X" defaultValue={0} />
94
- <NumberInput label="Y" defaultValue={0} />
95
- <NumberInput label="W" defaultValue={100} />
96
- <NumberInput label="H" defaultValue={100} />
98
+ <NumberInput label="X" value={x} onChange={setX} />
99
+ <NumberInput label="Y" value={y} onChange={setY} />
100
+ <NumberInput label="W" value={w} onChange={setW} />
101
+ <NumberInput label="H" value={h} onChange={setH} />
97
102
  </div>
98
103
  </PaneContent>
99
104
  </Pane>
@@ -102,7 +107,7 @@ export default function App() {
102
107
  <PaneLabel>Fill</PaneLabel>
103
108
  </PaneHeader>
104
109
  <PaneContent>
105
- <ColourPicker />
110
+ <ColourPicker value={fill} onChange={setFill} />
106
111
  </PaneContent>
107
112
  </Pane>
108
113
  </Panel>
@@ -124,11 +129,11 @@ export default function App() {
124
129
 
125
130
  <StatusBar>
126
131
  <StatusBarSection>
127
- <StatusBarItem label="Tool" value={tool} />
132
+ <StatusBarItem>Tool: {tool}</StatusBarItem>
128
133
  </StatusBarSection>
129
134
  <StatusBarSection>
130
- <HistoryControls canUndo={false} canRedo={false} onUndo={() => {}} onRedo={() => {}} />
131
- <ZoomControls zoom={zoom} onZoomIn={() => setZoom((z) => Math.min(z * 1.25, 10))} onZoomOut={() => setZoom((z) => Math.max(z / 1.25, 0.1))} onReset={() => setZoom(1)} />
135
+ <HistoryControls size="sm" />
136
+ <ZoomControls zoom={zoom} onZoomChange={setZoom} />
132
137
  </StatusBarSection>
133
138
  </StatusBar>
134
139
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"canvas-2d.js","sourceRoot":"","sources":["../../src/surfaces/canvas-2d.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,UAAU,EAAE;QACV,eAAe;QACf,SAAS;QACT,OAAO;QACP,MAAM;QACN,QAAQ;QACR,YAAY;QACZ,cAAc;QACd,eAAe;QACf,kBAAkB;QAClB,YAAY;QACZ,eAAe;KAChB;IACD,GAAG,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0HZ;CACA,CAAA"}
1
+ {"version":3,"file":"canvas-2d.js","sourceRoot":"","sources":["../../src/surfaces/canvas-2d.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,UAAU,EAAE;QACV,eAAe;QACf,SAAS;QACT,OAAO;QACP,MAAM;QACN,QAAQ;QACR,YAAY;QACZ,cAAc;QACd,eAAe;QACf,kBAAkB;QAClB,YAAY;QACZ,eAAe;KAChB;IACD,GAAG,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+HZ;CACA,CAAA"}
@@ -162,9 +162,9 @@ export default function App() {
162
162
 
163
163
  <StatusBar>
164
164
  <StatusBarSection>
165
- <StatusBarItem label="Chart" value={chartType} />
166
- <StatusBarItem label="Metric" value={metric} />
167
- <StatusBarItem label="Points" value={String(SAMPLE_DATA.length)} />
165
+ <StatusBarItem>Chart: {chartType}</StatusBarItem>
166
+ <StatusBarItem>Metric: {metric}</StatusBarItem>
167
+ <StatusBarItem>Points: {SAMPLE_DATA.length}</StatusBarItem>
168
168
  </StatusBarSection>
169
169
  </StatusBar>
170
170
  </div>
@@ -177,12 +177,12 @@ export default function App() {
177
177
 
178
178
  <StatusBar>
179
179
  <StatusBarSection>
180
- <StatusBarItem label="Generations" value={String(generations.length)} />
181
- {generating && <StatusBarItem label="Progress" value={\`\${progress}%\`} />}
180
+ <StatusBarItem>Generations: {generations.length}</StatusBarItem>
181
+ {generating && <StatusBarItem>Progress: {progress}%</StatusBarItem>}
182
182
  </StatusBarSection>
183
183
  <StatusBarSection>
184
- <StatusBarItem label="Steps" value={String(steps)} />
185
- <StatusBarItem label="CFG" value={String(cfg)} />
184
+ <StatusBarItem>Steps: {steps}</StatusBarItem>
185
+ <StatusBarItem>CFG: {cfg}</StatusBarItem>
186
186
  </StatusBarSection>
187
187
  </StatusBar>
188
188
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"node-editor.d.ts","sourceRoot":"","sources":["../../src/surfaces/node-editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,eAAO,MAAM,UAAU,EAAE,aAiNxB,CAAA"}
1
+ {"version":3,"file":"node-editor.d.ts","sourceRoot":"","sources":["../../src/surfaces/node-editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,eAAO,MAAM,UAAU,EAAE,aAqNxB,CAAA"}
@@ -163,8 +163,14 @@ export default function App() {
163
163
  </PaneHeader>
164
164
  <PaneContent>
165
165
  <div className="grid grid-cols-2 gap-2">
166
- <NumberInput label="X" value={selected.x} />
167
- <NumberInput label="Y" value={selected.y} />
166
+ <div>
167
+ <label className="text-xs font-medium">X</label>
168
+ <NumberInput value={selected.x} onChange={() => {}} />
169
+ </div>
170
+ <div>
171
+ <label className="text-xs font-medium">Y</label>
172
+ <NumberInput value={selected.y} onChange={() => {}} />
173
+ </div>
168
174
  </div>
169
175
  </PaneContent>
170
176
  </Pane>
@@ -191,15 +197,13 @@ export default function App() {
191
197
 
192
198
  <StatusBar>
193
199
  <StatusBarSection>
194
- <StatusBarItem label="Tool" value={tool} />
195
- {selected && <StatusBarItem label="Node" value={selected.label} />}
200
+ <StatusBarItem>Tool: {tool}</StatusBarItem>
201
+ {selected && <StatusBarItem>Node: {selected.label}</StatusBarItem>}
196
202
  </StatusBarSection>
197
203
  <StatusBarSection>
198
204
  <ZoomControls
199
205
  zoom={zoom}
200
- onZoomIn={() => setZoom((z) => Math.min(z * 1.25, 5))}
201
- onZoomOut={() => setZoom((z) => Math.max(z / 1.25, 0.2))}
202
- onReset={() => setZoom(1)}
206
+ onZoomChange={setZoom}
203
207
  />
204
208
  </StatusBarSection>
205
209
  </StatusBar>
@@ -1 +1 @@
1
- {"version":3,"file":"node-editor.js","sourceRoot":"","sources":["../../src/surfaces/node-editor.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAkB;IACvC,UAAU,EAAE;QACV,SAAS;QACT,OAAO;QACP,MAAM;QACN,MAAM;QACN,cAAc;QACd,eAAe;QACf,YAAY;QACZ,eAAe;QACf,iBAAiB;KAClB;IACD,OAAO,EAAE;;;;;;;mCAOwB;IACjC,GAAG,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4LZ;CACA,CAAA"}
1
+ {"version":3,"file":"node-editor.js","sourceRoot":"","sources":["../../src/surfaces/node-editor.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAkB;IACvC,UAAU,EAAE;QACV,SAAS;QACT,OAAO;QACP,MAAM;QACN,MAAM;QACN,cAAc;QACd,eAAe;QACf,YAAY;QACZ,eAAe;QACf,iBAAiB;KAClB;IACD,OAAO,EAAE;;;;;;;mCAOwB;IACjC,GAAG,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgMZ;CACA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-substrate",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Scaffold a Substrate creative tool playground",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "scripts": {
10
10
  "build": "tsc",
11
- "dev": "tsx src/index.ts"
11
+ "dev": "tsx src/index.ts",
12
+ "prepack": "node ../../scripts/sync-skills.mjs && npm run build"
12
13
  },
13
14
  "dependencies": {
14
15
  "chalk": "^5.4.0",
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: 3d-scene
3
+ description: "Build interactive 3D viewports with Substrate — scene graphs, orbit cameras, object placement, materials, and lighting. Use when the app involves spatial objects in three dimensions. Triggers on: 3D, scene, viewport, three.js, react-three-fiber, r3f, orbit camera, material editor, lighting, shader playground, product viewer, scene graph."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # 3D scene
2
8
 
3
9
  Guide to building interactive 3D viewports with Substrate — object placement, orbit cameras, material editors, and lighting controls.
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: animation
3
+ description: "Build timeline-based motion tools with Substrate — keyframes, easing curves, playback controls, and animated previews. Use when the app involves motion over time. Triggers on: animation, timeline, keyframe, easing, tween, playback, motion, GSAP, sprite animation, motion graphics, ease curve."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # Animation
2
8
 
3
9
  Guide to building timeline-based motion tools with Substrate — keyframe editing, easing controls, playback, and animated previews.
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: canvas-2d
3
+ description: "Build spatial 2D tools with Substrate — shape editors, diagram builders, whiteboards, and Figma-like design surfaces using the DesignCanvas component. Use when the app involves objects on an infinite pannable/zoomable plane. Triggers on: canvas, 2D, design canvas, shape editor, diagram, whiteboard, map builder, pan, zoom, infinite canvas, Figma-like, flat shapes."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # 2D canvas
2
8
 
3
9
  Guide to building spatial 2D tools with Substrate — shape editors, diagram builders, whiteboard apps, and Figma-like design surfaces.
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: composing-panels
3
+ description: "Compose Substrate panel UIs — how Panel, Pane, PaneHeader, Action, and ActionControls nest together to build property inspectors, layer panels, and parameter forms. Use when laying out the side panels of a playground. Triggers on: panel, pane, sidebar, inspector, property panel, layer panel, form row, action row, compose panels, nest components."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # Composing panels
2
8
 
3
9
  Guide to building property panels, layer lists, and inspector UIs using Substrate's panel component system.
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: create-custom-tool
3
+ description: "End-to-end guide for adding a new canvas tool to Substrate — ToolType union, element factory, renderer, hit-test, interaction handler, keyboard shortcut, and toolbar entry. Use when extending the 2D canvas with a custom drawing or editing tool. Triggers on: custom tool, new tool, tool type, element factory, toolbar toggle, canvas tool, drawing tool, add tool."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # Create a custom tool
2
8
 
3
9
  End-to-end guide for adding a new canvas tool to Substrate — from type definition through to toolbar entry and keyboard shortcut.
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: data-visualisation
3
+ description: "Build interactive data exploration tools with Substrate — charts, graphs, dashboards, and visual analytics surfaces. Use when the app explores, filters, and presents data visually. Triggers on: data visualisation, dataviz, chart, graph, dashboard, analytics, D3, Observable Plot, filters, axis, aggregation, data explorer."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # Data visualisation
2
8
 
3
9
  Guide to building interactive data exploration tools with Substrate — charts, graphs, dashboards, and visual analytics playgrounds.
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: image-generation
3
+ description: "Build prompt-driven image creation tools with Substrate — generation controls, preview surfaces, galleries, and parameter tuning. Use when the app produces AI-generated visuals via an API. Triggers on: image generation, text-to-image, Stable Diffusion, fal.ai, Replicate, inpainting, outpainting, style transfer, texture generator, prompt, gallery, generation controls."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # Image generation
2
8
 
3
9
  Guide to building prompt-driven image creation tools with Substrate — generation controls, preview surfaces, galleries, and parameter tuning.
@@ -0,0 +1,199 @@
1
+ ---
2
+ name: install-components
3
+ description: "Catalogue of every Substrate component, hook, utility, and store — with the exact `substrate-kit add` command to install each. Use this BEFORE writing any custom slider, input, toggle, picker, toolbar, panel, or other UI primitive — Substrate almost certainly already has one. Triggers on: slider, input, toggle, select, picker, swatch, toolbar, panel, pane, modal, popover, context menu, command palette, progress bar, badge, tabs, tree, layer list, resizer, status bar, zoom, gallery, timeline, easing, node, port, custom component, build my own, write a slider, from scratch, install, substrate-kit add."
4
+ user-invocable: true
5
+ ---
6
+
7
+ # Install Substrate components
8
+
9
+ **Before you write any UI primitive from scratch, check this catalogue.** Substrate ships a slider, number input, colour picker, toggle, select, context menu, command palette, toolbar, panel, timeline, easing editor, node graph, and many more — installable with a single command.
10
+
11
+ ## How to install
12
+
13
+ All Substrate components install through the Substrate CLI, **not** by hand-rolling them or copying from other registries:
14
+
15
+ ```bash
16
+ npx substrate-kit add <component-name>
17
+ ```
18
+
19
+ Install several at once:
20
+
21
+ ```bash
22
+ npx substrate-kit add slider number-input toggle colour-picker
23
+ ```
24
+
25
+ Install every component in a category:
26
+
27
+ ```bash
28
+ npx substrate-kit add --category substrate/ui/form
29
+ npx substrate-kit add --category substrate/ui/control
30
+ ```
31
+
32
+ Open an interactive picker (no arguments):
33
+
34
+ ```bash
35
+ npx substrate-kit add
36
+ ```
37
+
38
+ List all categories and their components:
39
+
40
+ ```bash
41
+ npx substrate-kit add --list-categories
42
+ ```
43
+
44
+ ### Requirements
45
+
46
+ - Run from a project created with `npx create-substrate` or initialised with `npx @substrate-kit/cli init`. Both add `@substrate-kit/cli` as a dev dependency, which is what makes `npx substrate-kit` resolve. The CLI looks for `components.json` — it will error if it's missing.
47
+ - Components land in `registry/substrate/...` and related aliases defined in `components.json`.
48
+ - Under the hood the CLI delegates to `npx shadcn@latest add` against `https://substrate.georgedrury.co.uk/r/<name>`. Do **not** use the shadcn CLI directly — always go through `substrate-kit add` so the CLI can print theme-override hints and keep the workflow uniform.
49
+
50
+ ### Related CLI commands
51
+
52
+ | Command | What it does |
53
+ | --- | --- |
54
+ | `substrate-kit add <name>` | Install one or more components |
55
+ | `substrate-kit docs <name>` | Read component docs in the terminal |
56
+ | `substrate-kit browse <name>` | Open component docs in the browser |
57
+ | `substrate-kit variables <name>` | Print the theme-override CSS variables for a component |
58
+
59
+ ---
60
+
61
+ ## Don't build these — install them
62
+
63
+ When you catch yourself about to write a custom version of any of these, stop and run `substrate-kit add <name>` instead.
64
+
65
+ ### Form controls — `substrate/ui/form`
66
+
67
+ | Component | Command | Use for |
68
+ | --- | --- | --- |
69
+ | Slider | `substrate-kit add slider` | Any range input — opacity, volume, zoom, numeric sliders |
70
+ | Number Input | `substrate-kit add number-input` | Numeric property fields with drag-to-scrub on the label |
71
+ | Number Slider | `substrate-kit add number-slider` | Combined slider + numeric input on one row |
72
+ | Select | `substrate-kit add select` | Dropdown pickers (blend mode, font family, alignment) |
73
+ | Toggle | `substrate-kit add toggle` | Binary on/off switches (snap, visibility, lock) |
74
+ | Text Area | `substrate-kit add text-area` | Auto-resizing multi-line text input |
75
+
76
+ ### Higher-level controls — `substrate/ui/control`
77
+
78
+ | Component | Command | Use for |
79
+ | --- | --- | --- |
80
+ | Colour Picker | `substrate-kit add colour-picker` | HSV picker with hex/RGB + opacity |
81
+ | Swatch Palette | `substrate-kit add swatch-palette` | Grid of preset colours |
82
+ | Alignment Controls | `substrate-kit add alignment-controls` | Horizontal/vertical align + distribute |
83
+ | Collapsible Pane | `substrate-kit add collapsible-pane` | Expandable section inside a panel |
84
+ | Layer List | `substrate-kit add layer-list` | Sortable list with visibility/lock toggles |
85
+ | Tree List | `substrate-kit add tree-list` | Hierarchical tree with expand/collapse and drag reorder |
86
+ | Node | `substrate-kit add node` | Card-based node with typed input/output ports |
87
+
88
+ ### Chrome (app shell) — `substrate/ui/chrome`
89
+
90
+ | Component | Command | Use for |
91
+ | --- | --- | --- |
92
+ | Surface | `substrate-kit add surface` | Consistent mount point for a creative surface |
93
+ | History Controls | `substrate-kit add history-controls` | Undo/redo buttons wired to the document store |
94
+ | Breadcrumbs | `substrate-kit add breadcrumbs` | Document/frame hierarchy navigation |
95
+ | Command Palette | `substrate-kit add command-palette` | Cmd-K searchable command launcher |
96
+ | Document Tabs | `substrate-kit add document-tabs` | Tab bar for open documents |
97
+ | Resizer | `substrate-kit add resizer` | Draggable split-pane handle |
98
+ | Shortcut Overlay | `substrate-kit add shortcut-overlay` | `?`-triggered keyboard shortcuts overlay |
99
+ | Status Bar | `substrate-kit add status-bar` | Bottom bar for tool/selection/zoom info |
100
+ | Zoom Controls | `substrate-kit add zoom-controls` | Zoom in/out/reset with percentage display |
101
+
102
+ ### Core UI — `substrate/ui`
103
+
104
+ | Component | Command | Use for |
105
+ | --- | --- | --- |
106
+ | Toolbar | `substrate-kit add toolbar` | Floating toolbar with toggle groups and tooltips |
107
+ | Panel | `substrate-kit add panel` | Left/right side panel container |
108
+ | Pane | `substrate-kit add pane` | Content section (header + label + actions) inside a panel |
109
+ | Action | `substrate-kit add action` | Labelled form-row container |
110
+ | Badge | `substrate-kit add badge` | Small status indicator |
111
+ | Context Menu | `substrate-kit add context-menu` | Right-click menu with items, separators, submenus |
112
+ | Empty State | `substrate-kit add empty-state` | Placeholder for empty panels/lists |
113
+ | Popover | `substrate-kit add popover` | Floating content anchored to a trigger |
114
+ | Progress Bar | `substrate-kit add progress-bar` | Horizontal progress indicator |
115
+ | Toast | `substrate-kit add toast` | Notifications with undo, powered by Sonner |
116
+
117
+ ### Animation — `substrate/ui/animation`
118
+
119
+ | Component | Command | Use for |
120
+ | --- | --- | --- |
121
+ | Timeline | `substrate-kit add timeline` | Ruler + playhead + tracks + keyframe diamonds |
122
+ | Easing Curve Editor | `substrate-kit add easing-curve-editor` | Draggable cubic-bezier editor |
123
+
124
+ ### Visualisation — `substrate/ui/visualization`
125
+
126
+ | Component | Command | Use for |
127
+ | --- | --- | --- |
128
+ | Gallery | `substrate-kit add gallery` | Responsive thumbnail grid with selection and actions |
129
+
130
+ ### 2D canvas — `substrate/canvas`
131
+
132
+ | Component | Command | Use for |
133
+ | --- | --- | --- |
134
+ | Design Canvas | `substrate-kit add design-canvas` | The main HTML5 canvas component (pulls in renderer/hit-test/interaction) |
135
+ | Renderer | `substrate-kit add renderer` | Pure Canvas 2D draw functions |
136
+ | Hit Test | `substrate-kit add hit-test` | Point-in-element geometry |
137
+ | Element Factory | `substrate-kit add element-factory` | Factories for rectangle/ellipse/text/etc |
138
+
139
+ ### Canvas hooks — `substrate/canvas` & `substrate/hook`
140
+
141
+ | Hook | Command | Use for |
142
+ | --- | --- | --- |
143
+ | useCanvasRenderer | `substrate-kit add use-canvas-renderer` | rAF render loop with dirty-flag optimisation |
144
+ | useCanvasInteraction | `substrate-kit add use-canvas-interaction` | Pointer-event state machine (idle/pan/create/drag) |
145
+ | useCanvasDrag | `substrate-kit add use-canvas-drag` | Drag tracking (create/move/resize) |
146
+ | useCanvasTransform | `substrate-kit add use-canvas-transform` | Screen↔world coordinate conversion, pan, zoom |
147
+ | useHitTest | `substrate-kit add use-hit-test` | Hit-testing wrapper around canvas state |
148
+ | useKeyboardShortcuts | `substrate-kit add use-keyboard-shortcuts` | Global keyboard shortcut binding |
149
+ | useSelection | `substrate-kit add use-selection` | Multi-select with cmd/shift modifiers |
150
+ | useDragReorder | `substrate-kit add use-drag-reorder` | Pointer-based list reordering |
151
+ | useClipboard | `substrate-kit add use-clipboard` | Copy/cut/paste with system clipboard |
152
+ | useViewport | `substrate-kit add use-viewport` | Pan/zoom state for canvas surfaces |
153
+ | useUndoable | `substrate-kit add use-undoable` | Lightweight undo/redo stack |
154
+
155
+ ### Stores — `substrate/store`
156
+
157
+ | Store | Command | Use for |
158
+ | --- | --- | --- |
159
+ | document-store | `substrate-kit add document-store` | Elements, camera, selection, history |
160
+ | tool-store | `substrate-kit add tool-store` | Active tool + temporary tool support |
161
+ | panel-store | `substrate-kit add panel-store` | Left/right panel visibility, open panes |
162
+ | animation-store | `substrate-kit add animation-store` | Playback: duration, time, play/pause |
163
+
164
+ ### Libraries — `substrate/lib`
165
+
166
+ | Lib | Command | Use for |
167
+ | --- | --- | --- |
168
+ | types | `substrate-kit add types` | Core canvas type definitions |
169
+ | math | `substrate-kit add math` | Geometry helpers (rotate, clamp, hit, distance) |
170
+ | id | `substrate-kit add id` | `crypto.randomUUID` wrapper |
171
+ | color | `substrate-kit add color` | OKLCh parsing and manipulation |
172
+ | keyboard-shortcuts | `substrate-kit add keyboard-shortcuts` | Declarative shortcut registration + formatting |
173
+ | snap | `substrate-kit add snap` | Grid + smart edge snapping |
174
+ | bounding-box | `substrate-kit add bounding-box` | AABB union/intersect/contain/expand |
175
+ | easing | `substrate-kit add easing` | Cubic bezier easing presets and evaluation |
176
+
177
+ ---
178
+
179
+ ## Rules of thumb
180
+
181
+ 1. **If you're about to write a form control, stop.** `slider`, `number-input`, `number-slider`, `select`, `toggle`, `text-area` already exist. Writing a custom one means throwing away the `data-slot` composition that makes `ActionControls` style children automatically.
182
+ 2. **If you're about to write a colour picker, stop.** `colour-picker` and `swatch-palette` exist.
183
+ 3. **If you're about to write a context menu, command palette, toast, or popover, stop.** All four are in the registry.
184
+ 4. **If you're about to write a panel/pane/toolbar/status bar, stop.** The entire app shell is packaged — see `substrate-scaffold` for composition patterns.
185
+ 5. **If you're about to write a canvas renderer or hit-test from scratch, stop.** `design-canvas` bundles the renderer, hit-test, interaction state machine, and keyboard shortcuts.
186
+ 6. **Never use `npx shadcn@latest add` directly** for Substrate components — go through `substrate-kit add` so theme hints and workflow stay consistent.
187
+
188
+ ## Cross-references
189
+
190
+ | Want a domain overview? | Skill |
191
+ | --- | --- |
192
+ | Form controls and property editors | **substrate-controls** |
193
+ | App shell (toolbar, panels, tabs, status bar) | **substrate-scaffold** |
194
+ | Spatial hooks (viewport, selection, snapping) | **substrate-canvas** |
195
+ | Node graph (nodes, ports, wires) | **substrate-nodes** |
196
+ | Status/notification/discovery UI | **substrate-feedback** |
197
+ | Selection/undo/clipboard/shortcuts wiring | **substrate-interaction** |
198
+ | Building a new playground | **scaffold-playground** |
199
+ | Composing a property panel | **composing-panels** |
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: scaffold-playground
3
+ description: "Bootstrap a new Substrate playground from scratch — choose a surface type, install chrome primitives, and compose the surface + panels + toolbar layout. Use when starting a new interactive app or initialising Substrate in an existing project. Triggers on: new playground, scaffold, bootstrap, start project, substrate create, substrate init, set up Substrate, new app, starter."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # Scaffold a Substrate playground
2
8
 
3
9
  Step-by-step guide to bootstrapping a new interactive playground from Substrate primitives.
@@ -11,7 +17,7 @@ A Substrate playground is a creative app built from composable primitives: a **s
11
17
  A Next.js 14+ project with Tailwind CSS and the shadcn CLI configured. If you don't have one, run:
12
18
 
13
19
  ```bash
14
- npx substrate create my-playground
20
+ npx create-substrate my-playground
15
21
  ```
16
22
 
17
23
  This scaffolds a full project with dependencies, globals.css with Substrate tokens, and a starter playground page.
@@ -19,7 +25,7 @@ This scaffolds a full project with dependencies, globals.css with Substrate toke
19
25
  To add Substrate to an existing project instead:
20
26
 
21
27
  ```bash
22
- npx substrate-kit init
28
+ npx @substrate-kit/cli init
23
29
  ```
24
30
 
25
31
  This installs skills, CLAUDE.md, components.json, and registers the MCP server.
@@ -40,7 +40,7 @@ A horizontal row that auto-styles its children:
40
40
  | `colour-swatch` | `size-4`, removes border |
41
41
  | `slider` | Removes border |
42
42
 
43
- **Exports**: `ActionControls`, `ActionLabel`, `ActionSeparator`
43
+ **Exports**: `Action`, `ActionLabel`, `ActionControls`
44
44
 
45
45
  **Typical use**: Group a label + one or more controls on a single row inside a pane.
46
46
 
@@ -173,14 +173,12 @@ Cubic bezier editor with draggable control points and real-time preview.
173
173
  <ActionControls>
174
174
  <ActionLabel>X</ActionLabel>
175
175
  <NumberInput value={x} onChange={setX} onStart={pushSnapshot} />
176
- <ActionSeparator />
177
176
  <ActionLabel>Y</ActionLabel>
178
177
  <NumberInput value={y} onChange={setY} onStart={pushSnapshot} />
179
178
  </ActionControls>
180
179
  <ActionControls>
181
180
  <ActionLabel>W</ActionLabel>
182
181
  <NumberInput value={w} onChange={setW} min={0} onStart={pushSnapshot} />
183
- <ActionSeparator />
184
182
  <ActionLabel>H</ActionLabel>
185
183
  <NumberInput value={h} onChange={setH} min={0} onStart={pushSnapshot} />
186
184
  </ActionControls>
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: theming
3
+ description: "Customise the visual appearance of Substrate — CSS variable fallback chains (Tailwind v4), canvas background, chrome tokens, element colours, and per-component overrides exposed by the registry. Use when restyling, rebranding, or matching a design system. Triggers on: theme, theming, colors, palette, CSS variables, design tokens, rebrand, dark mode, Tailwind v4, canvas colour, chrome styling, override tokens."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # Theming Substrate
2
8
 
3
9
  Guide to customising the visual appearance of Substrate's canvas, UI chrome, and elements.
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: wire-interactions
3
+ description: "Wire up Substrate's interaction pipeline — pointer events, drag state machine, hit testing, coordinate transforms, mutations, and keyboard shortcuts. Use when connecting a canvas surface to the document store or debugging interaction flows. Triggers on: pointer events, drag, interaction state machine, hit test, useCanvasInteraction, useCanvasDrag, useCanvasTransform, keyboard shortcut, wire up, connect canvas."
4
+ user-invocable: true
5
+ ---
6
+
1
7
  # Wire interactions
2
8
 
3
9
  Guide to connecting canvas pointer events, drag state, keyboard shortcuts, and the interaction state machine in Substrate.