How the MTG agent runs a build-around challenge — the operator names one or more “must-run” cards (or a commander) and asks for a deck in some format, often on a clock. Companion to the Challenges deck section.
Deckbuilding is an AGENTIC workflow
Use subagents for BOTH the critique and the merge/build — do not hand-build (operator directive, 2026-08-18). Solo work is only the initial fast grounding pull + the orchestration/synthesis. “A critique pass” means spin the panel; “merge and tune” means spawn a finalizer subagent.
A — Commander / card-suggestion requests
- Fix the pool, verified. “Last N sets” → check
released_at+ Arena legality in the Scryfall bulk; never trust memory. Universes Beyond sets (The Hobbit, Avatar, Marvel, Final Fantasy) are Arena-playable even whenmtga.db.arena_rarityis NULL for the newest set — don’t gate playability on rarity being populated. - Pull commander-eligible legends (
can_be_commander=1,legal_brawl=1) with FULL oracle text; curate for genuinely distinct/quirky mechanics, not just power. - “Make an artifact to see the cards” → build a self-contained HTML card gallery
(Scryfall images pulled from
default_cards.jsonimage_uris; handle DFC front faces), publish with/docker/dev/scripts/artifact publish <file> --tags mtg,brawl,commanders, hand back theartifacts.mdbook.me/...URL. Generator pattern lives inscratchpad/gen_*_gallery.py(theme-aware grid, colour pips, set badges, hook per card).
B — The deck build loop
- Ground (solo, fast). Pull FULL card data for the anchor card(s) + the owned pool by
role (synergy / removal / ramp / draw / lands). Filter
owned_qty>0,legal_<format>=1,color_identity ⊆ commander identity. Never truncate card data. - Flag legality/ownership immediately. A named card that’s format-illegal + then a new
card named = the new card replaces it (keep the format).
owned_qtycan LAG the real Arena collection — trust the operator on a specifically-named card over the DB. - Harden panel — 5 lenses, parallel subagents, each fed a card-data brief (full oracle
text) + the design intent. The lenses: (1) engine/wincon, (2) consistency/manabase/curve,
(3) interaction/resilience, (4) synergy/non-bo, (5) legality/ownership. Each returns
concrete cut/add swaps grounded in
data/mtga.db. - Finalizer subagent merges the panel findings + the operator’s draft + the starting build into one tuned list and gates it itself.
- Gate.
python3 scripts/gate_deck.py --format {std|sbrawl|brawl} <file>.- Brawl/Standard-Brawl need Arena
Commander/Decksection headers, singleton,color_identity ⊆ commander, owned. The rare-craft policy flags the commander (an owned-0 rare) — that’s the allowed exception, not a failure. Clean =fails: []with only the commander-craft flag +sizecorrect.
- Brawl/Standard-Brawl need Arena
- Deliver the copyable Arena import as a fenced block:
On a timed challenge, relay the instant the builder finishes — no preamble.``` Commander 1 <Commander> Deck 1 <card> … ```
Domain gotchas (learned on the Hapatra challenge, 2026-08-18)
- Counter payoffs trigger on COUNTERS, not “-X/-X until end of turn.” Hapatra (and any
“-1/-1 counter matters” card) sees
blight/ counter placement — the pile of “-2/-2 until end of turn” removal is engine-inert (looks on-theme, makes no token). - “Enters with N counters” DOES trigger a “whenever you put counters” ability. Per CR 122.6:
“Some spells and abilities refer to counters being put on an object. This refers to putting counters
on that object while it’s on the battlefield and also to an object that’s given counters as it
enters the battlefield.” So a creature entering with -1/-1 counters on itself (Creakwood Safewright,
Gnarlbark Elm, Heirloom Auntie) does trigger Hapatra → one Snake on ETB (a single placement
event = one Snake, per “one or more”). These are legit cheap Snake-makers, not dead bodies.
⚠️ PROCESS LESSON (2026-08-18 miss): a hardening panel had two subagents confidently assert the
OPPOSITE (“CR 121.6 replacement effect, no put event → zero Snakes”) — a hallucinated citation, and it
nearly cut good cards. Two LLM subagents agreeing on a rules point is NOT verification (shared prior).
Rules claims must be checked against Scryfall rulings + the Comprehensive Rules text, never subagent
reasoning, even unanimous. Scryfall API needs a real
User-Agentheader; the CR is a plain-text download. - The +1/+1 buffer trick is real. Putting a -1/-1 counter on a creature carrying a +1/+1
counter still fires the “put -1/-1” trigger, then SBA (CR 704.5q) annihilates the pair —
so a renewable +1/+1 source (Ouroboroid, Hulk Brutal Brawler, proliferate) enables
consequence-free self-blighting. Counter annihilation is a feature. It also flips a
symmetric
-X/-X counters to each creaturesweeper (Darkness Descends) from self-wrath into a one-sided wrath. ⚠️ But Hapatra fires per placement event, not per counter/creature: Darkness Descends puts counters on every creature in one event → one Snake, not one-per-creature; “one or more counters” = a single trigger. Hulk adds only a single +1/+1 to each other creature, so a Hulk-buffered board still nets -1/-1 against a two-counter sweeper — Ouroboroid (X = its power) is the premium enabler. - Go-wide / wide-deathtouch boards need teeth (trample/overrun — Garruk’s Uprising, Full Steam Ahead) or they stall into any board clog / single sweeper.
- Symmetric -X/-X sweepers are self-wraths in a go-wide deck unless a buffer flips them.
- The engine commander is the fragility. Singleton decks that key on the commander want a little protection (e.g. Snakeskin Veil = buffer counter + hexproof, double duty).