Score a mahjong game in real time. Track players, seats, fans (faan), points, and running standings. English-focused with natural language hand description parsing.
Based on Hong Kong mahjong scoring rules.
| Tool | Purpose |
|---|---|
mahjong_start_game |
Set up a new game: player names, seats, scoring config |
mahjong_score_hand |
Score a completed hand: faan -> points -> payment -> standings |
mahjong_amend_hand |
Fix the last hand: add forgotten items or replace entirely |
mahjong_status |
Show current standings and recent hand history |
mahjong_end_game |
End game: final results, hand-by-hand summary, clear state |
The bundled skill (mahjong-scorer) teaches the assistant the game flow:
- Collect player names/seats via form UI
- Go on standby (10-20 min between hands)
- Parse natural language hand descriptions into faan keys
- Call the scoring tool and present results
- Handle amendments ("actually that last hand was also concealed")
- Report standings on request
- End game with final summary
- Faan is the unit of hand value. Multiple categories stack.
- Min faan: 3 (default). Below = false win.
- Max faan: 13 (absolute cap). Some games cap at 10.
- Full Spicy: points = 2^faan
- Half Spicy: gentler curve from 4 faan onward
- Payment: Discarder pays all (default) or half. Self-pick = all pay 1.5x.
- Limit hands (10-13 faan) supersede wind/dragon/flower faan.
See skills/mahjong-scorer/references/hk-fan-table.md for the complete fan table.
mahjong-scorer/
├── package.json
├── config.json
├── README.md
├── src/
│ ├── scoring-engine.ts # Fan table, stacking rules, faan->points, payment calc
│ └── game-state.ts # State persistence, round rotation, standings
├── tools/
│ ├── mahjong_start_game.ts
│ ├── mahjong_score_hand.ts
│ ├── mahjong_amend_hand.ts
│ ├── mahjong_status.ts
│ └── mahjong_end_game.ts
└── skills/
└── mahjong-scorer/
├── SKILL.md
└── references/
└── hk-fan-table.md
Different mahjong rule sets can be shipped as new versions:
- v0.2.0: Japanese Riichi
- v0.3.0: Singapore
- v0.4.0: American NMJL
- etc.
Each version would extend the scoring engine with variant-specific fan tables and rules while keeping the same tool interface.