Build the workflow into your own setup

Turn a working process into a reusable Skill.

magic-deck-api-builder is a public example. It keeps the instructions, references, deterministic checks, and action boundaries for one deck-pricing workflow in one folder, so Claude Code or Codex can use the same process again instead of rebuilding it from a chat prompt.

The deck builder runs offline for building and validation. Only its live-pricing step needs a CardTrader account and API access.

Public repo Reusable workflow

gera3d/mtg-cookbook

One SKILL.md, two deterministic scripts, two policy references, and two example inputs. This is the working folder behind every deck in the research log.

Core file
SKILL.md explains when and how the workflow runs.
Project paths
.claude/skills/ or .agents/skills/
Runs offline
build + validate — no account needed
Keep separate
credentials and checkout actions stay in the harness, not the Skill.

what's actually in the repo

github.com/gera3d/mtg-cookbook

A Skill is a small operating layer for one job: instructions, supporting knowledge, optional scripts, and clear boundaries for actions that need approval.

README.mdThe front door: what the Skill does, where each harness discovers it, and what a useful deck brief needs to specify.
recipes/build-a-budget-commander-deck.mdThe full process written out as a recipe: brief → role-based build → validation → live quote → gallery → purchase gate.
skills/magic-deck-api-builder/SKILL.mdThe required entrypoint: frontmatter tells the agent when to use the Skill, and the body tells it how to run the work.
↳ agents/openai.yamlOptional metadata for the Codex and ChatGPT experience. It is not a separate adapter or the Skill itself.
↳ scripts/validate_commander.pyOffline, deterministic, no network calls: parses a decklist and checks exact 100-card count, singleton rules, and commander count. Fails loudly with a JSON error, not a guess.
↳ scripts/render_gallery.pyTurns normalized deck JSON into the standalone hover-card gallery pages — the same generator behind every deck page linked from my decks.
↳ references/card-data-and-pricing.mdThe rule that keeps card-rules truth (Scryfall) and marketplace price/stock (a named adapter) as two separate sources — plus the exact JSON shape a normalized quote has to match.
↳ references/cart-and-purchase-gates.mdThe purchase boundary: what counts as safe research vs. a live state change, and the exact facts that must be re-confirmed immediately before any payment action.
↳ assets/*.exampleA minimal example decklist and normalized deck-data JSON — the portable schema both scripts expect, so you can see the input shape before writing your own.

put it in your own setup

One portable Skill folder. Two project locations.

The shared unit is a folder with SKILL.md and its supporting files. Claude Code discovers project Skills under .claude/skills/; Codex discovers them under .agents/skills/.

Claude Code

Project Skill

git clone https://github.com/gera3d/mtg-cookbook.git mkdir -p .claude/skills cp -R mtg-cookbook/skills/magic-deck-api-builder .claude/skills/

For a personal install, copy the same folder to ~/.claude/skills/. Invoke it with /magic-deck-api-builder, or let Claude load it when the description matches your request. Read the Claude Code Skills docs ↗

Codex

Project Skill

git clone https://github.com/gera3d/mtg-cookbook.git mkdir -p .agents/skills cp -R mtg-cookbook/skills/magic-deck-api-builder .agents/skills/

For a personal install, copy the same folder to ~/.agents/skills/. Codex can load the Skill when the task matches, or you can call $magic-deck-api-builder directly. Read the Codex Skills guide ↗

before you run it

You'll need a CardTrader account and an API key

The role-based build and validation script work fully offline. The live-pricing step is the one that talks to the outside world — to quote real inventory instead of guessing, your harness needs a CardTrader account and an API key.

step zero

What a good brief looks like

"Cheapest" alone isn't a spec — it can quietly mean non-English cards, poor condition, a different printing, or a total that excludes fees. A brief that actually constrains the build looks like this, straight from the skill's own README:

Build a budget Commander deck around this commander. I already own the commander and basic lands. Keep listings English only and in at least lightly played condition. Use CardTrader Zero if possible, cap the cards at $35 before checkout fees, and show me a gallery plus the exact checkout quote before touching a cart. — mtg-cookbook/README.md

what it actually does

Five steps, in order, every time

Nothing here is a black box — this is the literal sequence the skill follows for every deck on this site.

01

Build by role

Mana, card flow, interaction, primary plan, finishers — built role by role, win pattern explained before anything gets priced.

02

Validate

Runs validate_commander.py for an exact 100-card / singleton check. Legality verified separately against live card data.

03

Price live

Printing, language, condition, seller, price, timestamp. Subtotal, fees, shipping, and tax stay separate — never one "price."

04

Render gallery

render_gallery.py turns the data into a page: hover-card art, exact decklist, plain-language strength rating.

05

Stop at the gate

Building a list and a quote is safe prep. Touching a cart or paying needs a fresh, explicit confirmation — every time.

what a run looks like

A real brief, start to finish

This mirrors the actual run that produced Kratos, God of War's $14.99 batch — one of the nine batches purchased for real, tracked in my decks.

claude — magic-deck-api-builder
claude "build a budget deck around Kratos, God of War — I own the
  commander and basics, English only, at least lightly played,
  CardTrader Zero, cap at $20 before fees"
# role map
mana · card flow · interaction · primary plan · finishers
# deterministic check
validate_commander.py ....... 100/100 cards, singleton OK
# live pricing pass
pricing 63 cards vs. CardTrader Zero (English, ≥ lightly played)
article subtotal: $14.99 quoted 2026-08-04
fees / shipping / tax: not yet quoted — separate from subtotal
# gallery
written → kratos-god-of-war-ultra-budget-gallery.html
STOP — no cart created. confirm before checkout.

ground rules

What the skill won't quietly do

Rules ≠ pricesCard facts and legality come from live card data. Availability and cost come from live marketplace inventory. Never one source pretending to be both.
A scan isn't checkoutArticle subtotal, service fees, shipping, and tax are always reported as separate numbers, never folded into one "price."
Language and condition are hard filters"English only" means English only — never silently waived because inventory is thin.
No secrets in the skillAPI credentials, cookies, addresses, and payment details stay in your harness's own integrations, never in the skill files.
No automatic chargeYou see a fresh, exact final total and explicitly confirm before any payment — every time, not just the first time.

Inspect the example, then build your own

Every batch in the deck research came from this loop. Inspect the result, then use the folder pattern for the repeatable work in your own setup.