performance-development-guidelines

Enforces bounded game-loop performance practices for Phaser scenes, sprite pools, and autosave systems.

Updated Jun 10, 2026
One-click install
npx skills add https://github.com/mudman1986/quarterless --skill performance-development-guidelines-mudman1986
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-development-guidelines
Source: https://github.com/mudman1986/quarterless/tree/main/.github/skills/performance-development-guidelines
Command: npx skills add https://github.com/mudman1986/quarterless --skill performance-development-guidelines-mudman1986

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Game loops degrade silently when per-frame allocations, unbounded accumulators, and blocking storage writes accumulate over play time, causing hitches and unrecoverable catch-up work. This Skill provides concrete rules and a review checklist to keep Phaser game loops bounded, measurable, and recoverable. ## Core Features & Use Cases - Fixed-Step Simulation Rules: Clamp frame deltas, cap substeps, and drop stale accumulator backlog so hitches never cause unbounded catch-up work. - Object Pooling Guidance: Reuse persistent pools keyed by stable indices instead of creating or destroying Phaser objects in steady-state frame loops. - Throttling & Review Checklist: Bound minimap redraws, autosaves, and JSON serialization to deliberate intervals, with a checklist for reviewing per-frame allocations and storage writes. - Use Case: When adding a new HUD overlay or autosave feature to a Phaser game, apply these guidelines to verify the change adds no per-frame allocation and write a regression test asserting the invariant directly. ## Quick Start Review my Phaser scene update loop against the performance development guidelines and flag any unbounded per-frame work.

Frequently Asked Questions about performance-development-guidelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent unbounded catch-up work in a Phaser game loop?

Clamp raw frame deltas with dt = Math.min(deltaMs / 1000, MAX_FRAME_DT), use fixed-step simulation with a cap on substeps per rendered frame, and drop stale accumulator backlog when the cap is reached so old time debt never carries forever.

How should I manage sprites in a Phaser update loop?

Use persistent pools keyed by stable indices and hide surplus entries with setVisible(false) instead of creating or destroying game objects in steady-state loops. Allocate lazily only when an object can actually become visible, or preallocate with a measured upper bound.

Why does localStorage autosave cause frame hitches in browser games?

localStorage is blocking, so serializing a full world snapshot with JSON.stringify stalls the main thread. Measure stringify size and time before increasing save cadence, and throttle autosaves to deliberate intervals.

What performance regressions should I test in a game loop?

Test that the accumulator stays bounded after long frames, pool sizes do not grow under repeated syncs, and expensive work like minimap redraws stays throttled. Red/green each regression by removing the fix, confirming failure, then restoring it.

When should gameplay logic stay outside Phaser scenes?

Keep core gameplay rules in pure, Phaser-free modules covered by core tests, and limit Phaser code to rendering and input glue. This separation makes loop invariants cheap to test directly instead of relying on subjective visual symptoms.