plugins/src/phaser/skills/phaser-gameobjects/SKILL.md
This skill should be used when creating or managing Phaser 4 GameObjects — sprites, images, text, containers, groups and object pooling, animations (anims), tweens, particles, and the v4 GPU layers (SpriteGPULayer, TilemapGPULayer) for massive object counts. Use it when adding entities, fixing per-frame allocation/GC issues, pooling projectiles, or choosing between a Container and a Group. Pairs with phaser-scenes, phaser-physics, phaser-rendering, and phaser-assets.
npx skillsauth add codyswanngt/lisa phaser-gameobjectsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
GameObjects carry over from Phaser 3 largely unchanged: Sprite, Image,
Text, BitmapText, Container, Group, Graphics, the Shape objects, and
the particle system. v4 adds Gradient, Stamp, CaptureFrame, the Noise
objects, NineSlice tiling (tileX/tileY), and — the headline — the GPU
layers. Removed: Mesh, Plane, the OBJ loader, Camera3D/Layer3D
([[phaser-v3-migration]]).
Layer is a true GameObject and is the right tool
for z-grouping with filters.BitmapText.Bullets, enemies, particles, pickups: never new/destroy per spawn — pool
through a Group:
this.bullets = this.add.group({ classType: Bullet, maxSize: 64, runChildUpdate: true });
// spawn
const b = this.bullets.get(x, y, Tex.GameAtlas, "bullet") as Bullet | null;
if (b) { b.setActive(true).setVisible(true); b.fire(dir); }
// despawn (inside Bullet when off-screen/expired)
this.bullets.killAndHide(this); this.body.enable = false;
maxSize caps the pool; get() returns null when exhausted — handle it
(drop the spawn) rather than growing unbounded.
In update() paths: no object literals, no array spreads, no .map/.filter
chains, no closures. Hoist scratch Vector2s and reuse them. The GC pause from
per-frame garbage is the most common cause of stutter that profilers get blamed
for.
create or a dedicated module) on the
global this.anims; play by key constant: sprite.play(Anim.Run).this.tweens.add) and Timelines carry over from v3 unchanged. Kill
tweens that target objects you pool/despawn — a tween holding a pooled object
alive is a classic leak.New in v4 — reach for these instead of "thousands of sprites":
Regular Sprites + Groups remain correct for interactive entities (things with bodies, input, per-entity logic).
The particle API is the v3.60-style this.add.particles(x, y, texture, config)
emitter manager. v4 additions: particles respect the lighting system. Pool
explosion-style one-shot emitters or use emitter.explode() rather than
creating emitters per event.
Bullet extends Phaser.Physics.Arcade.Sprite) live in
src/entities/, take their tunables from src/logic/ config objects, and use
asset-key constants ([[phaser-assets]]).Depth.World, Depth.FX,
Depth.UI), not scattered magic numbers.Object-lifecycle changes are verified in the running game: spawn/despawn the
entity repeatedly and watch the object count (this.children.length,
group.getLength()) stay bounded, and the FPS meter stay flat — an unbounded
count or sawtooth memory profile means the pool or tween cleanup is wrong.
development
Prepare a machine — a fresh laptop or a throwaway container — to run coding agents, before any repository exists. Detects which of Lisa's supported agents (Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot) are already installed, asks which credential manager the machine uses (Bitwarden, 1Password, Doppler, Vault, AWS, or none), and installs only what is missing, each by its vendor's own preferred method. Idempotent, headless by default, and emits a Dockerfile for a spin-up/spin-down environment. Run it on a new machine, in a container, or before cloning anything.
tools
Provision and verify a remote execution environment for a host project — Codex Cloud today, other remote surfaces as they are added. Generates a repository-owned setup script that installs the declared toolchain, materializes secrets through lisa-secrets-access, and runs the project's own hook. Provisions by API where one exists, by driving the vendor console where one does not, and by emitting exact config otherwise — then proves the result with the same read-back regardless of which tier did the work. Use before dispatching any work with executionEnv.
tools
Bring a developer's machine in line with the toolchain the project declares. Reports every tool in remoteEnv.tools that is missing, outdated, or unpinned for this platform, and installs the missing ones into ~/.local/bin from the same pinned, checksummed entries the remote surfaces use — but only when asked. Same manifest, same pins, same installers as lisa-setup-remote-env; what differs is consent and that the pin is a floor rather than an equality. Run it on a fresh checkout, after a manifest change, or when a tool fails at the moment of use.
tools
Route one unit of work to a remote execution surface. Reads the executionEnv parameter (local by default, codex-cloud or claude-web today), verifies the environment is provisioned and bound to this repository, submits a thin skill invocation, records the task identifier to .lisa/remote-dispatch.json, and exits without polling. Routing only — the remote runs the identical skill from the identical repository. Composable and inline: other skills invoke it via the Skill tool rather than users calling it directly.