Set up and debug a Phaser 4 game: the Game config, the Scene lifecycle (init/preload/create/update), the asset loader, cameras, and cross-scene communication.

Apache-2.0Auto-check passedDevelopment

Install Phaser Core

skills CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-core -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gamedev-skills/awesome-gamedev-agent-skills phaser-core --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gamedev-skills/awesome-gamedev-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/web-engines/phaser-core .claude/skills/phaser-core && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
phaser-core
GitHub stars
1.4k
Token cost
~1.8k tokens
SKILL.md length
558 words
Files
2 (incl. references)
Skills in repo
53
Repo updated
First seen
Licence
Apache-2.0

At a glance

Set up and debug a Phaser 4 game: the Game config, the Scene lifecycle (init/preload/create/update), the asset loader, cameras, and cross-scene communication.

  • Works in 5 steps: Game config + boot (ES module) → A Scene with the full lifecycle → Cross-scene data + events → …
  • Debugging a Phaser game — when the user mentions Phaser
  • SKILL.md covers When to use, Core workflow, Patterns and Pitfalls, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Phaser Core is an agent skill from gamedev-skills/awesome-gamedev-agent-skills. Set up and debug a Phaser 4 game: the Game config, the Scene lifecycle (init/preload/create/update), the asset loader, cameras, and cross-scene communication. Use when building or debugging a Phaser game — when the user mentions Phaser, Phaser.Game, Phaser.Scene, preload/create/update, this.load, this.add, or scene transitions. For Arcade Physics movement/collisions use phaser-arcade-physics.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/scene-flow.md`).

It sits in Development, covering Debugging. The repository describes itself as: 74 game-dev skills for AI coding agents — Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox. Portable SKILL.md Agent Skills (the format Anthropic… The licence is Apache-2.0.

When your agent uses it

  • Debugging a Phaser game — when the user mentions Phaser
  • Preload/create/update
  • Scene transitions

Example prompts

  • “/phaser-core”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Game config + boot (ES module)
  2. A Scene with the full lifecycle
  3. Cross-scene data + events
  4. Scene transitions (pick the right verb)
  5. A camera that follows the player

What it can do on your machine

Read from SKILL.md and the folder at commit 0a70cfc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Phaser Core loads about 1.8k tokens when it runs, and up to ~2.7k if it reads all its reference files. Until then it costs about 102 tokens; SKILL.md has 558 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~102
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gamedev-skills/awesome-gamedev-agent-skills at commit 0a70cfc, republished under its Apache-2.0 licence (© gamedev-skills). 558 words, ~1,812 tokens.

Download SKILL.mdSave it as .claude/skills/phaser-core/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
phaser-core
description
Set up and debug a Phaser 4 game: the Game config, the Scene lifecycle (init/preload/create/update), the asset loader, cameras, and cross-scene communication. Use when building or debugging a Phaser game — when the user mentions Phaser, Phaser.Game, Phaser.Scene, preload/create/update, this.load, this.add, or scene transitions. For Arcade Physics movement/collisions use phaser-arcade-physics.

Phaser 4 Core

Set up the foundation of a Phaser game: the Game config, the Scene lifecycle, asset loading, cameras, and passing data between scenes. Targets Phaser 4.2 for new projects; keep an existing Phaser 3.90 project on its pinned major unless the user explicitly asks for a migration.

When to use

  • Use when starting a Phaser game, wiring the Phaser.Game config, structuring Scenes, loading assets in preload, or fixing scene transitions and shared state.
  • Use when the project has phaser in package.json or import Phaser from 'phaser', and code uses preload()/create()/update().

When not to use: movement, velocity, colliders, gravity, or overlap → use phaser-arcade-physics. Complex rigid-body simulation uses Matter physics (a separate concern). For cross-engine save/load patterns use save-systems.

Core workflow

  1. Detect the installed major first. Read package.json and the lockfile. Use Phaser 4.2 for new work; do not silently rewrite a Phaser 3 project as Phaser 4.
  2. Create the game from a config. new Phaser.Game(config) with type: Phaser.AUTO (WebGL with Canvas fallback), a width/height, and a scene array. The first scene (and any with active: true) starts automatically.
  3. Model each screen as a Scene. Subclass Phaser.Scene, pass a unique key to super, and implement the lifecycle: init(data) → preload() → create(data) → update(time, delta).
  4. Load assets in preload, use them in create. Queued assets are not available until create. The loader is per-scene; the cache it fills is global.
  5. Reset per-run state in init(), not the constructor. A scene instance is reused across restarts, so constructor-set fields keep stale values.
  6. Move between screens with this.scene.start/launch/switch/sleep/wake. Share data through this.registry (global) or a sibling scene's event emitter.
  7. Run and observe. Serve the page, open it, and confirm assets load (watch the Network tab and console) and scenes switch as expected before assuming success.

Patterns

1. Game config + boot (ES module)
js
// main.js — one Game owns the renderer, loop, cache, and Scene Manager.
import Phaser from 'phaser';
import BootScene from './scenes/BootScene.js';
import PlayScene from './scenes/PlayScene.js';

const config = {
  type: Phaser.AUTO,            // WebGL if available, else Canvas
  width: 800,
  height: 600,
  backgroundColor: '#1d1d28',
  scale: { mode: Phaser.Scale.FIT, autoCenter: Phaser.Scale.CENTER_BOTH },
  scene: [BootScene, PlayScene] // BootScene starts first
};

new Phaser.Game(config);
2. A Scene with the full lifecycle
js
// scenes/PlayScene.js
import Phaser from 'phaser';

export default class PlayScene extends Phaser.Scene {
  constructor() {
    super('play');                  // unique scene key
  }

  init(data) {
    // Reset run-specific state HERE so restarts start clean.
    this.score = 0;
    this.level = data.level ?? 1;
  }

  preload() {
    // Queue downloads. Not usable until create().
    this.load.image('player', 'assets/player.png');
    this.load.spritesheet('coin', 'assets/coin.png', { frameWidth: 16, frameHeight: 16 });
  }

  create() {
    this.player = this.add.sprite(400, 300, 'player');
    this.scoreText = this.add.text(10, 10, 'Score: 0', { fontSize: '20px', color: '#fff' });
    this.cursors = this.input.keyboard.createCursorKeys();
  }

  update(time, delta) {
    // delta is milliseconds since last frame; divide by 1000 for seconds.
    const speed = 200 * (delta / 1000);
    if (this.cursors.left.isDown)  this.player.x -= speed;
    if (this.cursors.right.isDown) this.player.x += speed;
  }
}
3. Cross-scene data + events
js
// The registry is a global DataManager shared by every scene.
this.registry.set('coins', 0);                 // in any scene
const coins = this.registry.get('coins');      // read anywhere

// React to registry changes (e.g. a HUD scene listening to gameplay):
this.registry.events.on('changedata-coins', (parent, value) => {
  this.coinText.setText(`Coins: ${value}`);
});

// Talk directly to another running scene via its event emitter:
const ui = this.scene.get('hud');
ui.events.emit('show-message', 'Level cleared!');
4. Scene transitions (pick the right verb)
js
this.scene.start('gameover', { score: this.score }); // stop this scene, start target
this.scene.launch('hud');        // run a second scene in parallel (overlay HUD)
this.scene.switch('menu');       // sleep this scene, start/wake target
this.scene.pause();              // freeze updates but keep rendering (modal)
this.scene.sleep();              // stop updating AND rendering, keep state for wake
5. A camera that follows the player
js
this.cameras.main.setBounds(0, 0, 1600, 1200);  // world size
this.cameras.main.startFollow(this.player, true, 0.1, 0.1); // smooth lerp follow
this.cameras.main.setZoom(1.5);
Show full SKILL.md (229 more words)Show less

Pitfalls

  • Assets are undefined in create/update → you forgot to queue them in preload, or used the wrong key. The loader runs between preload and create.
  • State leaks across a restart → you set fields in the constructor. The Scene instance is reused; reset run state in init() and clear arrays on shutdown.
  • this.scene.start vs this.scene.launch → start stops the calling scene; launch runs the target alongside it. Using start for a HUD hides the game.
  • this is wrong in a callback → arrow functions keep the Scene's this; plain function callbacks need a context argument or .bind(this).
  • Phaser 2 tutorials don't work → "States" were renamed to "Scenes" in Phaser 3, and each Scene owns its own systems (input, cameras, tweens) rather than a global Game World.
  • Phaser 3 custom pipelines fail in Phaser 4 → Phaser 4 rebuilt the renderer and replaced the old FX/pipeline extension points. Migrate custom shaders and renderer plugins against the Phaser 4 guide; do not mechanically copy internal renderer code.
  • Nothing renders / black screen → confirm the canvas mounted, width/height are set, and a scene actually started (check game.scene.dump() output).

References

  • For the full scene state machine (pause/resume vs sleep/wake vs stop/start, the restart-state bug, and removing/replacing scenes), read references/scene-flow.md.
  • phaser-arcade-physics — velocity, gravity, colliders, overlap, and groups.
  • input-systems — rebindable, multi-device input architecture (engine-agnostic).
  • pixijs-rendering / threejs-scene-setup — other browser rendering stacks.
  • platformer / puzzle — genre templates that compose Phaser skills.

© gamedev-skills, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/web-engines/phaser-core of gamedev-skills/awesome-gamedev-agent-skills.

  • SKILL.md
  • references/scene-flow.md

Open the folder on GitHubat commit 0a70cfc

Compare with similar skills

Phaser Core next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Phaser Core compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Phaser Core this skillgamedev-skills/awesome-gamedev-agent-skills1.4k—~1.8kAutomated safety check: PassApache-2.0
Renderdoc GPU Debugrudybear/renderdoc-skill212—~4kAutomated safety check: PassMIT
Console Get LogsIvanMurzak/Unity-MCP4.4k—~1kAutomated safety check: PassApache-2.0
Godot Debugging Profilingthedivergentai/GD-Agentic-Skills821—~3.3kAutomated safety check: PassLGPL-3.0
Trellis Session Insightmindfold-ai/Trellis15k4 repos~1.7kAutomated safety check: PassAGPL-3.0
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT

Similar skills

  • Renderdoc GPU Debug

    rudybear/renderdoc-skill

    GPU frame debugging with RenderDoc via rdc-cli. An agent skill from rudybear/renderdoc-skill.

    212 GitHub stars~4k tokensUpdated 7 mo ago
    DevelopmentAuto-check passed
  • Console Get Logs

    IvanMurzak/Unity-MCP

    Retrieve Unity Editor logs from the MCP plugin's LogCollector, optionally filtered by log type or time window.

    4.4k GitHub stars~1k tokensUpdated today
    DevelopmentAuto-check passed
  • Godot Debugging Profiling

    thedivergentai/GD-Agentic-Skills

    Expert debugging and profiling for leaks, GPU/Visual Profiler, headless CI QA, orphan nodes, thread-safe logs, and custom Debugger monitors — not print/breakpoint tutorials.

    821 GitHub stars~3.3k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Trellis Session Insight

    mindfold-ai/Trellis

    Reach into past AI conversation history through the trellis mem CLI.

    15k GitHub starsUsed in 4 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Official

    Debug failed or wrong-output workflow executions using executions tools.

    207k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed

More from gamedev-skills/awesome-gamedev-agent-skills

All 53 skills in this repo
  • Create Game Assets

    gamedev-skills/awesome-gamedev-agent-skills

    Plan, generate, source, normalize, and validate cohesive visual game assets.

    1.4k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Roblox UI

    gamedev-skills/awesome-gamedev-agent-skills

    Build production Roblox interfaces with ScreenGui/PlayerGui lifecycle, responsive UDim2 layouts, safe insets, reusable editable Instances, cross-device input and selection, restrained motion…

    1.4k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • AI Behavior Trees Utility AI

    gamedev-skills/awesome-gamedev-agent-skills

    Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system (response curves — linear, exponential…

    1.4k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Bevy Ecs

    gamedev-skills/awesome-gamedev-agent-skills

    Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the…

    1.4k GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Card Game

    gamedev-skills/awesome-gamedev-agent-skills

    Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution.

    1.4k GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Fps Shooter

    gamedev-skills/awesome-gamedev-agent-skills

    Build a first-person shooter: move+mouse-look controller, hitscan or projectile shooting, weapons, health, and enemy AI.

    1.4k GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed

Questions about Phaser Core

What does Phaser Core do?

Set up and debug a Phaser 4 game: the Game config, the Scene lifecycle (init/preload/create/update), the asset loader, cameras, and cross-scene communication. Phaser Core is an agent skill from gamedev-skills/awesome-gamedev-agent-skills. Set up and debug a Phaser 4 game: the Game config, the Scene lifecycle (init/preload/create/update), the asset loader, cameras, and cross-scene communication.

When should I use Phaser Core?

Phaser Core fits situations like: debugging a Phaser game — when the user mentions Phaser; preload/create/update; scene transitions.

How do I install Phaser Core in Claude Code?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-core -a claude-code`. Or copy the skill folder (skills/web-engines/phaser-core in gamedev-skills/awesome-gamedev-agent-skills) into .claude/skills/phaser-core in your project. Claude Code loads it when a task matches its description.

How do I install Phaser Core in Codex?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-core -a codex`. Or copy the skill folder (skills/web-engines/phaser-core in gamedev-skills/awesome-gamedev-agent-skills) into .agents/skills/phaser-core in your project. Codex loads it when a task matches its description.

Can I use Phaser Core in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill phaser-core -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/phaser-core, .gemini/skills/phaser-core, .github/skills/phaser-core and .opencode/skills/phaser-core in your project.

What does Phaser Core need to run?

SKILL.md names no scripts, command-line tools or credentials: Phaser Core is instructions for the agent only.

Does Phaser Core access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Phaser Core safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Phaser Core use?

Phaser Core is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Phaser Core use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 929 tokens, read only when the agent opens those files.

What are the alternatives to Phaser Core?

Skills that share tags, products or a category with Phaser Core: Renderdoc GPU Debug (rudybear/renderdoc-skill, 212 stars), Console Get Logs (IvanMurzak/Unity-MCP, 4.4k stars), Godot Debugging Profiling (thedivergentai/GD-Agentic-Skills, 821 stars) and Trellis Session Insight (mindfold-ai/Trellis, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Phaser Core?

gamedev-skills (a GitHub organization) maintains it in gamedev-skills/awesome-gamedev-agent-skills, which has 1,389 GitHub stars. The repository holds 53 skills in this directory. The repository was last updated on October 9, 2026.

Source: gamedev-skills/awesome-gamedev-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.