--- name: scaffold-app description: Scaffold a new OGPU example/app from scratch — a Renderer + Camera + Orbit + update loop and a single spinning cube wired through the vanilla Box primitive -> RenderPipeline -> Mesh setup. Use whenever the user wants a new OGPU example, a base/starter scene, a blank WebGPU sketch in this repo, "scaffold an app", "new example called X", "boilerplate a OGPU scene", "set me up a starting point", or just "new scene"/"new example" when OGPU is the implied target. Generates the example class + shader and wires it into src/main.js so it boots at ?src=. --- # Scaffold a OGPU example Stand up a complete, runnable OGPU example: renderer boot, camera + orbit controls, an update loop, and one spinning cube built the canonical way — `new Box(gpu)` → `new RenderPipeline(...)` → `new Mesh(...)`. The point is a clean, idiomatic starting point the user immediately builds on, not a finished piece. A shell script generates the two files (class + shader); you wire it into `src/main.js` afterward. The split exists because file generation is fixed boilerplate (delegate it) but the `main.js` edits are structured insertions into an existing file (do them precisely with Edit). ## Workflow 1. Get the example name. It's used verbatim as the class name; the directory and `?src=` value are its lowercased form. Convention here is a PascalCase class in a lowercase dir (e.g. `HelloWebGPU` in `hellowebgpu/`). If the user gives a casual name, PascalCase it for the class. 2. Run the generator from anywhere (it resolves the repo root itself): ```bash .claude/skills/scaffold-app/scripts/scaffold-app.sh ``` It creates `examples//.js` + `examples//cube.wgsl` and refuses to overwrite an existing example dir (surface the error, don't force). 3. Wire `src/main.js` — three insertions, matching the surrounding style: - an `import { } from '@examples//';` with the others; - a `: () => new (),` entry in the `views` map; - a `{ view: '', label: '