
BoosterTutor
BoosterTutor is a coach for Magic: the Gathering Limited. You draft against a table of bots, or import a real draft from Arena, and it tells you which picks cost you and why. Not a score out of ten, but an actual explanation, the kind you’d get from someone sitting next to you. It’s live now, with accounts and everything, and I built all of it myself: the data pipeline, the API, the front end, the deployment and the prompts.
The whole thing rests on one rule I wrote into CONTEXT.md on day one. Python
computes every fact and every verdict, and the LLM only explains them. Ask a language
model to grade a pick and it will hand you a confident number it can’t back up. Hand
it the number and ask it to explain, and it’s genuinely useful. Almost every design
decision since has been some version of keeping that line clean.
The math
Card values come from the public datasets 17Lands publishes, which a scheduled GitHub Actions job loads into Postgres. Every card gets a fitness score, meaning what it’s worth to your specific pool at that moment, measured in percentage points of win rate. That gives everything one scale, so “that card was worth 2pp less to your deck” actually means something. The score includes a synergy term fed by a hand-built tag taxonomy for each set, and a guess at which of the ten two-color archetypes your pool is turning into.
Picks are graded on the gap to the best card in the pack instead of on rank, because
most picks are close and flagging all of them buries the three that mattered. If
nothing was at stake in a pack, the verdict is indifferent. For the deck builder,
each part of a deck (curve, synergy, removal, mana and so on) gets a letter grade
based on where it ranks against real 40-card decks, and the overall grade comes from
a regression of game wins on those same metrics, fitted per format. Mana gets checked
against Frank Karsten’s published tables, since that question already has an answer.
I tried to trust the numbers as little as possible. When I tried folding a “which colors are open” signal from wheeling packs into the score, a backtest over 43,650 drafts fit its weight to exactly zero, so I retired it as a score and let the wheel just report facts. The bots in Practice Draft are calibrated against about 1.5 million human picks, and I wrote down the places where they still don’t look like humans. There are around forty ADRs in the repo tracking how this all changed, including a full rewrite of the classification system once I realized one label was answering two different questions.
The Claude layer
Claude Haiku writes a note for any pick worth commenting on, and Claude Sonnet writes a longer summary of the whole draft. Both get a brief assembled from Python’s verdicts, so there’s nothing for them to make up. I designed that interface on paper before building any of it, and it’s the reason a draft with nothing worth noting comes back with no notes instead of filler.
Since every note costs real money, each call is logged with its cost, and a daily spending cap shuts things off before a bad day gets expensive. A Postgres-backed rate limiter covers the endpoints that spend money or write data. Users get a couple of Tomes a day to unlock Gnarl’s notes, and they stay free because Wizards’ Fan Content Policy doesn’t allow fan content behind a payment.
Keeping it honest
My first plan was to fetch a user’s draft from 17Lands when they pasted a link. They
asked me not to, which was a fair answer, so I deleted the feature and the cached
data it had collected. The replacement reads Arena’s Player.log in the browser. That
file also holds account IDs and auth tokens, so the browser extracts only card IDs
and pick numbers, shows you exactly what it’s about to send, and sends nothing else.
The parser is tested against scrubbed logs.
The architecture
- Backend. FastAPI and SQLAlchemy on Postgres, with Alembic migrations,
uvfor packaging, and strict mypy, ruff and pytest on every change. - Front end. SvelteKit, TypeScript and Tailwind, tested with Vitest in a real browser through Playwright.
- Accounts. Sign-in with email or Google, saved Studies, and per-user limits.
- Deployment. API on Render, web on Vercel, CI on GitHub Actions, with health endpoints and a Postgres-backed rate limiter.
- Snapshots. Practice drafts are pinned to a frozen copy of the format’s stats, so a data update never changes a verdict after the fact. Grading a pick takes about 25 milliseconds of CPU, which I confirmed with a load test on the live server.
- Decision records. Around forty ADRs track how the scoring and architecture changed over time.
I’ve been writing about it as I go. Start with Before the Words, then Gets a Wizard, After the Email and Clearing the Log Jam.