optimize-threejs-games — Claude Code skill: profile Three.js games
A skill that profiles and speeds up Three.js and WebGL games: it finds whether the CPU or the GPU is the bottleneck, then fixes it without breaking gameplay.
npx skills add MengTo/Skills --skill optimize-threejs-games -a claude-codeWhat optimize-threejs-games does
The skill works in a fixed order: measure first, change second. You pick one deterministic encounter and record the device, viewport, quality level, player position, enemies, active effects, frame-time sample, draw calls, triangles, texture count and warnings. Only identical runs are worth comparing.
Diagnosis comes next. Suspect the CPU when simulation, allocations, React work, pathfinding or per-frame scans grow with the number of actors. Suspect the GPU when resolution, overdraw, shadows, transparent particles, post-processing, draw calls, geometry or texture bandwidth dominate. The skill tells the agent to inspect before optimizing, so quality settings don't get lowered blindly.
Low-risk fixes go first: reuse geometry and materials, pool transient effects, cull inactive and offscreen work, throttle noncritical UI updates, cap particle counts, avoid per-frame allocation, update only changed transforms. Render quality stays explicit and reversible, and decorative effects get cut before combat readability or controls. After every change the skill re-runs the original encounter and checks frame time, visual correctness, collision and contact behavior, memory stability, mobile controls, reduced motion and console health. Temporary servers, benchmarks and browser tabs are closed afterwards.
What it helps with
- find whether the CPU or the GPU caps the frame rate
- cut draw calls and texture memory use
- remove per-frame allocations from the game loop
- reduce load on mobile without breaking touch controls
- verify an optimization didn't break collisions or combat readability
Example prompts for the agent
- profile this scene and tell me what's CPU-bound and what's GPU-bound
- cut draw calls and particle counts, keep render quality settings reversible
- re-run the original encounter and check frame time, collisions and the console
How to install optimize-threejs-games
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill optimize-threejs-games -a claude-code2Manually: put the files in place
~/.claude/skills/optimize-threejs-games/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/optimize-threejs-games/
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill optimize-threejs-games -a codex2Manually: put the files in place
.agents/skills/optimize-threejs-games/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill optimize-threejs-games -a cursor2Manually: put the files in place
.cursor/skills/optimize-threejs-games/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install MengTo/Skills optimize-threejs-games2Manually: put the files in place
.github/skills/optimize-threejs-games/SKILL.md1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill optimize-threejs-games -a gemini-cli2Platform CLI
gemini skills install https://github.com/MengTo/Skills --path agent-skills/game-development/optimize-threejs-gamesManually: put the files in place
.devin/skills/optimize-threejs-games/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add MengTo/Skills --skill optimize-threejs-games -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about optimize-threejs-games
How do I install optimize-threejs-games in Claude?
Run npx skills add MengTo/Skills --skill optimize-threejs-games -a claude-code. The skill lands at ~/.claude/skills/optimize-threejs-games/SKILL.md.
What does optimize-threejs-games do?
It profiles and improves Three.js or WebGL game performance without regressing gameplay. It measures a scene, locates the limiting side, then edits code.
Which platforms can run this skill?
Besides Claude there are installs for Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. GitHub Copilot uses a different command: gh skill install MengTo/Skills optimize-threejs-games.
Source text
SKILL.md · MIT
--- name: optimize-threejs-games description: Profile, diagnose, and improve Three.js or WebGL game performance without regressing gameplay. Use for frame-time drops, CPU/GPU pressure, draw calls, texture and geometry budgets, animation loops, adaptive quality, mobile performance, and browser performance verification. --- # Optimize Three.js Games Measure before changing behavior, then validate the same gameplay path after every optimization. ## Establish a repeatable scene Choose a deterministic representative encounter and record device, viewport, quality level, player position, enemies, active effects, frame-time sample, draw calls, triangles, texture count, and warnings. Compare like with like. ## Diagnose the limiting side - Suspect CPU when simulation, allocations, React work, pathfinding, or per-frame scans grow with actors. - Suspect GPU when resolution, overdraw, shadows, transparent particles, post-processing, draw calls, geometry, or texture bandwidth dominate. - Inspect before optimizing; do not lower quality blindly. ## Apply low-risk fixes first Reuse geometry/materials, pool transient effects, cull inactive/offscreen work, throttle noncritical UI updates, cap particle counts, avoid per-frame allocation, and update only changed transforms. Keep render quality settings explicit and reversible. Degrade decorative effects before combat readability or controls. ## Guard the result Re-run the original encounter and verify frame time, visual correctness, collision/contact behavior, memory stability, mobile controls, reduced motion, and console health. Close temporary servers, benchmarks, and browser tabs once they are no longer needed.
© MengTo · MIT · MengTo/Skills