Setup
- Install Node 22.6 or newer and pnpm once. No Rust is needed: the physics WASM comes prebuilt.
- Clone the repo, open it as the workspace folder, and run pnpm i && pnpm fetch-assets in the terminal.
- The rule in .cursor/rules/pebble3d.mdc is applied to every request in this repo.
- Use agent mode, so it can run pnpm shot and the tests in the terminal.
Rules file:
.cursor/rules/pebble3d.mdc.
An always-on project rule that summarises the invariants and points at AGENTS.md.
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 Cursor can verify
| Command | What 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
- Add llms.txt or a specific docs page to the chat context when you start a larger task.
- If your model accepts images, attach the PNG from artifacts/shots/ so it can see the result.
Next: Getting started builds a first scene and a minimal game app, and the demos show what the engine can do.
Cursor 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.