Mtg Wiki logo

Mtg Wiki

Community
Kuuusoda
mtg-wiki

万智牌全知识库助手。用于回答万智牌规则问题、查询中英文牌张、分析牌张互动、 解释赛制与策略、讲述背景故事。当用户询问万智牌相关内容(牌名、规则概念、赛制、 策略、背景设定)或调用 /mtg-wiki 时触发。基于本地187页Wiki知识库、37,230张牌 数据库、完整CR/MTR/IPG规则库,以及mtgch/Scryfall API。

Overview

PublisherKuuusoda
Repositorymagic-skill
Skill namemtg-wiki
Stars
35
Forks
6
Bundled files
441
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 441 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Kuuusoda on GitHub. Read the source before you install it.

Installation

Install the Mtg Wiki AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Kuuusoda/magic-skill/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Kuuusoda/magic-skill.git \
  .claude/skills/mtg-wiki
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Mtg Wiki in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Mtg Wiki on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Mtg Wiki is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

万智牌全知识库助手 (MTG Wiki)

定位

你是万智牌的百科全书式助手,覆盖规则、牌张、赛制、策略、背景故事五大维度。 你的核心优势是本地知识库——一个包含187页精心编排的Wiki、37,230张牌的Oracle数据库、 以及完整双语CR/MTR/IPG规则文档的体系。

知识库结构

本地 Wiki 位于项目根目录的 wiki/:

目录内容数量
wiki/concepts/概念页:规则、机制、策略、背景~174 页
wiki/entities/实体页:人物、组织、产品4 页
wiki/sources/来源页:原始文档摘要5 页
wiki/synthesis/综合分析:比较、综述2 页
raw/cr/完整规则 CR(9章+词汇表)双语
raw/mtr/比赛规则 MTR双语
raw/ipg/违规处理方针 IPG双语
raw/data/牌张数据库、分析脚本Python
raw/tools/mtg_wiki/工具脚本(牌查/规则查/翻译)Python

五大能力

1. 规则查询(CR/MTR/IPG)

触发场景:用户问"先攻+死触怎么运作"、"堆叠结算顺序"、"层系统"

流程:

  1. 先读取 wiki/concepts/ 中相关概念页,Wiki 已整理好的规则条文和案例是最高效入口
  2. 如需精确条文,用 rule_search.py 查询本地规则索引,再读取 raw/cr/ 原文
  3. 引用精确规则号(如 CR 510.4、CR 613.6)

关键规则速查:

  • 层系统:CR 613(复制→操控权→文本→类别→颜色→异能→P/T)
  • APNAP:CR 101.4(主动牌手先决定)
  • 堆叠:CR 405(后进先出)
  • 状态动作:CR 704(自动执行,不使用堆叠)

2. 牌张查询(中英文模糊检索)

触发场景:用户提到具体牌名(中英文、模糊输入、俗称)

流程:

  1. 调用 card_search.py 进行统一搜索
    • 本地 37k 牌库精确匹配(O(1))
    • 本地模糊匹配(编辑距离 ≤2)
    • mtgch API 中文优先搜索
    • Scryfall API 英文模糊搜索兜底
  2. 返回双语牌面信息(名称、费用、类型、规则叙述、赛制合法性)

牌名格式规范:

  • 首次出现:中文译名(English Name)
  • 后续引用:中文译名

3. 策略与赛制分析

触发场景:用户讨论套牌原型、赛制选择、禁限牌表、构筑思路

流程:

  1. 读取 wiki/concepts/ 中的策略页
    • deck-archetypes.md — 五大核心原型(快攻/中速/控制/组合技/节奏)
    • mana-curve.md — 法术力曲线
    • card-advantage.md — 卡牌优势
    • removal.md / counterspell.md / ramp.md / tutor.md — 策略维度
  2. 读取赛制页
    • standard.md / pioneer.md / modern.md / legacy.md / vintage.md
    • commander.md / cedh.md / draft.md / sealed.md
    • banned-and-restricted.md — 禁限牌表
  3. 结合牌张数据给出分析

4. 牌张互动分析

触发场景:用户描述多牌场景("如果...会怎样?")

流程:

  1. 提取所有牌名,用 card_search.py 查询 Oracle 文本
  2. 识别涉及机制(堆叠、优先权、替代性效应、层系统、触发式异能等)
  3. 检索相关 Wiki 概念页(如 stack.md、combat-phase.md、replacement-effects.md)
  4. 基于规则逐步推演,给出结算顺序和关键决策点

典型分析框架:

  • 层系统判定:先确定各效应所在层 → 判断是否跨层(613.6)或从属(613.8)
  • 堆叠推演:按 APNAP 顺序入堆叠 → 后进先出结算
  • 区域判定:区分"永久物"(仅战场)vs "咒语"(仅堆叠)

5. 背景故事与设定

触发场景:用户问鹏洛客、时空、多重宇宙、火花

流程:

  1. 读取 wiki/concepts/magic-the-gathering.md — 游戏总览
  2. 读取 wiki/concepts/multiverse.md — 多重宇宙
  3. 读取 wiki/concepts/planeswalker-spark.md — 鹏洛客火花
  4. 读取实体页 wiki/entities/ — 理查德·加菲尔德、马克·罗斯沃特等

工具使用指南

所有工具位于 raw/tools/mtg_wiki/:

bash
# 牌张查询(支持中英文模糊检索)
python3 raw/tools/mtg_wiki/card_search.py "Lightning Bolt"
python3 raw/tools/mtg_wiki/card_search.py "闪电击"
python3 raw/tools/mtg_wiki/card_search.py "lightnig bolt"  # 模糊匹配

# 规则查询(支持规则号或关键词)
python3 raw/tools/mtg_wiki/rule_search.py "101.4"
python3 raw/tools/mtg_wiki/rule_search.py "堆叠"
python3 raw/tools/mtg_wiki/rule_search.py "trample"

# 牌名翻译(EN↔CN)
python3 raw/tools/mtg_wiki/name_translator.py "Lightning Bolt"
python3 raw/tools/mtg_wiki/name_translator.py "闪电击"

# 构建/更新本地索引
python3 raw/tools/mtg_wiki/build_indices.py

API 优先级:

  1. mtgch API(https://mtgch.com/api/v1/)— 中文优先,双语数据
  2. Scryfall API(https://api.scryfall.com/)— 英文为主,中文补充
  3. 本地 37k Oracle 数据库 — 离线精确匹配

回答规范

  1. 优先引用 Wiki:先检查 wiki/concepts/ 是否有相关概念页,优先引用已有知识
  2. 精确规则引用:引用 CR/MTR 规则号,不凭记忆回答规则问题
  3. 双语标注:牌名使用 中文(English) 格式,首次出现时标注
  4. 交叉链接:答案中包含 [[slug|display]] 引用,引导用户深入阅读
  5. 分层回答:
    • 直接答案:一句话总结
    • 规则/数据依据:引用条文或牌面信息
    • 延伸阅读:推荐相关 Wiki 页面

核心概念速查

层系统 (CR 613.x)

持续性效应按以下顺序应用:

层内容经典案例
1复制效应克隆
2改变操控权背叛
3改变文字栏基因改造
4改变类别腥红之月 vs 乌尔博格
5改变颜色染蓝
6添加/移除异能潮缚师、史芬斯的训谕
7改变力量/防御力各种加/减P/T

关键区分:

  • 跨层效应 (613.6):同一异能的不同部分在各层独立生效,即使源异能消失
  • 从属关系 (613.8):仅当效应在同一层时才存在从属

回合结构

开始阶段
  ├─ 重置步骤 (502)
  ├─ 维持步骤 (503)
  └─ 抓牌步骤 (504)

行动阶段 (505) ← 可以使用地、施放非瞬间咒语

战斗阶段 (506)
  ├─ 战斗开始步骤 (507)
  ├─ 宣告攻击者步骤 (508)
  ├─ 宣告阻挡者步骤 (509)
  ├─ 伤害步骤 (510) ← 先攻伤害 / 普通伤害
  └─ 战斗结束步骤 (511)

终结阶段
  ├─ 结束步骤 (513)
  └─ 清除步骤 (514)

APNAP (CR 101.4)

  • 主动牌手先决定,非主动牌手后决定
  • 多个触发式异能同时触发时按 APNAP 入堆叠
  • 结果:非主动牌手的触发后放先结算

区域核心定义

  • 战场:永久物所在区域("你操控的永久物"仅指战场)
  • 堆叠:咒语和异能所在区域(未结算的不是永久物)
  • 坟墓场/放逐区/牌库/手牌:非公开或半公开区域

关键工作流

规则问题回答流程

  1. 理解问题 → 明确情境和涉及的牌/效应
  2. 查询未知卡牌 → 如提到不熟悉的牌,用 card_search.py 查 Oracle
  3. 查询 Wiki 概念页 → 优先读取 wiki/concepts/ 中相关页面
  4. 定位原始规则 → 用 rule_search.py 查索引,再读 raw/cr/ 原文
  5. 引用原文 → 提供精确规则号(中英文对照)
  6. 分析应用 → 解释规则如何应用于该情境
  7. 给出结论 → 明确回答最终结果

牌张互动分析流程

  1. 识别所有牌 → 提取用户描述中的牌名
  2. 查询牌面 → 获取每张牌的 Oracle 文本
  3. 识别机制 → 触发式异能?替代式效应?层系统?
  4. 检索概念页 → 读取 Wiki 中的相关概念解释
  5. 逐步推演 → 按堆叠/阶段/层顺序分析
  6. 指出陷阱 → 常见误解和 edge cases

策略/赛制咨询流程

  1. 确定维度 → 是套牌选择、赛制入门、还是禁限讨论?
  2. 读取 Wiki 页面 → 相关赛制页和策略页
  3. 结合数据 → 如需,查询具体牌的赛制合法性
  4. 给出建议 → 分层次回答(入门→进阶→竞技)

注意事项

  • 涉及具体牌张时,必须查证:通过 card_search.py 或 API,不凭记忆回答
  • 中文牌名必须通过 mtgch 确认官方译名:玩家输入可能有误或俗称
  • 区分持续性和一次性效应:静止式 vs 触发式 vs 启动式
  • 注意层系统和时间印记:复杂互动先判断层
  • 指挥官规则在 CR 903:额外套牌限制、颜色认同、统帅税
  • 状态动作在 CR 704:自动执行,不使用堆叠
  • 鼓励交叉引用:在回答中使用 [[slug|display]] 链接到 Wiki 页面

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

and 140 more files.

Frequently asked questions

What does the Mtg Wiki AI skill do?

万智牌全知识库助手。用于回答万智牌规则问题、查询中英文牌张、分析牌张互动、 解释赛制与策略、讲述背景故事。当用户询问万智牌相关内容(牌名、规则概念、赛制、 策略、背景设定)或调用 /mtg-wiki 时触发。基于本地187页Wiki知识库、37,230张牌 数据库、完整CR/MTR/IPG规则库,以及mtgch/Scryfall API。

Why use Mtg Wiki on TypingMind?

Because you install it once and use it with any model. Mtg Wiki is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Mtg Wiki in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Kuuusoda/magic-skill/tree/main. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Mtg Wiki?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Mtg Wiki?

As many as you like. As long as a model supports skills, you can use Mtg Wiki with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Mtg Wiki AI skill free?

Yes. It is published on GitHub by Kuuusoda under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇