Build with Claude Code

Run it in the repo root: CLAUDE.md points it at AGENTS.md, and it can open the PNGs that pnpm shot writes.

Setup

  1. Install Node 22.6 or newer and pnpm once. No Rust is needed: the physics WASM comes prebuilt.
  2. Clone the repo and run pnpm i && pnpm fetch-assets. For pnpm shot, also run pnpm exec playwright install chromium once.
  3. Start Claude Code in the repo root. It picks up CLAUDE.md, which sends it to AGENTS.md.
  4. Let it run pnpm commands, so it can shoot, test and lint without asking each time.

Rules file: CLAUDE.md. The repo's CLAUDE.md is one line that points at AGENTS.md, so the same rules apply to every agent.

A prompt that works

Every command in it is documented in the repo, so the agent can follow it without guessing. Paste it as-is, then change the scene to what you want.

Read AGENTS.md and docs/getting-started.md first.

Create apps/playground/scenes/tower.json: the "studio" preset with a ground,
a prefab "brick" (a 0.5 m dynamic box) stacked into a 4 x 4 tower 8 bricks high,
and a heavy sphere that starts 6 m above the tower and drops onto it.
Add a camera preset "hero" that frames the whole tower.
Validate the file against packages/sdk/scene.schema.json.

Then run:  pnpm shot --scene tower --cam hero --ticks 240
Open the PNG it writes in artifacts/shots/ and read the JSON sidecar next to it.
If the sidecar lists console errors, the tower is out of frame, or nothing fell,
fix the scene and shoot again. Finish with pnpm test and pnpm lint.

What Claude Code can verify

CommandWhat it proves
pnpm shot --scene <name> --cam hero Renders a scene in Chromium and writes a PNG plus a JSON sidecar with the adapter, render stats, state hash, tick and console. Exits 1 on any unexpected console warning or error. Needs a GPU.
pnpm shot --app rockfall --param demo=1 --ticks 600 The same for a game app, driven by its ?demo=1 autoplayer bot. Needs a GPU.
node --experimental-strip-types packages/sdk/test/determinism.mjs --expect "$(cat packages/sdk/test/fixtures/det-hash.txt)" Runs the determinism fixture in Node; it must print 2d76d9927e780425.
pnpm test && pnpm typecheck && pnpm lint Unit tests (including Node runs of the game sims on the real wasm), types and lint.
pnpm --filter chain-reaction verify Replays every puzzle solution headless in Node and checks the stored state hashes.
pnpm docs:gen --check Fails if the generated scene and API references are stale after a schema or export change.

Details, flags and the console-error policy: Verification. A failing check and its fix: Troubleshooting.

Tips

Next: Getting started builds a first scene and a minimal game app, and the demos show what the engine can do.

Claude Code is a product of its owner. Pebble3D is not affiliated with or endorsed by it; this page only describes how the repo's files work with it.