Builds browser game clients in TypeScript/Bun using Canvas/WebGL, Phaser, PixiJS, Three.js, or React Three Fiber. Handles rendering stack selection, frame loop, input, canvas sizing, audio unlock, context loss, and asset cleanup.
Ships in game-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The client draws the world and collects input. In a multiplayer game the server owns the state (game-backend-architecture) and game-state-sync owns prediction, reconciliation and interpolation. This skill owns everything between those and the screen.
Checked against phaser 4.2.1, pixi.js 8.23.0, three 0.187.0 and @react-three/fiber 9.8.2 (bun pm view <pkg> version, 2026-11-14). An agent trained on an older major writes code that no longer runs; each stack's reference file lists those traps.
The "what it is" column uses each project's own words. The "fits" and "avoid" columns are this skill's rule.
| Stack | What it is | Fits when | Avoid when |
|---|---|---|---|
| Plain web (Canvas 2D, WebGL2, WebGPU) | Browser APIs; you write the loop, input, loader and batcher | Few sprites, a custom renderer, a tool, a tight bundle | You find yourself writing a sprite batcher or scene graph |
| Phaser 4 | "A fast, free, and fun open source HTML5 game framework" with scenes, a loader, Arcade and Matter physics, input, cameras, tilemaps, tweens | A 2D game where you want the engine to own scenes, input and physics | You need 3D (v4 removed Mesh and Plane), or only a renderer under your own loop |
| PixiJS 8 | "Just a rendering engine" for 2D; sound, UI and layout are add-ons | A 2D game where you own the structure and want a fast batched renderer | You want scenes, physics and gamepad input built in |
| Three.js | "An easy-to-use, lightweight, cross-browser, general-purpose 3D library" | 3D with many server entities updated every snapshot | A 2D game |
| React Three Fiber | "A React renderer for three.js" | 3D inside an existing React app, mostly long-lived objects | Entities that spawn and despawn every snapshot (mounting compiles materials) |
Load one reference file for the chosen stack and skip the others.
bun ./index.html serves and bundles the page with hot reloading; bun build ./index.html --outdir=dist builds it. Details in references/web.md.bun create @phaserjs/game@latest or bun create pixi.js my-app --template bundler-vite. Their templates bundle with Vite; keep Vite and use Bun as package manager and runtime. No vendor source covers Bun's own bundler, so this is this skill's rule.three and @types/three at the same version. R3F: add @react-three/fiber and match React's major (fiber 9 needs React 19)."DOM" in lib. Bun's recommended tsconfig lists only "ESNext". Give the client its own tsconfig so server code does not see DOM globals (this skill's rule).ClientGameLoop in game-state-sync owns it: an accumulator over requestAnimationFrame, a 250 ms cap per frame, prediction on each tick, and an alpha between the last two ticks. Do not write a second fixed-step loop.requestAnimationFrame follows the display rate, so a 120 Hz screen calls it twice as often as a 60 Hz one. Anything moved per frame moves by elapsed time, never a fixed amount.ClientGameLoop does. Set its onRender(state, alpha) and draw there.ClientGameLoop.start() and leave onRender unset. In the engine's per-frame hook, before it renders, call loop.step(now): it runs the due fixed ticks and returns the alpha. Then read loop.getRenderState() (previous and current state by reference, no copy) and the snapshot bracket from game-state-sync, and write transforms onto display objects. Each reference file names the hook.handleServerUpdate) and never touches display objects.Most browsers stop requestAnimationFrame in a background tab, while the server keeps simulating. Simulating the whole gap on return "can be a problem for long drops" (MDN). This skill's rule:
visibilitychange to hidden: stop the client loop, clear held input, suspend audio.syncTick; handleServerUpdate already adopts the server's tick when the client is behind. ClientGameLoop.start() resets the frame clock and the accumulator, so the first frame back runs no burst of ticks.boilerplate/visibility-resync.ts does this for any loop with start() and stop(). In engine-driven mode, pass it gate = engineDrivenLoop(loop) from the same file and write the engine callback as if (!gate.paused) loop.step(now). The gate pauses stepping while the tab is hidden and during the resync, and resets the clock both ways, so the first step() back runs no catch-up ticks. The pause matters because Phaser resumes its loop, and the PixiJS ticker never stops, before the full snapshot arrives. Engine loops handle their own clocks: Phaser pauses its loop and emits RESUME, PixiJS does not pause its ticker itself (the browser throttles its frames), three.js Timer.connect(document) avoids the big delta. They do not resync with your server.
KeyboardEvent.code, the physical key: WASD stays in place on an AZERTY layout. Use key only for text entry such as chat.keydown and keyup, and ignore events with repeat set. OS auto-repeat is not a press.blur and on hidden: a key released while the window has no focus sends no keyup (this skill's rule).pointerId each. Call setPointerCapture on pointerdown so a drag that leaves the canvas still delivers its pointerup. Treat pointercancel like pointerup (this skill's rule).touch-action: none on the canvas so the browser does not pan or zoom. Window, document and body listeners for touchstart and touchmove are passive by default and cannot call preventDefault(); attach to the canvas. Pinch is the distance between two touch pointers.navigator.getGamepads() once per tick and read pads by index. Re-read the list on every poll rather than keeping a Gamepad object (this skill's rule). mapping === 'standard' means the standard button layout. Firefox exposes a pad only after the user presses something on it with the page visible.captureInput once per tick, and turn it into a command with the tick and sequence number (game-state-sync). Send intents, never positions.boilerplate/input-manager.ts implements all of this with no framework. It reads keys on window, ignores keys typed into text fields, and blocks arrow and Space defaults only while the canvas has focus (it gives the canvas tabindex 0 and focuses it on pointerdown), so buttons and page scrolling keep their keys. Phaser has its own keyboard, pointer and gamepad input; use that. With PixiJS, which has pointer events but no keyboard or gamepad input, keep the boilerplate's keyboard and gamepad parts. three.js has no input layer at all; use the whole boilerplate.
An AudioContext created before a user gesture starts suspended; call resume() from a gesture and check state. Only some events count as activation: keydown, mousedown, pointerup from touch or pen, and touchend. A touch pointerdown does not count, so a "tap to start" button must listen for pointerup or click. The same rule applies to fullscreen and pointer lock. boilerplate/audio-unlock.ts resumes a context on the first qualifying gesture; it rejects and removes its listeners if the context is closed or its AbortSignal aborts. For music and effects themselves, see elevenlabs-sound-music.
devicePixelRatio is the ratio of physical to CSS pixels. A canvas whose buffer matches its CSS size looks blurry on a 2x screen.ResizeObserver with { box: 'device-pixel-content-box' }, which gives exact device pixels; fall back to CSS size times devicePixelRatio. Cap the ratio: the three.js manual warns against blindly using the device ratio, and R3F clamps its dpr to [1, 2] by default.boilerplate/canvas-size.ts does this for plain web and three.js, re-applies on a devicePixelRatio change (zoom, another monitor) through a matchMedia resolution query, and takes an optional maxSize cap. Its callback receives the buffer size in device pixels and must not touch the canvas's CSS size. With three.js: renderer.setPixelRatio(1), then in the callback renderer.setSize(w, h, false), camera.aspect = w / h, camera.updateProjectionMatrix(). The false stops setSize from writing the CSS size; without it the CSS box grows, the observer fires again, and on a 2x screen the buffer grows without end.webglcontextlost, call event.preventDefault() and stop rendering; on webglcontextrestored, re-create every texture, buffer, shader and program.device.lost, a promise that resolves when the device is lost, then rebuild.this.load.on('progress'), PixiJS bundles with onProgress, three.js a LoadingManager.dispose() on geometries, materials and textures; PixiJS Assets.unload and destroy({ children: true }); Phaser this.textures.remove(key), since its caches are global; plain web ImageBitmap.close() and explicit WebGL deletes.AbortSignal to every listener a scene adds, and abort it when the scene ends (this skill's rule; the signal option of addEventListener removes them all).getError and getParameter out of the frame loop: they stall the calling thread.You own the loop, scenes and batching. Read references/web.md for Bun's HTML server, scene cleanup with AbortController, pointer lock and fullscreen, image decoding, and WebGPU status.
Use the matching skill in node_modules/phaser/skills/<topic>/SKILL.md if it is installed, otherwise https://docs.phaser.io. What differs: delta is smoothed and clamped, scene operations are queued, caches are global, and listeners survive scene restarts. The official Bun template phones home through log.js. Read references/phaser.md for timing, cleanup, the interpolation hook and Phaser 3 traps.
Use the pixijs skill if it is installed (it ships in node_modules/pixi.js/skills/pixijs), otherwise https://pixijs.com/8.x/guides. What differs: await app.init(), no scene manager, no keyboard or gamepad input, no fixed step, and the ticker does not pause itself in a hidden tab. Read references/pixijs.md for ticker priorities, cleanup, the interpolation hook and PixiJS 7 traps.
Use the threejs-fundamentals skill if it is installed, otherwise https://threejs.org/docs/llms.txt; for R3F the r3f-fundamentals skill if it is installed, otherwise https://r3f.docs.pmnd.rs/. What differs: setAnimationLoop, Timer instead of the deprecated Clock, manual dispose(), and in R3F no setState in useFrame. Read references/three.md for the plain-or-R3F choice, the interpolation hook and version traps.
requestAnimationFrame: speed then depends on the screen's refresh rate.KeyboardEvent.key for movement: it breaks on non-QWERTY layouts.pointerdown.preventDefault() in webglcontextlost: the context never returns.Text, PixiJS Text: updating them every frame re-uploads a texture.THREE.Clock, R3F 8 types. Check the version traps in the reference file.boilerplate/input-manager.ts: copy when you need keyboard by code, pointers with capture, pinch distance and gamepad polling without a framework.boilerplate/visibility-resync.ts: copy when the client loop must pause in a hidden tab and resync with the server on return.boilerplate/audio-unlock.ts: copy when a Web Audio context must resume on the first qualifying gesture.boilerplate/canvas-size.ts: copy when a plain-web or three.js canvas must track its CSS size in device pixels.references/web.md: read when the stack is plain Canvas, WebGL or WebGPU.references/phaser.md: read when the stack is Phaser 4.references/pixijs.md: read when the stack is PixiJS 8.references/three.md: read when the stack is Three.js or React Three Fiber.references/sources.md: read when you need the page behind a rule or want to re-check a version.game-state-sync: the fixed-step ClientGameLoop, prediction, reconciliation and snapshot interpolation this client plugs into.game-backend-architecture: the authoritative server, WebSocket rooms and tick loop the client talks to.ui-ux-game: HUD, menus, onboarding and accessibility drawn on top of the canvas.elevenlabs-sound-music: producing the sound effects and music the client plays.level-design: the levels the client loads and renders.game-save-load: saving and restoring client and player state.game-localization: translated text, fonts and layout in the client.boilerplate/audio-unlock.ts (opens in a new tab)boilerplate/canvas-size.ts (opens in a new tab)boilerplate/input-manager.ts (opens in a new tab)boilerplate/visibility-resync.ts (opens in a new tab)references/phaser.md (opens in a new tab)references/pixijs.md (opens in a new tab)references/sources.md (opens in a new tab)references/three.md (opens in a new tab)references/web.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
game-development, browser-game, canvas, webgl, phaser, pixijs, threejs, react-three-fiber
39 skills in this plugin
/betterauth-integrationCovers the game-specific layer of Better Auth: player, moderator and admin roles, session checks on game routes and WebSocket handshakes, and keeping the auth session apart from the game session. Use when a game needs player login, moderator or admin powers, or authenticated real-time connections, and the project uses Better Auth./bullmq-game-queuesBackground job design for game backends on BullMQ and Redis: one queue per game domain, idempotent reward fulfilment, and cron schedulers for daily rewards and season ends. Use when a game needs matchmaking requests, reward grants, match results, notifications or analytics processed off the request path, or recurring and timed jobs such as daily login rewards, leaderboard snapshots and season rollovers.//game-dev:game-clientfrom game-dev
npx claudepluginhub fcsouza/agent-skills --plugin game-devOther plugins' skills for the same job