/runner-new — Scaffold a game
Goal
Create games/{slug}/index.html + game.js from the closest demo/template, with unique storage keys and themed CSS variables.
Input examples
/runner-new skate --template wing --title "SKATE RUSH"
/runner-new toboggan --template ski
/runner-new night-lane --template moto --title "NIGHT LANE"
Process
- Resolve
--template(required). Unknown → list ids and stop. - Slugify name; refuse if
games/{slug}/already exists unless user confirms overwrite (L2). - L1 plan — list files (
@../../rules/approval-gate.md). - Copy structure from:
- Live engine demos:
demos/runner-kit-3d/games/{template}/when present in repo, or - Kit
_templates/stubs + fill from@../../../references/control-patterns.md
- Live engine demos:
- Replace title, CSS
--accent/--bg, storage keys ({slugcompact}-scores,-best,-name). - Ensure
game.jsimports from../../kit/index.js(or correct relative path). - Report next steps:
npm run dev, open/games/{slug}/, optional hub card.
Output
games/{slug}/
index.html
game.js
Mandatory rules
- Unique leaderboard keys
- No mid-game mesh allocation patterns
- Keep
window.__gamefor debug if template had it - Fonts: Be Vietnam Pro + Outfit (Vietnamese-safe)
References
- @../../rules/runner-conventions.md
- @../../rules/naming-conventions.md
- @../../rules/approval-gate.md
- @../../../_templates/
- @../../../references/control-patterns.md