plugins/src/phaser/skills/phaser-physics/SKILL.md
This skill should be used when working with physics in a Phaser 4 game — Arcade physics bodies, velocity/acceleration, colliders and overlaps, the fixed timestep, groups and static groups, and when (rarely) to reach for Matter.js instead. Use it when adding movement, collision, platforming behavior, or debugging tunneling/jitter. Pairs with phaser-gameobjects and phaser-scenes.
npx skillsauth add codyswanngt/lisa phaser-physicsInstall 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.
Phaser 4 bundles the same two engines as v3: Arcade (AABB, fast, the default) and Matter.js (full rigid-body). The opinionated default is Arcade; Matter is opt-in for genuinely physical mechanics (stacking, joints, torque). Bundled Spine left v4, Matter did not.
Key v4 fact: Arcade's fixedStep defaults to true — the world steps at a
fixed rate decoupled from render FPS. Keep it. Fixed-step physics is what makes
movement deterministic across 60 Hz/144 Hz displays and what makes
logic-level tests reproducible. Do not switch to variable step to mask a bug.
// game config
physics: { default: "arcade", arcade: { gravity: { x: 0, y: 0 }, debug: false } }
// scene
const player = this.physics.add.sprite(x, y, Tex.GameAtlas, "player");
player.setCollideWorldBounds(true);
const platforms = this.physics.add.staticGroup();
this.physics.add.collider(player, platforms);
this.physics.add.overlap(player, pickups, (p, item) => this.collect(item), undefined, this);
setVelocity, setAccelerationX),
never by writing x/y per frame — direct position writes teleport the body
past colliders and create tunneling.body.reset(x, y)).setDrag, setBounce, setMaxVelocity.body.blocked.down (world/static contact) rather
than touching.down alone.collider separates bodies; overlap only reports. Pickups/triggers are
overlaps; walls/floors are colliders.create between groups — never inside
update (a per-frame add.collider leaks collider objects and tanks the
frame rate).body.enable = false) or dead objects keep colliding invisibly.fixedStep: true, give
walls thickness, cap speed with setMaxVelocity.get() or wasn't disabled on despawn.update scaled by render delta.Choose Matter for: realistic stacking/toppling, constraints/joints, compound bodies, polygon collision shapes. Run it in a dedicated scene; don't mix Arcade and Matter for the same entities. If the mechanic is "platformer/top-down/ shmup", the answer is Arcade.
Physics-adjacent randomness (spawn jitter, knockback variance) uses the seeded
Phaser.Math.RND — never Math.random() — so a recorded seed reproduces a run
exactly. Combined with fixed-step Arcade, gameplay bugs become replayable; see
[[phaser-testing]].
Physics changes are verified by playing the affected interaction in the running
game with arcade.debug: true toggled on (body outlines visible), confirming
contacts/velocities behave as specified, then toggling debug back off before
committing.
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.