payload-engine

Documents the Payload game engine architecture, simulation rules, and content declaration workflow.

1|Updated Aug 31, 2026
One-click install
npx skills add https://github.com/gagandeepgill/puzzle-game --skill payload-engine-gagandeepgill
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: payload-engine
Source: https://github.com/gagandeepgill/puzzle-game/tree/main/.claude/skills/payload-engine
Command: npx skills add https://github.com/gagandeepgill/puzzle-game --skill payload-engine-gagandeepgill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It gives developers a map of the Payload engine-builder codebase so they can safely add or change parts, blueprints, jams, difficulties, and quotas without breaking determinism, fairness, or the parity tests that guard the scoring maths. ## Core Features & Use Cases - Engine architecture map: Explains the split between the pure rules engine in src/game (types, content, simulate, run, rng, daily, preview) and the React views in src/ui that replay the event log. - Content declaration guide: Step-by-step rules for adding parts to PARTS and applyPart, blueprints to BLUEPRINTS, jams to DIFFICULTIES, and full difficulty definitions, including pool placement and compendium sync. - Invariant enforcement: Documents the five invariants that keep runs deterministic and fair, such as seeded Fisher-Yates shuffling, guaranteed scaler drafts, and visible event logging for every score change. - Use Case: When a drop scores wrong or marbles animate out of sync with what fired, use this Skill to trace simulateDrop, the DropEvent log, and the playback regrouping to find whether the bug lives in the rules or the renderer. ## Quick Start Ask the AI to use the payload-engine skill to add a new part type to the game and walk through the required changes in PARTS, applyPart, and the difficulty pools.

Frequently Asked Questions about payload-engine

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

FAQPage Schema
How do I add a new part to the Payload game engine?▼

Add the part to PARTS in content.ts with a glyph, name, badge, rule and role, add an exhaustive case in applyPart in simulate.ts, then add the key to the difficulty pools for the rounds where it should appear. A part missing from every pool is dead content.

How does the marble drop simulation work in Payload?▼

simulateDrop is a pure function taking a board, a column and a Rules object, returning the banked total plus an ordered DropEvent log. The React renderer replays that log at any speed, so the engine decides what happened and the view only decides how fast to show it.

Why does the daily game deal different offers across browsers?▼

That happens when shuffling uses sort with a random comparator, whose comparator call count is implementation-defined. The engine requires Fisher-Yates over explicit seeded rng draws so the same seed deals identical offers in every browser.

What breaks if I read difficulty quotas directly instead of helpers?▼

Reading difficulty.quotas directly skips the daily variant multiplier, silently desyncing the HUD from the win check. Always read config through quotaFor, dropsForRound, jamFor and rulesFor, which fold in difficulty and variant together.

When should the parity test fail after changing scoring?▼

parity.test.ts diffs simulateDrop against a transcription of the original runMarble over 4000 random boards. An intended scoring change should fail it and requires deliberately updating the transcription; an unintended failure means the test caught an accidental maths change.