dream
Create a Three.js + WebXR game from scratch starting from a concept description
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Create a Three.js + WebXR game from scratch starting from a concept description
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Run build verification โ checks compilation, validates level configs, finds missing imports
Add a game mechanic by implementing a puzzle class with world objects and interaction wiring
Create or modify a game level with environment, decorations, and props
Run semantic validation on a generated game โ checks level configs, puzzle wiring, level transitions, decoration types, and model references
| name | dream |
| description | Create a Three.js + WebXR game from scratch starting from a concept description |
| argument-hint | <game description> [<assets-folder-path>] |
| user-invocable | true |
| allowed-tools | Read, Bash, Glob, Grep, Write, Edit, AskUserQuestion |
| agent | architect |
| context | fork |
You are invoked via /dream <concept> [<assets-folder-path>]. Your job is to turn a natural language game concept into a fully scaffolded, runnable Three.js + WebXR game.
AskUserQuestion to gather preferences and get design approval. Phase 2 (Execution) is autonomous โ NEVER ask questions, complete ALL remaining steps in a single run.Read the CLAUDE.md file in the repo root to understand project structure, conventions, and paths.
/dream <game concept description> [<assets-folder-path>]
The arguments string contains the game concept and an optional path to a folder of .glb 3D model files.
Parsing rules:
/, ~/, ./, or ../)~ to the user's home directory and check if it resolves to an existing directory using lsExamples:
/dream a VR escape room in a haunted mansion with 3 puzzles
โ concept: a VR escape room in a haunted mansion with 3 puzzles, assets: none/dream a forest adventure ~/my-models
โ concept: a forest adventure, assets: ~/my-models (expanded to full path)/dream space station mystery ./assets/space-glbs
โ concept: space station mystery, assets: ./assets/space-glbs/dream un gioco VR in una foresta magica
โ concept: un gioco VR in una foresta magica, assets: noneParse the description. Infer preliminary:
If an assets folder was provided:
.glb files in the folder (non-recursive): ls <path>/*.glb.glb files, inform the user and proceed without assetsImportant: All .glb models must have their pivot (origin) at the bottom-center of the mesh for correct auto-grounding. If the user asks about asset preparation, remind them of this requirement.
Use AskUserQuestion with up to 4 questions to clarify the design. Tailor questions to what's ambiguous โ skip questions where the concept is already clear. Example questions:
Process the user's answers. If something critical is still unclear, ask ONE follow-up AskUserQuestion at most. Otherwise, proceed.
games/<slug>/ directoryWrite games/<slug>/GAME_DESIGN.md and games/<slug>/DEVELOPMENT_PLAN.md incorporating the user's preferences.
If assets were provided, include an Asset Assignments table in GAME_DESIGN.md:
## Asset Assignments
| Model File | Level | Role | Notes |
|---|---|---|---|
| `door.glb` | 1 | Interactive prop | Multipart; animate child "handle" for open |
| `enemy.glb` | 2 | Enemy patrol | Has skeleton + walk animation; translation-independent |
| `gem.glb` | 2 | Collectible | โ |
| `fountain.glb` | shared | Decoration | โ |
The Notes column captures technical metadata the user provides about their models. Downstream agents (/scene, /mechanic) use these hints for correct implementation. Common notes include:
During the design questions (Step 3), when assets are provided, ask the user about any technical details for their models.
Use AskUserQuestion to present a summary of the design and ask for approval:
If the user wants changes: update the design docs accordingly and re-present (max 2 revision rounds, then proceed with best effort).
From this point on, do NOT use AskUserQuestion. Complete everything autonomously.
framework/templates/).tpl file{{VARIABLES}} with values derived from the design:
{{GAME_NAME}} โ from concept{{GAME_SLUG}} โ kebab-case version{{GAME_DESCRIPTION}} โ one-line summary{{AUTHOR}} โ from git config or "Developer"{{YEAR}} โ current year{{THREE_VERSION}} โ ^0.170.0{{VITE_VERSION}} โ ^6.0.0{{PLAYER_HEIGHT}} โ 1.6{{MOVE_SPEED}} โ 4.0 (adjust for genre: 2.0 for horror, 6.0 for action){{SNAP_ANGLE}} โ Math.PI / 4games/<slug>/ (strip .tpl extension, maintain directory structure):
framework/templates/project/* โ games/<slug>/framework/templates/src/**/* โ games/<slug>/src/**/*games/<slug>/public/models/ directory with subdirectories for each levelRun npm install inside games/<slug>/.
If assets were provided, also install the compression tooling:
cd games/<slug> && npm install --save-dev @gltf-transform/cli
Only if assets were provided. For each model in the Asset Assignments table:
# Create target directory
mkdir -p games/<slug>/public/models/<levelId>
# Draco-compress and place
npx gltf-transform draco <source-path>/<filename.glb> games/<slug>/public/models/<levelId>/<filename.glb>
If Draco compression fails for a specific file, fall back to a plain copy:
cp <source-path>/<filename.glb> games/<slug>/public/models/<levelId>/<filename.glb>
Models assigned to shared go to public/models/shared/. Unassigned models also go to public/models/shared/.
For each level in the design, invoke the /scene skill:
/scene games/<slug> 1 "level 1 description from design"
/scene games/<slug> 2 "level 2 description from design"
For each mechanic in the design, invoke the /mechanic skill:
/mechanic games/<slug> "mechanic description from design"
Invoke /build games/<slug> to check that everything compiles.
Invoke /test games/<slug> for semantic validation (level configs, puzzle wiring, transitions, imports).
Print:
Game "<name>" scaffolded successfully in games/<slug>/!
Levels:
- Level 1: https://localhost:5173/?level=1
- Level 2: https://localhost:5173/?level=2
...
Custom Assets:
- tree_oak.glb โ Level 1 (Draco compressed)
- chest.glb โ Level 2 (Draco compressed)
...
Run `cd games/<slug> && npm run dev` to start the development server.
Omit the "Custom Assets" section if no assets were provided.
npm install fails: Retry once, then continue โ /build will catch it@gltf-transform/cli install fails: Log warning, fall back to plain cp for all asset filescp for that file, log which files were copied vs. compressed/scene or /mechanic fails: Log the error, continue with remaining skills/build fails: Attempt auto-fix for missing imports, re-run once. If still failing, report errors in summary/test fails: Report validation warnings/errors in summary โ they indicate semantic issues (missing models, orphan levels, etc.)public/models/)All templates are in framework/templates/ with this structure:
project/ โ package.json.tpl, vite.config.js.tpl, index.html.tpl
src/
main.js.tpl
engine/ โ Engine.js.tpl, VRSetup.js.tpl, DesktopControls.js.tpl
events/ โ EventBus.js.tpl
input/ โ InputActions.js.tpl, InputManager.js.tpl
locomotion/ โ LocomotionSystem.js.tpl
interaction/ โ Interactable.js.tpl, InteractionSystem.js.tpl
collision/ โ CollisionSystem.js.tpl
decorations/ โ DecorationRegistry.js.tpl, builtins.js.tpl
assets/ โ AssetLoader.js.tpl, ObjectFactory.js.tpl
levels/ โ LevelLoader.js.tpl, LevelTransition.js.tpl
audio/ โ AudioManager.js.tpl
ui/ โ HUD.js.tpl
puzzle/ โ PuzzleBase.js.tpl, PuzzleManager.js.tpl