Ten non-negotiable rules for anyone (human or AI) changing this codebase.
- No domain logic in Phaser scenes. Scenes create sprites and bind input. Gameplay rules live in
src/domain/**. - No Phaser imports in
src/domain/**. Enforced by lint and dep-cruiser. Move Phaser code tosrc/runtime/phaser/**. - Keep modules small and single-purpose. If a
*.behavior.tsfile approaches 400 lines, split it. - Prefer adding a new behavior file over expanding a scene file.
- Every changed domain behavior must have an added or updated test.
- Content changes must validate against the schema. Run
pnpm devafter editing JSON; validation errors fail early. - Use the existing file naming conventions exactly. See
docs/ai/naming-conventions.md. - Do not introduce new architectural patterns without an ADR. Use
pnpm new:adr "<Title>". - Prefer explicit interfaces over hidden framework magic. If you need something from the engine, go through a port.
- When in doubt, keep runtime imperative and domain pure.
pnpm checkMust pass. Do not --no-verify past hooks. Fix the root cause.