oracle-parser

Parse MTG Oracle text into typed ASTs and executable rule definitions.

212|148|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/phase-rs/phase --skill oracle-parser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: oracle-parser
Source: https://github.com/phase-rs/phase/tree/main/.claude/skills/oracle-parser
Command: npx skills add https://github.com/phase-rs/phase --skill oracle-parser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Converts MTG Oracle text into a stable, typed representation that the engine can execute, ensuring consistent rule interpretation and easier maintenance.

For developers, this document serves as the authoritative reference for nom-based parsing patterns, priority rules, AST type systems, and contribution checklists that govern how Oracle text is transformed into actionable game state changes.

Core Features & Use Cases

  • Centralized reference for nom-based parsing patterns, AST types, and helper modules.
  • Detailed guidance on parsing priorities, subject handling, and continuation logic to maintain a single source of truth.
  • Use Case: when introducing a new Oracle text pattern or extending the parser, contributors align with the canonical approach documented here.

Quick Start

Consult this reference before implementing new Oracle patterns to ensure consistency with the Nom-based parsing architecture.

Frequently Asked Questions about oracle-parser

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I parse MTG Oracle text into a typed AST in Rust?

Parsing MTG Oracle text into a typed AST requires using nom combinators within a two-phase parse and lower pipeline to convert text into executable rule definitions. This approach ensures consistent rule interpretation and maintains a single source of truth.

What is the best way to add new Oracle text patterns to an MTG parser?

Adding new Oracle text patterns to an MTG parser involves consulting a centrally verified, frontmatter-based knowledge base to align with canonical nom-based parsing priorities and subject handling, ensuring auditable and consistent parsing behavior across the engine.

Does the nom parser combinator library work well for building MTG game engines?

Nom works well for building MTG game engines because it supports a structured two-phase parse and lower pipeline, transforming complex Oracle text into typed ASTs and executable rule definitions while maintaining strict parsing priorities and subject continuation logic.

Why does my MTG Oracle text parser produce inconsistent game state changes?

Inconsistent game state changes occur when MTG Oracle text parsing lacks a centrally verified knowledge base or fails to follow canonical nom-based parsing priorities, leading to unverified AST types and fragmented rule interpretation across the engine.

How do AST types map to executable rule definitions in a Rust MTG engine?

AST types map to executable rule definitions through a two-phase parse and lower pipeline that first structures the MTG Oracle text into a typed AST, then lowers it into actionable game state changes governed by nom combinator conventions.

When do I need a two-phase parse and lower pipeline for Oracle text?

A two-phase parse and lower pipeline is needed when converting complex MTG Oracle text into executable rule definitions, as it separates syntactic structuring into typed ASTs from semantic lowering, ensuring consistent and auditable engine behavior.