Under the hood

We don’t code every card.
We read them.

There are tens of thousands of cards, and hundreds more arrive every few months. Hand-scripting each one doesn’t scale — and worse, hand-scripted cards drift out of date and disagree with each other. So this engine is built differently.

Two layers

The rules core knows the game — priority, the stack, combat math, replacement effects, state-based actions — but knows nothing about any individual card. The synthesis layer reads each card’s official rules text and composes its behavior out of small, verified building blocks: triggers, costs, filters, effects. A new card that’s made of known pieces just works, the day its text is available.

The strict part: exact-or-nothing

A card is only playable with rules enforcement when every clause of its text is modeled. If the engine understands three of a card’s four abilities, it claims none of them — a card that mostly works is worse than a card that honestly says “not yet.” Every claim names the exact rule it implements, and anything the engine can’t claim precisely is deferred, visibly:

> probe “example card”
CLAIMED  “Flying”
CLAIMED  “Whenever this creature attacks, it connives.”
DEFERRED “…an unusual clause the engine can’t yet model exactly”
> verdict: not playable yet — no half-right cards

How we keep ourselves honest

Then we found out the official client works the same way

After settling on this architecture, we read an engineering post by the team behind the game’s official digital client — “On Whiteboards, Naps, and Living Breakthrough” (Alex Werner, 2023). Their rules engine, too, knows nothing about individual cards; a parser turns card text into rules, and roughly 80% of new cards work automatically. The line that stuck with us: “almost none of the work we ever do is just for one card.” That’s exactly how we build — every new capability is a reusable piece, and whole families of cards light up at once. Where our approach differs: they finish the last stretch by hand; we hold the exact-or-nothing line and defer instead.

Inspiration & provenance

The engine is a clean-room implementation built from the publicly published comprehensive rules. Long-running open-source rules engines were studied as behavioral references for tricky edge cases — never as source. Card data and imagery are served via Scryfall. The engine plays thousands of full four-player games against itself as its own regression net.

← Back to the table