mtg-rules

mtg-rules is a skill for Claude Code, Codex from KaelSensei/MagicAIBuilder. It costs 162 tokens per session (1,489 once invoked), scanned A, original, MIT.

A reference and rules engine for Magic: The Gathering, the trading card game, covering the official game rules and card interactions.

In plain words
What is it for?
Answering questions about how cards and abilities work, including costs, targets, zones, turn structure, combat, and state-based actions.
Why use it?
It provides a structured way to resolve questions about timing, priority, combat, the stack, layers, and other rules that are easy to misinterpret.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Answering questions about how cards and abilities work, including costs, targets, zones, turn structure, combat, and state-based actions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kaelsensei/magicaibuilder/mtg-rules
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add KaelSensei/MagicAIBuilder --skill mtg-rules
Clone the repo
git clone --depth 1 https://github.com/KaelSensei/MagicAIBuilder

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mtg-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/kaelsensei/magicaibuilder/mtg-rules/github.svg)](https://agentmods.dev/skills/kaelsensei/magicaibuilder/mtg-rules)
Your own site
<a href="https://agentmods.dev/skills/kaelsensei/magicaibuilder/mtg-rules"><img src="https://agentmods.dev/badge/skills/kaelsensei/magicaibuilder/mtg-rules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mtg-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/kaelsensei/magicaibuilder/mtg-rules"><img src="https://agentmods.dev/badge/skills/kaelsensei/magicaibuilder/mtg-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 162 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,489 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00162 $0.01489
Opus 5 $0.00081 $0.00745
Sonnet 5 $0.00032 $0.00298
Haiku 4.5 $0.00016 $0.00149

Measured 9d ago against content hash 37e4125da8fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

mtg-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/mtg-rules/SKILL.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Magic: The Gathering Rules Engine

You are an expert MTG rules advisor with comprehensive knowledge of the game's rules. Your role is to provide accurate, authoritative rules answers based on the official Comprehensive Rules document.

Reference Material

The full Comprehensive Rules (effective February 27, 2026) are bundled in references/comprehensive-rules.txt. This is a 9000+ line document, so use it strategically:

How to Navigate the Rules

The rules are organized by numbered sections. Here's the map:

Section Lines (approx.) Content
1xx Game Concepts Golden rules, players, starting/ending, colors, mana, objects, spells, abilities, targets, priority, costs, life, damage
2xx Parts of a Card Name, mana cost, type line, text box, P/T, loyalty, defense
3xx Card Types Artifacts, creatures, enchantments, instants, lands, planeswalkers, sorceries, kindreds, dungeons, battles
4xx Zones Library, hand, battlefield, graveyard, stack, exile, command
5xx Turn Structure Phases, steps, combat (declare attackers/blockers, combat damage)
6xx Spells & Abilities Casting, resolving, activated/triggered/static abilities, continuous effects, interaction of replacement/prevention effects
7xx Additional Rules State-based actions, handling abilities, costs, legality, tokens, copying, face-down, split cards, DFCs, meld, aftermath, adventures
8xx Multiplayer Free-for-all, team variants, Two-Headed Giant, range of influence
9xx Casual Variants 903 = Commander, Planechase, Archenemy, Conspiracy Draft
Glossary End of file Keyword definitions, terminology

Read the full file on GitHub · 106 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 106 lines · 162 tokens per session scan A 37e4125da8fd

Subscribe to this mod's changes

mtg-rules is a skill published in the GitHub repository KaelSensei/MagicAIBuilder (2 stars, last pushed yesterday), licensed MIT. It adds 162 tokens to every session and 1,489 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

organization-best-practices

Configure multi-tenant organizations, manage members and invitations, define custom roles and permissions, set up teams, and implement RBAC using Better Auth's organization plugin. Use when users need org setup, team management, member roles, access control, or the Better Auth organization plugin.

krivoox/agent-stack-template · 61 tokens

changelog-automation

Automate changelog generation from commits, PRs, and releases following Keep a Changelog format. Use when setting up release workflows, generating release notes, or standardizing commit conventions.

krivoox/agent-stack-template · 42 tokens

react-hook-form

React Hook Form performance optimization for client-side form validation using useForm, useWatch, useController, useFieldArray, and the v7.55+ subscribe() API. This skill should be used when building client-side controlled forms with React Hook Form library. This skill does NOT cover React 19 Server Actions…

krivoox/agent-stack-template · 85 tokens

vibe-spec

Spec-driven development workflow plus a production-tested full-stack reference (Next.js 16, Prisma, PostgreSQL, Auth.js/OTP, RBAC, dbt, Zod, Vitest, shadcn/ui, S3, Web Push, GitHub Actions, Vercel). Use when planning a web app spec, choosing stack tools for a feature, breaking work into phases, or implementing a phase…

Connorrmcd6/vibe-spec · 109 tokens

shadcn

Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json…

krivoox/agent-stack-template · 94 tokens

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance…

krivoox/agent-stack-template · 67 tokens