add-trigger

Automate MTG triggered ability integration from event firing to stack placement.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/gamajose/MagicTheGathering --skill add-trigger-gamajose
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-trigger
Source: https://github.com/gamajose/MagicTheGathering/tree/main/.claude/skills/add-trigger
Command: npx skills add https://github.com/gamajose/MagicTheGathering --skill add-trigger-gamajose

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In MTG engine development, implementing and maintaining the full lifecycle of triggered abilities is complex and error-prone. This skill provides a structured approach to model TriggerDefinition, TriggerMode, the matcher registry, APNAP ordering, targeting, intervening-if, constraints, and the parser wiring to ensure consistent behavior.

Core Features & Use Cases

  • Triggers workflow coverage: From event firing to stack placement, including APNAP ordering and intervention-time checks.
  • Parser and registry integration: Guidelines for Oracle-trigger parsing, trigger definitions, and registry hookups.
  • Testing guidance: References for parser tests, matcher tests, and end-to-end integration tests.

Quick Start

Define a new "Whenever" trigger for a spell cast or a new "At the beginning of" phase trigger to validate the pipeline end-to-end.

Frequently Asked Questions about add-trigger

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

FAQPage Schema
How do I model MTG triggered abilities in a game engine?

To model MTG triggered abilities, you update TriggerDefinition, TriggerMode, the matcher registry, and parser rules to handle the full pipeline from event firing to stack placement safely.

How does APNAP ordering work for triggered abilities?

APNAP ordering for triggered abilities is handled during the trigger pipeline from event firing to stack placement. The engine processes triggers in Active Player Non-Active Player sequence to maintain correct game state timing.

How do I implement intervening-if clauses in MTG trigger definitions?

Intervening-if clauses are implemented by adding intervention-time checks within the TriggerDefinition. The trigger pipeline validates these conditions when the ability moves from event firing to stack placement.

What is the best way to parse Oracle triggered ability text into engine definitions?

Parsing Oracle triggered ability text requires updating parser rules and integrating them with the matcher registry. The parser extracts trigger definitions from Oracle text and wires them into the engine's trigger pipeline.

What testing is needed for MTG triggered ability integration?

Testing MTG triggered ability integration requires parser tests, matcher tests, and end-to-end integration tests. These validate the trigger workflow from event firing through APNAP ordering to stack placement.

Can I add a new phase trigger without breaking existing triggered abilities?

Adding a new phase trigger requires updates to TriggerMode, TriggerDefinition, and the matcher registry. Following the structured trigger pipeline ensures the new trigger integrates safely without disrupting existing event firing or stack placement.