threejs-game-generator-skill
Skill20 starsChanged 2 months agoMITView on GitHub
Build, extend, or polish original 3D browser games and interactive prototypes with Three.js. Use when a user wants a playable WebGL game, a game-like Three.js experience, a 2D concept translated into 3D, or an existing Three.js project given a complete loop, controls, camera, collisions, UI states, audio, persistence, performance work, or production-build verification. Do not trigger for ordinary 3D product viewers, data visualizations, or decorative background scenes unless the request includes game mechanics or player interaction.
In this repository7 other files it gives its agents.
- crazy-ecommerce-builder-skillSkill
- create-svgSkill
- generative-filmSkill
- landing-page-generator-skillSkill
- motion-studioSkill
- premium-ui-revamp-skillSkill
- talking-avatar-skillSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 22 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈22
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
New game: create the smallest maintainable project that fits the request.
- Distinctive: line 18
Scene-to-game: keep the useful scene, then add an explicit goal, player verbs, feedback, failure or completion, restart, and progression.
- Distinctive: line 21
Do not publish, buy assets, call paid services, or mutate external systems unless the user explicitly asks.
- Distinctive: line 27
Write a compact contract before implementation:
- Distinctive: line 36
When the user names an existing title, borrow only high-level interaction ideas.
- Distinctive: line 40
Read engine-patterns.md when setting up or changing the game loop, renderer, controls, camera, collisions, loading, persistence, object …
- Distinctive: line 41
Read visuals.md when choosing lighting, materials, procedural geometry, asset style, atmosphere, UI treatment, shadows, or quality tiers.
- Distinctive: line 42
Read audio-recipes.md when the game needs music, feedback sounds, spatial audio, user-gesture activation, or mixing.
- Distinctive: line 43
Read genres.md when the brief needs a viable mechanic set, camera/control mapping, content budget, or genre-specific risk check.
- Distinctive: line 45
Do not load every reference by default.
- Distinctive: line 58
Run the current project when possible.
- Distinctive: line 67
start, active, paused, completed/failed, and restart states.
- Distinctive: line 70
Use graybox geometry until scale, movement, camera, and pacing work.
- Distinctive: line 74
Use the project patterns in engine-patterns.md.
- Distinctive: line 85
no secrets in client code.
- Distinctive: line 87
Add a physics engine only when the mechanic genuinely needs rigid-body simulation.
- Distinctive: line 100
Add secondary systems only after the core loop is enjoyable.
- Distinctive: line 104
Read visuals.md. Define a small palette, lighting model, shape language, material family, and atmosphere.
- Distinctive: line 106
Keep color textures in the correct color space, cap expensive shadows, avoid per-frame allocations, and reduce pixel ratio or effects …
- Distinctive: line 110
Read audio-recipes.md if audio is in scope.
- Distinctive: line 116
Run the production build first and fix every error.
- Distinctive: line 120
start → play → pause/resume → win/lose → restart works without reloading.
- Distinctive: line 121
every documented control works, including touch when promised.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Three.js Game Generator
Turn a game brief or an unfinished Three.js scene into a small, complete browser game. Lead with one satisfying playable loop, make the direction original, work in the user's existing stack, and verify the result in a real browser.
Choose the operating mode
- New game: create the smallest maintainable project that fits the request. Default to Three.js with Vite when no stack exists.
- Existing game: preserve the package manager, architecture, routes, assets, controls, and working systems. Change only what the requested outcome needs.
- Scene-to-game: keep the useful scene, then add an explicit goal, player verbs, feedback, failure or completion, restart, and progression.
- Polish pass: profile and play the current build before changing it. Fix broken feedback, camera, controls, pacing, performance, and state transitions in that order.
Do not publish, buy assets, call paid services, or mutate external systems unless the user explicitly asks.
Establish the game contract
Infer what is missing when the brief is loose, but do not silently expand a prototype into a large production.
Write a compact contract before implementation:
- Fantasy: what the player should feel they are doing.
- Core loop: the repeatable action, response, reward, and escalation.
- Win, loss, or completion: how a run ends and how the player restarts.
- Camera and controls: perspective, movement model, input devices, and touch behavior.
- Visual thesis: one recognizable art direction tied to the mechanic.
- Scope: the smallest content set that proves the loop, plus explicitly deferred features.
When the user names an existing title, borrow only high-level interaction ideas. Create original characters, environments, layouts, UI, names, audio, and art.
Read references selectively
- Read engine-patterns.md when setting up or changing the game loop, renderer, controls, camera, collisions, loading, persistence, object lifetime, or performance.
- Read visuals.md when choosing lighting, materials, procedural geometry, asset style, atmosphere, UI treatment, shadows, or quality tiers.
- Read audio-recipes.md when the game needs music, feedback sounds, spatial audio, user-gesture activation, or mixing.
- Read genres.md when the brief needs a viable mechanic set, camera/control mapping, content budget, or genre-specific risk check.
Do not load every reference by default.
Workflow
1. Inspect the workspace
Identify:
- package manager, scripts, entry points, Three.js version, addons, and build tool;
- current scene graph, renderer, cameras, input, state management, physics, assets, UI, and audio;
- the production build command and any existing tests;
- local modifications that must be preserved.
Run the current project when possible. Record visible failures and browser console errors before editing. Do not replace a functioning project merely to use a preferred scaffold.
2. Prove a vertical slice
Build the smallest complete loop before adding breadth:
- one controllable player or primary interaction;
- one objective and one meaningful obstacle;
- visible feedback for success, damage, collection, or progress;
- start, active, paused, completed/failed, and restart states;
- a 30–180 second play session that demonstrates the intended feel.
Use graybox geometry until scale, movement, camera, and pacing work. A beautiful scene without a finishable loop is not a game.
3. Build stable foundations
Use the project patterns in engine-patterns.md. Keep these invariants:
- one renderer and one authoritative animation loop;
- frame-rate-independent movement with a capped delta, or a fixed simulation step when determinism matters;
- explicit game states rather than scattered booleans;
- input sampled into actions so keyboard, pointer, gamepad, and touch can share game logic;
- world units and coordinate conventions chosen once and used consistently;
- capped device pixel ratio and a resize path that updates renderer and camera;
- reusable geometry/materials and intentional disposal of GPU resources;
- HTML UI for readable menus, settings, and HUD unless 3D placement is essential;
- asset loading with progress and failure states;
- no secrets in client code.
Add a physics engine only when the mechanic genuinely needs rigid-body simulation. Use simple spheres, boxes, capsules, raycasts, or spatial partitioning for arcade movement when they are sufficient.
4. Implement the feel
Tune input, movement, camera, and feedback together:
- controls should respond immediately and remain predictable at low and high frame rates;
- camera follow should use damping and bounded look-ahead rather than raw player transforms;
- collisions should produce readable consequences, not silent blocking;
- actions need anticipation, impact, and recovery appropriate to the genre;
- screen shake, hit pause, particles, trails, and post-processing must remain restrained and disable cleanly for reduced motion or lower quality;
- touch targets and virtual controls must fit the actual viewport and not cover critical play space.
Add secondary systems only after the core loop is enjoyable.
5. Art-direct one world
Read visuals.md. Define a small palette, lighting model, shape language, material family, and atmosphere. Prefer a coherent low-complexity world over a mixture of unrelated high-detail assets.
Keep color textures in the correct color space, cap expensive shadows, avoid per-frame allocations, and reduce pixel ratio or effects before reducing gameplay clarity. Credit and document every external asset and its license.
6. Add audio and persistence proportionally
Read audio-recipes.md if audio is in scope. Start audio only after a user gesture, expose mute and volume controls, and keep critical feedback understandable without sound.
Persist only useful state such as settings, best score, unlocked level, or checkpoint. Version stored data and recover safely from missing or invalid values.
7. Verify the actual game
Run the production build first and fix every error. Then test the built or development version in a browser.
Check:
- start → play → pause/resume → win/lose → restart works without reloading;
- every documented control works, including touch when promised;
- resize, orientation change, backgrounding, and focus loss do not corrupt state;
- browser console has no uncaught errors or missing assets;
- UI is readable and keyboard accessible;
- audio activation and mute behavior are correct;
- save data survives a reload and invalid save data does not crash;
- the busiest scene remains responsive on the target device class;
- reduced-motion and lower-quality modes remove expensive effects without hiding essential feedback.
Play at least one complete run. Automated build success alone is insufficient.
Quality bar
- A stranger can understand the objective and controls without reading source code.
- The first meaningful interaction arrives quickly.
- The game has a complete loop and restart flow, not only a scene or technical demo.
- Camera, movement, collision, and feedback feel like one system.
- The art direction is recognizable and original.
- Performance degrades gracefully before it becomes unplayable.
- The project remains understandable enough to extend.
Avoid
- recreating copyrighted characters, levels, UI, music, or branded assets;
- installing a large engine or physics stack before proving it is necessary;
- one file containing rendering, input, state, UI, audio, and every entity;
- tying movement directly to frame count;
- allocating vectors, materials, geometries, or loaders inside the hot loop;
- unbounded particles, lights, shadow casters, or device pixel ratio;
- pointer lock with no escape path or touch controls with no desktop fallback;
- hiding load failures, unsupported WebGL, or missing credentials behind a blank canvas;
- shipping a polished title screen around an unfinished mechanic.
Handoff
Lead with how to run the game. Then report:
- the implemented core loop and control map;
- build and playtest commands with results;
- asset sources and licenses;
- browser/device limitations;
- deferred features that were intentionally kept out of scope.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

