add-replacement-effect

Implement MTG replacement effects with ReplacementDefinition wiring and pipeline integration.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when adding or modifying replacement effects — ETB-tapped, shock lands, damage prevention, "as enters" choices, or any event-modifying ability. This skill covers ReplacementDefinition wiring, the pipeline flow, post-replacement effects, and interactive pre-zone-change choices.

Core Features & Use Cases

  • Understand ReplacementDefinition structure and how it wires into the engine pipeline.
  • Implement ETB and "as enters" style replacements with optional/mandatory modes.
  • Model post-replacement effects and handling of pre-zone-change interactive choices.

Quick Start

Use a simple example to wire a new replacement that marks entering objects as tapped.

Frequently Asked Questions about add-replacement-effect

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

FAQPage Schema
How do I implement ETB tapped replacement effects in an MTG engine?

To implement ETB tapped replacement effects, wire a ReplacementDefinition into the pipeline that modifies the proposed entering event, marking the object as tapped before it resolves on the battlefield.

What is a replacement effect pipeline in Magic rules engine design?

A replacement effect pipeline intercepts proposed events before they resolve, applying mandatory or optional modifications like damage prevention or entering tapped, using defined ReplacementEvent types and ReplacementMode variants.

How do I handle shock land enter the battlefield choices in a rules engine?

Model shock land choices using optional ReplacementMode, triggering an interactive pre-zone-change prompt that asks the player whether to pay life, then applying the modified event to the entering object.

How do mandatory and optional replacement modes work in MTG rules processing?

Mandatory replacement modes automatically apply event modifications like damage prevention, while optional modes require interactive player choices, both managed through the ReplacementDefinition structure and pipeline flow.

How do I register new replacement effects in a Magic the Gathering parser?

Register new replacement effects by updating the engine registry with the ReplacementDefinition, integrating the parser to recognize the ability syntax, and ensuring the pipeline processes pre- and post-zone-change behavior.

Can I modify post-replacement effects after a permanent enters the battlefield?

Yes, the replacement pipeline supports post-replacement effects, allowing you to define behavior that triggers after the modified event resolves on the battlefield, completing the end-to-end lifecycle.