game-state-debugger

Diagnose Fujian Mahjong game state data for tile-count, duplicate, hand-size, and turn-order inconsistencies.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Teng-AI/mahjong --skill game-state-debugger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: game-state-debugger
Source: https://github.com/Teng-AI/mahjong/tree/main/.claude/skills/game-state-debugger
Command: npx skills add https://github.com/Teng-AI/mahjong --skill game-state-debugger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Debug Fujian Mahjong game state data to quickly identify inconsistencies, miscounted tiles, stuck turns, or desyncs in multiplayer sessions.

Core Features & Use Cases

  • Tile count validation: checks total tiles across wall, discard pile, exposed gold, players' concealed tiles, melds, and bonus tiles for a 128-tile game.
  • Duplicate detection: ensures every tile appears exactly once across all locations.
  • Hand size checks: validates concealed plus meld tiles per player and phase to catch miscounts.
  • Gold tile tracking: validates gold tiles across all locations to ensure there are 4 gold tiles in play.
  • Turn and phase validation: enforces correct turn order and valid calling phases to detect stalls.
  • Meld validation: verifies meld types and sizes (pung/chow/kong) and their tile validity with respect to gold tiles.
  • Full state dump & reporting: provides detailed dumps and a validation report to guide debugging.

Quick Start

Run the full validation and dump using generateValidationReport with the current game state and private hands.

Frequently Asked Questions about game-state-debugger

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

FAQPage Schema
How do I debug Fujian Mahjong game state desyncs in multiplayer?

Debug Fujian Mahjong game state desyncs by running a validation report that checks tile counts, duplicates, hand sizes, and turn order across all players. This pinpoints missing tiles and invalid phase transitions causing multiplayer session desyncs.

What causes stuck turns or invalid phase transitions in Mahjong game state data?

Invalid phase transitions and stuck turns in Mahjong game state data are caused by unenforced turn orders or invalid calling phases. Turn-order validation and calling-phase checks detect these stalls and diagnose the specific state transition failures.

How do I validate tile counts and detect duplicates in a 128-tile Mahjong game?

Validate tile counts in a 128-tile Mahjong game by checking total tiles across the wall, discard pile, exposed gold, concealed hands, melds, and bonus tiles. Duplicate detection ensures every tile appears exactly once across all locations.

How do I check meld validity and track gold tiles during Mahjong debugging?

Check meld validity by verifying meld types and sizes like pung, chow, and kong against their tile validity. Gold tile tracking validates that exactly 4 gold tiles exist across all game state locations during debugging.

Does this game state debugger work for hand size checks across different game phases?

Yes, hand size checks validate concealed plus meld tiles per player according to the current phase. This catches miscounts in the game state data by enforcing phase-specific hand size constraints across all multiplayer participants.