Setup
- Install Node 22.6 or newer and pnpm once. No Rust is needed: the physics WASM comes prebuilt.
- Clone the repo and run pnpm i && pnpm fetch-assets yourself first: they download packages and assets.
- Start Codex in the repo root. AGENTS.md is there.
Rules file:
AGENTS.md.
The rules live in AGENTS.md at the repo root: layout, commands, invariants and the before-you-finish checklist.
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 OpenAI Codex 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
- pnpm shot needs a real GPU and refuses a software adapter. In an environment without one, ask for the Node checks instead: tests, the determinism script and the chain-reaction verifier.
- Name the exact commands you want run before it finishes; AGENTS.md lists them under "Before you finish".
Next: Getting started builds a first scene and a minimal game app, and the demos show what the engine can do.
OpenAI Codex 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.