plugins/lisa-phaser-cursor/skills/phaser-project-structure/SKILL.md
This skill should be used when creating, restructuring, or reasoning about a Phaser 4 game project — the game config, the Vite + TypeScript layout, the Boot → Preloader → MainMenu → Game scene flow, scale/resolution setup for desktop and mobile, and where code and assets belong. Use it before scaffolding a project, adding a major subsystem, or deciding where a file should live. Pairs with phaser-scenes, phaser-assets, phaser-rendering, and phaser-testing.
npx skillsauth add codyswanngt/lisa phaser-project-structureInstall 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.
This stack targets Phaser 4 (v4.1+ "Salusa", npm package phaser), built
with Vite + TypeScript — the layout the official phaserjs/template-vite-ts
template and npm create @phaserjs/game@latest scaffold. Phaser 4 ships its own
type definitions (types/phaser.d.ts); do not add @types/phaser.
| Path | Role |
| --- | --- |
| index.html | Single page that loads src/main.ts; owns the game container div |
| src/main.ts | Game config + new Phaser.Game(config) — the only bootstrap file |
| src/scenes/ | One scene class per file (Boot.ts, Preloader.ts, MainMenu.ts, Game.ts, …) |
| src/logic/ | Pure TypeScript game logic — no phaser imports (testable) |
| src/assets.ts | Typed asset-key constants (texture, audio, anim, scene keys) |
| public/assets/ | Static assets served by Vite (atlases, audio, packs) — never imported |
| tests/ | Vitest unit tests for src/logic/** and pure helpers |
| dist/ | Vite build output — generated, never edited or committed |
One config object in src/main.ts. The opinionated baseline:
const config: Phaser.Types.Core.GameConfig = {
type: Phaser.AUTO, // WebGL; Canvas renderer is deprecated in v4
width: 1280,
height: 720,
parent: "game-container",
backgroundColor: "#028af8",
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
},
physics: {
default: "arcade",
arcade: { gravity: { x: 0, y: 0 }, debug: false }, // fixedStep defaults to true in v4 — keep it
},
scene: [Boot, Preloader, MainMenu, Game],
};
v4-specific config facts:
roundPixels now defaults to false (v3 defaulted true). Leave it — the
new default prevents flicker on rotated/scaled objects.pixelArt: true (nearest-neighbor + roundPixels), or the new
render.smoothPixelArt: true (WebGL-only) for pixel art that rotates or
scales smoothly. Pick one per project and record the choice.render.renderNodes — see [[phaser-rendering]].Phaser.HEADLESS exists for logic-only boots (tests) — see [[phaser-testing]].Four-stage boot, in order (see [[phaser-scenes]] for lifecycle detail):
HUD, Pause run in parallel) — gameplay.src/; bun run dev (vite), bun run build
(vite build), bun run preview serve and package it.src/logic/ as pure functions/classes so Vitest can run them without
a browser.src/assets.ts constants — a typo in an inline string
key fails at runtime only; a typo in a constant fails at compile time.Phaser.Math.RND (or a local RandomDataGenerator) from a
single place; never Math.random() in game code.A structural change is verified when bun run typecheck, bun run test, and
bun run build pass AND the game boots: bun run dev, open the page, confirm
the canvas renders past the Preloader with no console errors.
tools
--- name: harper-realtime description: This skill should be used when adding or troubleshooting Harper (HarperDB/Fabric) real-time behavior: MQTT topics, WebSocket resource subscriptions, resource publish/subscribe handlers, SSE-style streaming routes, and local subscriber verification. Pairs with harper-resources, harper-config-yaml, harper-schema-graphql, and harper-build-and-deploy. --- # Harper Realtime ## Overview Harper exposes live data through the same Resource model used for REST and
tools
--- name: harper-realtime description: This skill should be used when adding or troubleshooting Harper (HarperDB/Fabric) real-time behavior: MQTT topics, WebSocket resource subscriptions, resource publish/subscribe handlers, SSE-style streaming routes, and local subscriber verification. Pairs with harper-resources, harper-config-yaml, harper-schema-graphql, and harper-build-and-deploy. --- # Harper Realtime ## Overview Harper exposes live data through the same Resource model used for REST and
tools
--- name: harper-realtime description: This skill should be used when adding or troubleshooting Harper (HarperDB/Fabric) real-time behavior: MQTT topics, WebSocket resource subscriptions, resource publish/subscribe handlers, SSE-style streaming routes, and local subscriber verification. Pairs with harper-resources, harper-config-yaml, harper-schema-graphql, and harper-build-and-deploy. --- # Harper Realtime ## Overview Harper exposes live data through the same Resource model used for REST and
tools
--- name: harper-realtime description: This skill should be used when adding or troubleshooting Harper (HarperDB/Fabric) real-time behavior: MQTT topics, WebSocket resource subscriptions, resource publish/subscribe handlers, SSE-style streaming routes, and local subscriber verification. Pairs with harper-resources, harper-config-yaml, harper-schema-graphql, and harper-build-and-deploy. --- # Harper Realtime ## Overview Harper exposes live data through the same Resource model used for REST and