oracle-parser

Project instructions for a parser that turns Magic: The Gathering card text from MTGJSON into typed game abilities. MTGJSON is a structured database of card data, and the instructions define how text should be interpreted by the game engine.

In plain words
What is it for?
Use them when adding or fixing card-text patterns, handling targets and subjects, composing effects, or replacing unimplemented parser fallbacks.
Why use it?
They provide the required parsing rules and prevent new card-text support from breaking established behavior or official rules references.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/phase-rs/phase/oracle-parser
Any agent
npx skills add phase-rs/phase --skill oracle-parser
Clone the repo
git clone --depth 1 https://github.com/phase-rs/phase

Made for: Claude Code, Codex.

Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 19,940 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00082 $0.19940
Opus 5 $0.00041 $0.09970
Sonnet 5 $0.00016 $0.03988
Haiku 4.5 $0.00008 $0.01994

Measured yesterday against content hash f163aab8e5d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

oracle-parser 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 yesterday.

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.

.claude/skills/oracle-parser/SKILL.md · 1,091 lines

How it starts

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

Oracle Parser — Single Source of Truth

The Oracle parser converts MTGJSON Oracle text into typed AbilityDefinition structs that the engine executes. This skill is the authoritative reference for all parser work.

CR Verification Rule: Every CR number you write MUST be verified by grepping docs/MagicCompRules.txt BEFORE adding it to code. See Section 8.


1. Non-Negotiable Rules

These rules are defined in CLAUDE.md and are enforced without exception. Violations will be caught in review and must be fixed before merge.

⚠ RULE ZERO: Nom Combinators Are Mandatory — No Exceptions

All new parser code MUST use nom combinators from the very first line written. This is the single most important rule in the parser codebase. It has been violated repeatedly and is now enforced as a hard gate.

NEVER write any of these for parsing dispatch:

  • find(), split_once(), contains(), starts_with() — for dispatch routing
  • if lower.starts_with("destroy ") — use tag("destroy ").parse(lower) instead
  • if lower.contains("target") — use scan_at_word_boundaries or a nom combinator instead
  • text.find(' ').map(|i| &text[..i]) — use nom take_till or take_while

ALWAYS write:

  • tag("destroy ").parse(lower)? — for known prefix dispatch
  • alt((tag("destroy "), tag("exile "))).parse(lower)? — for multi-option dispatch
  • nom_on_lower(text, lower, parser_fn) — for mixed-case text bridging to nom
  • nom_on_lower_required(text, lower, parser_fn)? — same with ? propagation
  • nom_parse_lower(lower, parser_fn) — when remainder is unused
  • scan_at_word_boundaries(text, combinator) — for multi-position phrase matching

Nom combinator reference: See nom_combinators.md in this skill directory for the complete list of nom parsers and combinators organized by module. Consult this when choosing which combinator to use.

Copy-paste patterns + the enforcement gate: When you need to translate a string-method idiom into combinators, open crates/engine/src/parser/oracle_nom/PATTERNS.md — it indexes every common shape (strip prefix, strip suffix, optional trailing clause, alternatives, word-boundary scan, delimiter split, contains-check, peek-without-consume) with copy-pasteable code. The pre-commit hook scripts/check-parser-combinators.sh actively rejects new lines containing .strip_prefix(...), .strip_suffix(...), .contains("..."), .starts_with("..."), .ends_with("..."), .split_once(...), .find("..."), or .trim_end_matches("...") against string literals inside crates/engine/src/parser/. If a use is genuinely structural (post-tokenization punctuation cleanup, TextPair dual-string stripping, runtime char scans) annotate the line // allow-noncombinator: <one-line reason> per PATTERNS.md §9. Existing offenders are grandfathered; new code is gated.

Read the full file on GitHub · 1,091 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. yesterday First seen · 1,091 lines · 82 tokens per session scan A f163aab8e5d2

Subscribe to this mod's changes

oracle-parser is a skill published in the GitHub repository phase-rs/phase (259 stars, last pushed yesterday), licensed Apache-2.0. It adds 82 tokens to every session and 19,940 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

qa-cli-mcp-api

Select and run explicitly requested, risk-based QA for Anarlog's CLI, webhooks, stdio MCP, hosted Cloud API, and remote MCP. Test only affected lanes unless comprehensive coverage is requested.

fastrepl/anarlog · 47 tokens

product-update-newsletter

Draft, update, or audit a crisp, changelog-grounded Anarlog product-update newsletter in Loops (app.loops.so) for a desktop release. Use after the changelog is merged, when asked to draft, revise, or pre-send check the release announcement email.

fastrepl/anarlog · 62 tokens

sqlite-schema-design

Design or review schemas for crates/cloudsync using SQLite Sync constraints, not generic SQLite advice. Use when adding synced tables, changing synced columns, or planning CloudSync-safe migrations.

fastrepl/anarlog · 42 tokens

release-new-version

Release a new desktop stable version for Anarlog. Use when asked to cut, publish, or prepare a new stable desktop release after checking and merging the changelog.

fastrepl/anarlog · 38 tokens

fix-ready-prs

Inspect every open non-draft PR for CI failures and unresolved Cursor Bugbot findings, then fix them on the existing PR branches. Use when asked to check active PRs, triage ready PRs, fix CI, or address Bugbot comments.

fastrepl/anarlog · 55 tokens

reactive-sqlite-ui

Build SQLite-backed reactive UI in apps/desktop using stable patterns for reads, selection, forms, writes, and loading states. Use when implementing or reviewing screens built on useDrizzleLiveQuery and SQLite mutations.

fastrepl/anarlog · 53 tokens