Skip to content

How Codex helped me build a combo deck for a new Magic: The Gathering card

Published:
12 min read

This weekend, Magic: The Gathering’s new Marvel Super Heroes set came out. A friend sent me Shang-Chi, Master of Kung Fu and told me, “Alonso, you should play a combo deck with this. I do not know what the combo is, but you should find one.”

I love creature-based combo decks, and green is my favorite color in Magic. Shang-Chi also has the kind of text that gets deckbuilders thinking. That was enough to start digging.

Shang-Chi, Master of Kung Fu Magic card
Shang-Chi was the starting point. The question was whether his text had a real deterministic combo behind it.

I have also been away from competitive Magic tournaments for years, so I did not trust myself to start from memory. Instead, I used Codex and forced the process to start with evidence.

The Scryfall skill

Codex is OpenAI’s agent tool. It can use AI models like ChatGPT, but it can also work with files, tools, commands, and reusable instructions. If you want to try it, start with the official Codex quickstart.

In Codex, a skill is a small playbook for a specific kind of work. It can tell Codex how to use a tool, what assumptions to avoid, and what workflow to follow.

For this project, I created and used a Scryfall API skill.

If you do not play Magic, Scryfall is an online database for Magic cards. It has exact card text, card types, format legality, printings, and other details. That matters because Magic is a game where one word can change whether a combo works.

Codex needed Scryfall as its source of truth.

The easiest way to install the skill is to give Codex the link and ask it to install it:

Install this Codex skill and verify that it works:
https://github.com/aastroza/codex-skills/tree/main/mtg/scryfall-api

In Codex, I selected it by typing the at sign, @, and choosing the Scryfall skill before writing the prompt.

Do not build the deck first

A decklist can hide weak thinking. It can look plausible while being built around an interaction that does not actually work, costs too much mana, or needs too many pieces.

I had already given Codex Shang-Chi as the starting card. Then I used this prompt:

I want to build the strongest competitive Standard combo deck around this card.

Do not build a deck yet.

Use Scryfall API as the source of truth for Oracle text, legality, and exact names. Start from this card only. Search current Standard-legal cards plus future-legal previewed cards, if relevant.

Search broadly across creatures, artifacts, Equipment, Auras, enchantments, triggered abilities, activated abilities, untap effects, and ability-copying/granting effects.

Find and rank every plausible deterministic combo route involving this card.

For each route, include:
- required cards
- rules-accurate loop explanation
- win type: immediate kill, infinite mana, infinite damage, infinite draw, or other deterministic win
- why it works or fails

Output only a ranked list of combo routes. No decklist yet.

Codex searched Standard and future-legal cards. It looked at creatures, artifacts, Equipment, enchantments, activated abilities, untap effects, cost reducers, and payoff cards.

The best output was the filtering: Codex separated real routes from cards that only looked related.

The loop

The prompt had one card: Shang-Chi. The question was whether Standard had a deterministic combo somewhere around him.

Codex found one.

The engine starts with Agatha’s Soul Cauldron and Sleep-Cursed Faerie. If the Faerie is in the graveyard, the Cauldron can exile it, put a +1/+1 counter on Shang-Chi, and give him the Faerie’s activated ability:

{1}{U}: Untap this creature.

That line matters because Shang-Chi already taps for two mana of any one color. His mana can only be spent on activated abilities of creature sources, but the untap ability is now on Shang-Chi himself. Agatha’s Soul Cauldron also lets you spend mana as though it were mana of any color to activate abilities of creatures you control.

So Codex had found the first half of the machine:

  1. Tap Shang-Chi for two mana.
  2. Spend that mana to untap Shang-Chi.
  3. Tap him again.

That loop is real, but it only breaks even on mana. It needs a payoff.

The impressive part was that Codex kept going and found the payoff too: Hawkeye’s Bow. The Bow says that whenever the equipped creature becomes tapped, it deals 1 damage to each opponent. Equip it to Shang-Chi and the harmless loop turns lethal:

  1. Tap Shang-Chi.
  2. Hawkeye’s Bow deals 1 damage.
  3. Use Shang-Chi’s mana to untap him.
  4. Repeat.
Codex identifying Hawkeye's Bow as the strongest Shang-Chi combo route
Codex caught the important detail: the loop breaks even on mana, but Hawkeye's Bow turns every tap into damage.

Here are the core pieces visually:

Shang-Chi, Master of Kung Fu Agatha's Soul Cauldron Sleep-Cursed Faerie Hawkeye's Bow

That was the moment the search became interesting. Codex had not just found cards with overlapping text. It had assembled a rules-based kill from one starting card and a broad search prompt.

Compare routes before choosing one

After the first search, I asked Codex to compare the surviving routes before writing a list.

I used this prompt:

Compare the surviving combo routes competitively.

Rank them by:
- fewest required cards
- lowest mana required to start
- fastest goldfish turn
- immediate kill versus delayed win
- resilience to removal
- resilience to graveyard hate, artifact hate, and counterspells
- how useful each card is outside the combo
- how easy the pieces are to find in Standard
- mana base difficulty

Do not build the deck yet. Choose the single best route and 1-2 backup routes.

For this task, write yourself a new goal and spawn agents in parallel — as many as needed to do it better. Split the work into independent pieces, dispatch them concurrently, and synthesize the results as they return. Give each agent its own dedicated /goal.

Finding a combo is one job. Choosing a tournament plan is another. A route can be clever and still be a bad plan for a tournament deck.

For this comparison, I asked Codex to care about startup mana, goldfish turn, resilience to removal, hate cards, card quality, findability, and mana-base difficulty.

That is where the Hawkeye’s Bow route won. It has a direct kill, uses relatively few pieces, and gives the deck clear support-card targets: find artifacts, put Faerie in the graveyard, protect the permanents, and keep the mana fast.

The goals and subagents trick

Some of the prompts also include a weird-looking instruction. It leans on Codex’s subagents: separate agents that can investigate different parts of the same problem before the main thread synthesizes the result.

In the comparison prompt, that is the paragraph that starts with “write yourself a new goal and spawn agents in parallel.” I use it when I want Codex to keep several lines of thought alive before it commits to one answer.

I picked up this trick from a tweet by Pietro Schirano.

The point is simple: when the problem has several plausible paths, I do not want Codex to fall in love with the first one it sees.

For this deck, I used that pattern to split the analysis into independent questions: speed, resilience, findability, mana base, and sideboard pressure. Then Codex synthesized the results.

The support shell

Once the combo existed, I moved to the shell: which cards help this plan happen in real games?

I used this prompt to ask for the shell:

Now build the best competitive Standard shell around the selected route.

Use Scryfall as source of truth.

Search separately for shell cards, not just combo cards:
- cheap card selection
- artifact, Equipment, enchantment, creature, permanent, and land finders
- tutors
- top-N-card dig effects
- self-mill
- loot/rummage/discard
- graveyard recursion
- artifact/enchantment recursion
- protection for creatures
- protection for artifacts/enchantments/permanents
- counterspells
- hand disruption
- cheap removal
- flexible sideboard answers
- mana fixing and untapped dual lands

For each candidate support card, evaluate:
- which combo pieces it finds
- whether it puts required cards into the graveyard
- whether it recovers destroyed or milled pieces
- whether it is useful when drawn without the combo
- whether it creates dead cards
- how much it stresses the mana base
- whether it speeds up or slows down the goldfish

For this task, write yourself a new goal and spawn agents in parallel — as many as needed to do it better. Split the work into independent pieces, dispatch them concurrently, and synthesize the results as they return. Give each agent its own dedicated /goal.

A combo deck needs more than combo pieces. It needs cards that find the pieces, put the right cards in the graveyard, protect the setup, and make the mana work.

Codex searched for those categories separately. That gave the shell a clearer direction.

Casey Jones, Jury-Rig Justiciar can help find an artifact from the top four cards of the library. That matters when the combo needs Agatha’s Soul Cauldron and Hawkeye’s Bow.

Commune with Beavers can dig for artifacts, creatures, or lands.

Dredger’s Insight can mill cards, help set up the graveyard, and still find an artifact, creature, or land from the milled cards.

Does Machines gives the deck more graveyard setup and can recover artifact pieces later.

Casey Jones, Jury-Rig Justiciar Commune with Beavers Dredger's Insight Does Machines

These cards are the infrastructure. They turn a rules interaction into a deck you can actually shuffle up.

The current list

After the support-card search, I asked for a first list:

Build the best competitive Standard shell around the best route selected above.

Prioritize:
- low curve
- redundancy
- card selection
- tutors/dig
- self-mill or discard if needed
- protection
- interaction
- a realistic fast mana base with dual lands that can enter untapped early
- backup plan using cards that are already useful in the combo

Avoid cute routes that require too many dead cards.

Give a first 60-card maindeck and 15-card sideboard.

For this task, write yourself a new goal and spawn agents in parallel — as many as needed to do it better. Split the work into independent pieces, dispatch them concurrently, and synthesize the results as they return. Give each agent its own dedicated /goal.

The first shell Codex proposed was Temur, Magic shorthand for a blue-red-green deck.

Green is required for Shang-Chi and many of the setup cards. Red gives access to Hawkeye’s Bow and other interaction. Blue makes Sleep-Cursed Faerie castable and opens up better card selection and permission. If you do not play Magic, the important part is that the deck can cast all four combo pieces without stretching into a fourth color. The rest of the deck should support that plan with artifact finding, graveyard setup, protection, removal, and a fast mana base.

I published the current test list on MTGGoldfish as Codex Shang-chi Combo. Treat it as a starting point, not a tuned recommendation.

Visual overview of the Codex Shang-Chi Combo decklist on MTGGoldfish
The current test list as a visual deck layout on MTGGoldfish.

The numbers need testing. The sideboard depends on the Standard metagame. The deck can lose to removal, graveyard hate, artifact hate, counterspells, or faster decks.

But as a starting point, it is much better than guessing.

What worked about the process

The exciting part was bigger than the decklist.

I started with one question: can Shang-Chi become part of a deterministic Standard combo? Codex searched card text, found the Bow line on its own, checked the rules, ranked the routes, and built outward from the best one.

That order matters. If you ask an AI tool for a decklist too early, it can give you 60 cards wrapped around a shaky idea. Asking Codex to prove the idea first made the whole conversation better.

Now the hard part starts. Standard is full of powerful decks, fast clocks, efficient removal, graveyard hate, artifact hate, and counterspells. I still need to find out whether this list can survive that pressure.

But this felt like the right use of Codex. It made a deep search fast enough to fit into one deckbuilding session, without skipping the hard questions. For combo deckbuilding, that is a tool worth keeping on the table.

If you want an email when I publish something new, leave your address here.

Occasional updates about posts, projects, and experiments.


Edit on GitHub