plugins/lisa-phaser/skills/phaser-assets/SKILL.md
This skill should be used when loading or organizing assets in a Phaser 4 game — the Loader (images, texture atlases, spritesheets, audio, fonts), asset-pack manifests via this.load.pack, the new PCT compact atlas format (load.atlasPCT), typed asset keys, and where files live in the Vite project. Use it when adding any asset, restructuring loading, fixing a missing-texture/green-square bug, or optimizing load size. Pairs with phaser-project-structure, phaser-scenes, and phaser-gameobjects.
npx skillsauth add codyswanngt/lisa phaser-assetsInstall 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.
All runtime assets live under public/assets/ (served verbatim by Vite — never
import game assets through the bundler) and are loaded by Phaser's Loader in a
scene's preload(). The opinionated pattern: one asset-pack manifest, loaded
by the Preloader, with every key defined as a typed constant.
A pack is a JSON manifest the Loader consumes wholesale:
{
"main": {
"files": [
{ "type": "atlasPCT", "key": "game-atlas", "url": "atlases/game.pct" },
{ "type": "image", "key": "background", "url": "images/background.png" },
{ "type": "audio", "key": "sfx-jump", "url": ["audio/jump.ogg", "audio/jump.m4a"] },
{ "type": "spritesheet", "key": "explosion", "url": "sheets/explosion.png",
"frameConfig": { "frameWidth": 64, "frameHeight": 64 } }
]
}
}
// Preloader.preload()
this.load.pack("game-pack", "assets/pack.json");
Why packs: loading is declared in one reviewable file instead of scattered
load.* calls; adding an asset never touches scene code beyond using the key.
Individual images break sprite batching. Everything that renders together ships in an atlas:
this.load.atlasPCT(key, url) — its manifests are 90–95% smaller than the
JSON-hash equivalent. JSON/XML/Unity/multi-atlas loaders still exist for
third-party toolchains.load.spritesheet) are acceptable only for uniform-grid
animation strips; anything else is an atlas..ogg + .m4a) in the url array; Phaser
picks the first the browser can play.load.audioSprite) for large sets of short SFX.Every key lives in src/assets.ts:
export const Tex = { GameAtlas: "game-atlas", Background: "background" } as const;
export const Sfx = { Jump: "sfx-jump" } as const;
export const SceneKeys = { Boot: "Boot", Preloader: "Preloader", Game: "Game" } as const;
Scenes use Tex.GameAtlas, never "game-atlas" inline. A bad inline key fails
at runtime as a green square or silent missing audio; a bad constant fails in
review and in tests that assert the pack manifest covers every constant.
this.load.on("progress", …) to a progress bar built from
Boot-loaded art ([[phaser-project-structure]]).loaderror: this.load.on(Phaser.Loader.Events.FILE_LOAD_ERROR, …) —
log the key and URL; a missing asset must fail loudly in dev, not render as a
placeholder in production.public/assets/ subdirs: atlases/, images/, audio/, sheets/, fonts/,
plus pack.json at the root of assets/.src/assets.ts appears in
pack.json (cheap manifest-coverage check; see [[phaser-testing]]).Asset changes are verified by booting the game and watching the network panel /
console: every file 200s, no FILE_LOAD_ERROR, and the new asset visibly renders
or audibly plays in the scene that uses it.
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.