dream
Create a Three.js + WebXR game from scratch starting from a concept description
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Create a Three.js + WebXR game from scratch starting from a concept description
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
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