This skill sets up and debugs Phaser 4 games, and Phaser 3.90 projects that stay on 3.x. It covers one Phaser.Game from a config, one Scene per screen, assets loaded per scene, cross-scene data through the registry, and a split between game rules in modules with no Phaser import and the scenes that draw them.
It includes a headless browser smoke check, and a list of Phaser 3 to 4 changes that make old snippets run but look wrong: filters, lighting, tint fill, TAU and pixel art rounding.
What You Get
- A workflow that keeps game rules testable with node —test and out of scene classes
- Patterns for game config, a full scene lifecycle, registry events with listener cleanup, scene transitions, HTML over the canvas and camera follow
- A smoke script that launches a headless browser, collects page errors, reports the renderer and running scenes, and saves a screenshot
- A gotcha list for undefined assets, state leaking across restarts, HUD scenes hidden behind the game, black screens and two canvases after a remount
- A reference on pause versus sleep versus stop, stacked listeners and stuck keys
Common Use Cases
- Starting a Phaser game with boot, play and HUD scenes
- Fixing a black screen or assets that are undefined in create
- Porting Phaser 3 code that runs but looks wrong in Phaser 4
- Stopping a HUD from resetting or drawing under the gameplay scene
What Makes It Unique
The skill treats the installed Phaser major as the first fact to read, since Phaser 3 and 4 share a scene model but not a renderer. It lists the concrete v3 to v4 renames, and it ends every change with a headless browser run whose screenshot is meant to be opened, because DOM checks miss a canvas that draws nothing.
Under The Hood
The agent loads the SKILL.md and reads the scene flow reference only when a transition misbehaves. It edits your game source, runs the build or type check and node tests, and writes a small smoke script. That script needs the Playwright package and a downloaded Chromium browser, which the agent installs only if you agree; it then opens your local dev server page in a headless browser and saves a screenshot file. It does not call outside services beyond that install.