# The generation prompt pack

Paste **§2 verbatim** into a capable coding model (Claude, Grok, GPT), with your own game idea in
the `GAME BRIEF` slot. Everything the model needs is either in the prompt or in the four files it
names.

---

## 1. What the model must be able to read

Exactly these, and nothing else:

| file | why |
|---|---|
| `docs/STACK.md` | the contract guide. Complete on its own; assumes no prior knowledge. |
| `docs/PACKS.md` | ⭐ the default medium — physics, movement, camera. **Hand this over whenever the game has solids, a character to embody, or a follow camera.** Skip it only for a game whose own simple motion is genuinely enough. |
| `scaffold/` | the code it builds into. `src/substrate.js` is copied in unchanged; the other four files are worked examples of every contract. |
| `tools/verify.mjs` | the checker it runs on its own output. |
| `docs/CHECKLIST.md` | the self-check it works through before saying it is done. |

If the model has this `product/` folder open as the workspace, **that is the whole answer**.
Also read `BRIEF.md` at the product root for the game to build.

⚠️ **Do not paste `SUBSTRATE.md`, `STATE.md` or `PROTOCOL.md`.** Those are written for people
maintaining DevTune, and they discuss failures, history and open questions that a model building a
game will read as instructions.

---

## 2. The prompt

> ---
>
> # Build a three.js game that is born owned
>
> You are building a genuinely playable three.js game **with the DevTune product pack** (this
> folder), so a designer can tune its feel the moment it boots — no reverse-engineering afterwards.
> Follow **BRIEF.md** for the game design.
>
> ## Read first
>
> 1. **`docs/STACK.md`** — the contract guide. It is complete; read all of it before writing code.
> 2. **`docs/PACKS.md`** — the default medium. If the game has solids, a character, or a follow
>    camera, build through the physics / movement / camera packs rather than hand-rolling them.
>    ⚠️ Its first rule decides whether any of it is tunable: **declare each pack's tune at YOUR call
>    site and pass it in.** A pack that builds its own settings produces values the desk never sees.
> 3. **`scaffold/src/player.js`, `world.js`, `motes.js`, `main.js`** — worked examples of every
>    contract. Match their shape.
>
> ## Start from the scaffold
>
> Copy `scaffold/` to `games/horizon-courier/` (or the name in BRIEF.md). Then:
>
> - **`src/substrate.js` is copied in UNCHANGED.** Do not edit it. Do not reimplement it.
> - **`index.html`** — keep the `?pump` script block and the three.js `0.160.0` importmap exactly as
>   they are. Change the title, the HUD and the styling freely.
> - Everything else is yours to rewrite, extend or delete.
>
> ## GAME BRIEF
>
> ```
> {{ describe the game here — genre, the one thing the player does, win/lose if any }}
> ```
>
> ## Non-negotiable requirements
>
> 1. **It is playable.** A person can pick it up, understand the controls in five seconds, and have
>    something to do. Not a scene with a camera orbiting it.
> 2. **At least one movement/feel system is owned and live** — read from the settings object every
>    frame, so a dial is felt immediately.
> 3. **At least one system is deferred** (`readAt: 'spawn'` or `'nextWave'`) **if the game genuinely
>    has that boundary.** If it does not, do not invent one — say so instead.
> 4. **The game's own colliders are handed over with `collide()`**, and exactly one piece of code
>    owns each overlap.
> 5. **Authored ranges only where you mean them.** `[min, max]` is a design statement about what a
>    designer may scrub between. Where you have no real opinion, leave it off — the desk says
>    `NO RANGE DECLARED`, which is honest. **Never write a range to make the UI look nicer.**
> 6. **Own inputs, never outputs.** A velocity, a current hp, a computed distance are outputs. Own
>    the numbers they are computed *from*.
> 7. **No central config object.** Each system declares its own numbers in its own file, as a literal
>    at the call site. A shared `CONFIG` that other files import from puts every value one hop away
>    from the literal, and a value one hop away can be owned and cannot be saved.
> 8. **The game runs with DevTune absent.** `substrate.js`'s contracts are identity functions when
>    nothing is attached; if the game needs them to *do* something, the design is wrong.
> 9. **Do not use `C` as a game key.** It opens the Design desk.
>
> ## Check your own work
>
> ```bash
> npx devtune verify games/<your-game-name>
> npx devtune smoke games/<your-game-name>
> ```
>
> **`✓ BORN OWNED` (verify) and `✓ SMOKE PASS` are both required.** Verify alone can be green while
> the game cannot boot under serve (Horizon F6). Every verify rule is a SILENT failure at runtime —
> the game plays perfectly and the desk is empty, or full of dials that do nothing. Do not skip
> either gate, and do not talk yourself past a fatal. Two fatals that burned Horizon:
> **`bind-mega-group`** (never `bind` the parent Group that holds the world) and
> **`import-outside-serve`** (pack imports must resolve under the game or product/medium|vendor mounts).
>
> Then work through **`docs/CHECKLIST.md`** and answer every line honestly. Where something is not
> done, say it is not done — a false green here is worse than a gap, because the whole point of this
> tool is that what it tells a designer is true.
>
> ## When you report
>
> Say what you built, which systems are owned, which values are live and which are deferred, what
> the checker said, and **what you could not own and why**. That last one is the most useful thing
> you can report.
>
> ---

---

## 3. Running what comes back

From **`product/`** (preferred):

```powershell
.\start-desk.ps1 -Game <name>
```

Or from monorepo root (parent of `product/`):

```bash
node product/tools/battery.mjs product/games/<name>   # verify + smoke + doctor
node bridge/bridge-server.js
node adapters/serve/serve.mjs product/games/<name> --port 5430 --shell
```

Open `http://127.0.0.1:5430/`, play it, press **`C`** for Design.

Full walkthrough: [`../README.md`](../README.md) · desk path + red gates: [`../RUN.md`](../RUN.md).

---

## 4. Notes on prompting, from actually doing it

- **Give the model a real game idea, not a genre.** "A small action game" produces a tech demo.
  "You are a courier on a rooftop; deliver parcels before the timer, wind pushes you" produces a
  game with feel systems worth owning.
- **The brief decides whether `readAt` is honest.** A game with no spawn boundary and no waves has
  nothing deferred, and a model that invents one to satisfy a checklist has broken rule 3. If you
  want the deferred path exercised, put a spawner or a wave in the brief.
- **Let it choose its own ids.** Namespacing (`weapon.rifle`) is in the guide; a model that picks
  its own names picks names that match its own code, which is the point.
- **Expect the checker to catch something.** It has, every time so far. That is the pipeline
  working, not the model failing.
