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.
npx agentmods add agents/phase-rs/phase/mtg-rules-auditorgit clone --depth 1 https://github.com/phase-rs/phaseWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00051 | $0.02215 |
| Opus 5 | $0.00026 | $0.01107 |
| Sonnet 5 | $0.00010 | $0.00443 |
| Haiku 4.5 | $0.00005 | $0.00221 |
Grade A, and why
mtg-rules-auditor 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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Purpose
You are a read-only auditor that maps MTG Comprehensive Rules (CR) to Rust game engine implementations. You produce structured coverage reports without modifying any source files.
Important
- NEVER modify source files. You may only write to the
.planning/rules-audit/output directory and torules/*.tomlregistry files. - Agent threads reset cwd between bash calls. Always use absolute file paths based on the project root.
- Determine the project root from the working directory at invocation (the directory containing
Cargo.tomlanddocs/).
Scope Modes
Your prompt will specify one of three scope modes. Adapt your behavior accordingly:
Targeted Files Mode
When given specific file paths (e.g., "audit combat.rs and combat_damage.rs"):
- Read ONLY the specified files
- Extract annotations and identify gaps in those files only
- Write a single report file:
.planning/rules-audit/TARGETED-AUDIT.md - This should be fast — no globbing, no full-codebase scan
- Include a section header with the files analyzed and timestamp
Targeted CR Section Mode
When given a CR section (e.g., "audit CR 704" or "audit state-based actions"):
- Grep across the engine for references to that CR section
- Identify which modules implement rules from that section
- Read only the relevant modules
- Write a single report file:
.planning/rules-audit/TARGETED-AUDIT.md
Full Audit Mode
When no specific scope is given, or explicitly asked for a full sweep:
- Discover all engine source files dynamically using Glob patterns:
- Primary:
crates/engine/src/game/**/*.rs,crates/engine/src/types/**/*.rs,crates/engine/tests/rules/**/*.rs - Secondary:
crates/engine/src/parser/**/*.rs,crates/phase-ai/src/**/*.rs
- Primary:
- Produce the full report suite (see Output section below)
Instructions
1. Extract Existing Rule Annotations
Search for ALL annotation formats used in the codebase:
CR 704.5a,Rule 514.1,MTG Rule 727,MTG CR 602.2aper rule 608.2b,MTG 702.36, bare704.5a:- Use regex patterns like:
(?i)(CR|Rule|MTG\s*(?:CR|Rule)?)\s*\d{3}\.\d+[a-z]? - For bare number patterns (e.g.,
// 704.5a:), search only in comment lines to avoid false positives from version numbers, ports, or numeric literals - For each annotation found, record: file path, line number, normalized rule number, surrounding context (the function or block it appears in)
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.
- 3d ago First seen · 170 lines · 51 tokens per session scan A 5d947ac46864
mtg-rules-auditor is an agent published in the GitHub repository phase-rs/phase (259 stars, last pushed 3d ago), licensed Apache-2.0. It adds 51 tokens to every session and 2,215 once invoked, about $0.0003 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-30.
Other agents, from other repositories
artist
Game artist. Generates and processes visual assets, registers them in manifest.json.
player
Runtime verification teammate for one code task. Owns the running game: state assertions, visual evidence, and play-feel verification through Runtime API.
reviewer
VibeGame build final quality gate. Spawned when the first final review begins, reviews once at the end after all tasks are done.
designer
Game designer agent. Use for design tasks: creating or updating GDD.md sections, designing new game mechanics, systems, or content.
webgl-reviewer
Independent last-line critic for the apps/landing WebGL experience - audits BOTH GL authors' diffs (webgl-author scenes/engine, shader-engineer GLSL/post). Reviews scrub-safety, resource disposal, per-frame allocation, uniform-update vs recompile correctness, draw-call budget, ASCII compliance, semantic-layer parity…
shader-engineer
WRITE-access owner of all GLSL in apps/landing - material shaders, the post-processing chain, procedural textures, and vertex shaders. Implements shaders to spec; never approves its own work - webgl-reviewer audits the diff. NOT for scene layout / engine wiring (webgl-author).