What problem does it solve? Game codebases drift into invalid states when phases are modelled as parallel booleans, ids are passed as interchangeable numbers, and the rules engine leaks renderer dependencies. This Skill encodes the TypeScript conventions that make illegal states unrepresentable and keep the pure rules engine in src/game free of any DOM or React knowledge. ## Core Features & Use Cases - Discriminated union phases: Model game phases as a union on a kind field with an assertNever default, so adding a phase produces compiler errors instead of runtime bugs. - Exhaustive part handling: Define parts via a const tuple, a Record<PartKey, PartDef> table, and switch-based resolution so a new part cannot silently no-op. - Branded ids and readonly outputs: Distinguish CellIndex from Column at compile time and return readonly structures from the engine for honest replay and reliable React change detection. - Use Case: When adding a new part type or blueprint to the Payload engine, follow these conventions so the compiler lists every site that needs updating rather than letting one resolver quietly skip the new key. ## Quick Start Ask the AI to add a new part type to src/game following the typescript-game-state conventions, including the PART_KEYS entry, PARTS record entry, and exhaustive switch case.