From phaser4-gamedev
Analyzes Phaser 4 game projects for architecture quality, performance risks, and API correctness, producing a prioritized improvement roadmap.
How this skill is triggered — by the user, by Claude, or both
Slash command
/phaser4-gamedev:phaser-analyzeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Perform a comprehensive analysis of an existing Phaser 4 project to assess architecture quality, identify performance risks, flag API correctness issues, and produce a prioritized improvement roadmap.
Perform a comprehensive analysis of an existing Phaser 4 project to assess architecture quality, identify performance risks, flag API correctness issues, and produce a prioritized improvement roadmap.
Follow all five phases in order. Do not skip phases — each builds on the previous.
Gather raw facts about the project before making any judgments.
package.json for dependencies and Phaser version.ts/.js files in src/main.ts for GameConfiggrep "extends Phaser.Scene" across src/grep for this.scene.start, this.scene.launch, this.scene.stopgrep "extends Phaser.Physics" or grep "extends Phaser.GameObjects"Evaluate the structural quality of the codebase.
src/scenes/? Are there too many or too few for the game's complexity?window., module-level let/var declarations.PreloaderScene vs scattered preload() methods across scenes.scenes/, objects/, managers/ conventions?this.registry, this.events.emit, this.scene.get.Rate the architecture A through F based on findings:
Identify runtime performance risks.
classType/maxSize in group declarations. Flag physics groups created with this.physics.add.group() that lack maxSize — these leak objects.maxParticles. Uncapped emitters can spike frame time.staticGroup() (correct) vs group() (wastes physics cycles).update() method. Flag complex logic, object allocations (new), or heavy iteration inside update().this.load.image() calls vs this.load.atlas() calls. More than 15 individual image loads is a red flag — should be packed into atlases.this.physics.add.* calls.Check for deprecated, removed, or misused APIs.
Geom.Point, Math.PI2, Phaser.Structs, Camera3D, Layer3D, FacebookInstant, Create.GenerateTexture, TileSprite.setCrop.as any, @ts-ignore, untyped function parameters. These hide real bugs.this.load.* keys with this.add.*/this.physics.add.* keys. Mismatched keys cause silent texture-missing errors.GameConfig scene array in main.ts.this.add.sprite() calls that should be this.physics.add.sprite() (sprites expected to have physics but created without a body)..render() calls after drawing operations.Verify the project follows Phaser 4 best practices.
preload() should only load assets, create() should only build the scene, update() should be lean (no asset loading, no object creation).this.events.off, this.sound.stopAll(), timer destruction, this.events.on('shutdown', ...).this.cameras.main.setBounds and compare with world/map dimensions.this.input.keyboard can be null in Phaser 4. Check for this.input.keyboard! or proper null guards.debug: true in physics config should be false for production. Flag if present.console.log/console.warn/console.error calls. These should be gated behind import.meta.env.DEV or removed for production.Produce a structured report with these sections:
file:line references where possible./phaser-migrate to fix any Phaser v3 API issues found in Phase 4./phaser-physics for implementing object pooling and fixing physics group issues from Phase 3.references/analysis-checklist.md — Complete checklist with grep patterns, severity ratings, and fix references for all checks.references/performance-playbook.md — Nine-phase Phaser 4 performance playbook for mid-range mobile targets: measurement-first prompting, per-frame allocation elimination, registry throttling, audio lazy-load, VFX pooling, spatial grid, atlas packing, event throttling, AI tick-skip with real delta, tween cleanup. Read when FPS is below target or memory grows during gameplay.Before starting the manual deep review, run the automated analysis script:
bash "${CLAUDE_PLUGIN_ROOT}/skills/phaser-analyze/scripts/analyze-project.sh"
This provides baseline metrics and flags obvious issues. Use the script output as a starting point, then perform the full 5-phase analysis by reading actual source files.
npx claudepluginhub yakoub-ai/phaser4-gamedev --plugin phaser4-gamedevDesigns Phaser 4 game architecture including scene flow, module layout, state management, and asset pipeline. Also reviews and refactors existing Phaser projects.
Reviews existing game codebases for architecture (EventBus, GameState), performance (delta time, pooling), code quality, and monetization readiness. Read-only analysis; auto-activates on 'review my game' or code review phrases.
Creates and refactors Phaser 3 browser games with scenes, physics, tilemaps, animations, input, audio, camera, and performance fixes.