Getting started
spock isn’t published to npm yet. Its packages live in a pnpm workspace, and apps use them from there as TypeScript source, with no build step. So for now, a spock app lives inside the workspace too.
Run the template
Section titled “Run the template”git clone https://github.com/north-shore-software/spock.gitcd spockpnpm installpnpm devpnpm dev starts the simple template (templates/simple), a React and Vite app with a route tree, a seeded store and
a few demo pages. The dev toolbar appears at the bottom of the page.
Start a new app
Section titled “Start a new app”Copy the template to a new folder under templates/, and give it a new name in its package.json:
cp -r templates/simple templates/my-app# edit templates/my-app/package.json: "name": "@spock/my-app"pnpm installpnpm --filter @spock/my-app devThen replace the template’s outline with your own. The outline lives in three files:
| File | What it decides |
|---|---|
src/router.ts |
The screens, how they nest, their URLs, and the node each is bound to |
src/data/bindings.ts |
How a route’s params pick a record |
src/data/store.ts |
The entities, their fields, and how they nest |
The router overview explains how they fit together.
Working with a coding agent
Section titled “Working with a coding agent”The template has an AGENTS.md (and a CLAUDE.md that points to it). It tells an agent how the app is structured,
and to ask before it changes the outline. Keep it in your copy.