Mahjong AI

v1.0.1

AI Mahjong Assistant 🀄 — Snap a photo of your hand, get optimal discard suggestions. Sichuan Mahjong rules (Blood Battle / 血战到底). Supports tile recognition...

0· 179·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for sceneun1ty/mahjong-ai.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Mahjong AI" (sceneun1ty/mahjong-ai) from ClawHub.
Skill page: https://clawhub.ai/sceneun1ty/mahjong-ai
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install mahjong-ai

ClawHub CLI

Package manager switcher

npx clawhub@latest install mahjong-ai
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name/description (Mahjong AI, Sichuan rules, discard suggestions) match the included README, DEVLOG, SKILL.md, and the provided analysis script; required resources (none) are appropriate for an offline Python analyzer.
Instruction Scope
SKILL.md describes a workflow that includes visual recognition of a photographed hand and then running the local analyzer with parsed tiles. The repository contains guidance for tile-vision (references/tile_visual_guide.md) but no vision/model code or network endpoints. The instructions appropriately ask the agent to list recognition results for user confirmation before analysis — clarify where image recognition runs (platform-provided vision vs. external service) to close this gap.
Install Mechanism
No install spec; code is a standalone Python script using only standard-library modules (argparse, collections, itertools, sys). No downloads, package installs, or third‑party binaries are requested.
Credentials
No environment variables, credentials, or config paths are required. The skill does not request unrelated secrets or elevated access.
Persistence & Privilege
Skill is not always-enabled and uses normal model invocation. It does not request system-wide changes or persistent elevated privileges.
Assessment
This skill appears to be a local Mahjong analysis tool (python script + docs) and does not request credentials or install external packages. Before installing/use, confirm: (1) how the photo→tile recognition step is performed — the bundle contains a visual guide but no vision model or remote endpoint; if your agent/platform performs vision, ensure images are not sent to unknown external services; (2) inspect scripts/mahjong_analyze.py for any network calls or filesystem operations (the visible portion uses only stdlib but review the whole file); (3) run the script in an isolated environment (e.g., a sandbox or virtualenv) to verify behavior and outputs; and (4) if you plan to share images, be comfortable with where they are processed/stored. If you want, I can scan the full mahjong_analyze.py file for network I/O, subprocess usage, or other risky operations.

Like a lobster shell, security has layers — review code before you run it.

latestvk977m9frptpabr7hv9kqrgyyjn83cm70
179downloads
0stars
3versions
Updated 1mo ago
v1.0.1
MIT-0

麻将 AI 助手 🀄

川麻(四川麻将)AI 出牌顾问。拍照发手牌,分析最优出牌。

规则:川麻(血战到底)

  • 只有 筒、条、万 三门,共 108 张(每种 1-9 各 4 张)
  • 每人 13 张手牌,摸牌后 14 张选择出牌
  • 胡牌条件:4 组面子(顺子/刻子)+ 1 对将(雀头)
  • 特殊胡法:七对、龙七对、清一色、对对胡等
  • 血战到底:一人胡了继续打,直到剩一人没胡

工作流程

Step 1: 识别牌面(拍照)

收到照片后,用视觉识别:

  1. 手牌(13或14张)
  2. 场上已打出的牌(牌池/河牌)
  3. 已碰/杠的牌

编码格式:

  • 万子:1m 2m ... 9m
  • 筒子:1p 2p ... 9p
  • 条子:1s 2s ... 9s

列出识别结果让用户确认后再分析。

Step 2: 运行分析

python3 scripts/mahjong_analyze.py \
  --hand "1m,2m,3m,5m,5m,3p,4p,7p,8p,9p,2s,3s,4s,6s" \
  --discard "1p,2p,5p,5p,9s,9s" \
  --meld "6m,6m,6m"

参数:

  • --hand / -H:手牌(必填,13或14张)
  • --discard / -d:场上已打出的牌(可选)
  • --meld / -m:已碰/杠的牌(可选)

Step 3: 输出建议

  • 14张 → 推荐打哪张,附安全度🟢🟡🔴 + 听牌张数
  • 13张 → 显示听什么牌 + 剩余张数
  • 安全度基于场面已出牌计算(出越多越安全、19边张更安全)

川麻特殊规则

  • 不能吃,只能碰/杠/胡
  • 血战到底:一人胡了继续打
  • 番数:清一色4番、七对4番、龙七对8番、对对胡2番

参考

  • 详细牌理:见 references/mahjong_theory.md

Comments

Loading comments...