← 返回 Skills 市场
sceneun1ty

Mahjong AI

作者 sceneun1ty · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
186
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install mahjong-ai
功能描述
AI Mahjong Assistant 🀄 — Snap a photo of your hand, get optimal discard suggestions. Sichuan Mahjong rules (Blood Battle / 血战到底). Supports tile recognition...
使用说明 (SKILL.md)

麻将 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
安全使用建议
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.
功能分析
Type: OpenClaw Skill Name: mahjong-ai Version: 1.0.1 The mahjong-ai skill bundle is a legitimate Mahjong assistant designed for Sichuan Mahjong rules. The core logic in scripts/mahjong_analyze.py is a self-contained Python script using only standard libraries to calculate game states (shanten, waiting tiles) and provide strategic advice. The instructions in SKILL.md and documentation in README.md/DEVLOG.md are entirely consistent with the stated purpose, showing no signs of malicious intent, data exfiltration, or prompt injection attacks.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install mahjong-ai
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /mahjong-ai 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
川麻AI出牌顾问:拍照识别手牌+最优出牌分析+听牌计算+安全度评估
v1.1.0
Added English README, improved description and tags for international users
v1.0.0
Initial release
元数据
Slug mahjong-ai
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Mahjong AI 是什么?

AI Mahjong Assistant 🀄 — Snap a photo of your hand, get optimal discard suggestions. Sichuan Mahjong rules (Blood Battle / 血战到底). Supports tile recognition... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 186 次。

如何安装 Mahjong AI?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install mahjong-ai」即可一键安装,无需额外配置。

Mahjong AI 是免费的吗?

是的,Mahjong AI 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Mahjong AI 支持哪些平台?

Mahjong AI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Mahjong AI?

由 sceneun1ty(@sceneun1ty)开发并维护,当前版本 v1.0.1。

💬 留言讨论