casting-stack-conditions

Analyze and extend MTG casting pipeline with stack resolution and condition systems.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The MTG rules engine presents significant complexity around casting, stack management, and condition evaluation. This Skill provides a structured approach to implementing, validating, and extending the casting pipeline to ensure correct behavior and consistency across spell casting and abilities.

Core Features & Use Cases

  • Cohesive casting flow: unify spell casting, target selection, and cost handling with a shared set of primitives.
  • Modal and resolution-time support: enable modal choices and interactive resolutions using a robust WaitingFor state machine.
  • Extensibility for new casting steps and conditions: add or modify casting steps, costs, and conditional logic with minimal risk.
  • Use Case: engine developers adding new casting features or refining interactivity within the stack, priority, and resolution paths.

Quick Start

Review the Casting, Stack & Condition Systems to implement or adjust a casting step, stack behavior, or condition check in the engine.

Frequently Asked Questions about casting-stack-conditions

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

FAQPage Schema
How do I implement MTG stack resolution and mana payment in a rules engine?

Implement MTG stack resolution and mana payment using shared primitives like PendingCast and StackEntry to unify casting requests, target selection, and cost handling into a cohesive flow. This structured approach ensures consistent behavior across the pipeline.

What is a WaitingFor state machine and how does it handle modal abilities in MTG?

A WaitingFor state machine manages interactive resolutions and modal choices during MTG casting by pausing the pipeline to await player input. This enables robust modal ability handling and ensures correct condition-driven rules across the engine.

How do I add new casting steps and condition checks to an existing MTG engine?

Add new casting steps and condition checks by extending the structured casting pipeline with minimal risk. The system supports extensibility for new costs, conditional logic, and interactivity refinements within the stack and priority resolution paths.

Can I use this to modify stack behavior and priority paths for custom rules?

Yes, you can modify stack behavior and priority paths for custom rules. The system applies to engine developers implementing or adjusting casting steps, condition evaluation, and resolution paths across the game engine with minimal risk.

Does this rules engine approach support the full lifecycle of a spell cast?

Yes, this approach supports the full spell cast lifecycle from initial casting requests and modal handling to mana payment, stack resolution, and continuation. It uses PendingCast and StackEntry constructs to manage the complete pipeline.