Use case P30 · Human
Returning card-game player uses Claude and GitHub Copilot to build Magic decks from the cards he has
- Games and game nights
- Advanced
- ChatGPT, GitHub Copilot, Claude 4 Sonnet, IPython, CubeCobra
- Source checked · blog post
The short version
What they did
Peter van Onselen wanted to return to Magic: The Gathering by making themed decks from a limited collection of common cards. Asking ChatGPT directly kept producing repeated cards and cards he did not have. He moved to Python code made with Claude 4 Sonnet through GitHub Copilot, then rebuilt the sprawling notebook into smaller parts with validation. The eventual program generated decks that he judged plausible and within his collection’s constraints; this does not establish competitive balance or a completed playtest.
Result (as claimed)
“Slowly, things started to click. I had a system that could take a list of cards and — hands-free — generate a Jumpstart cube that actually worked.”
“The decks looked reasonable (at least to my untrained eye), and they respected the constraints of working within a limited cube.”
Prompt
Their prompt:
His published revised chat prompt, quoted exactly. This prompt alone still failed; the result above came only after the code-and-validation workflow.
Hi, you are a deck designer working on building game decks in Magic: The Gathering focusing on Jumpstart decks. You need to build a set of decks from a Pauper cube (see list of cards available in attached file).
Your goal is to create 20 mono-color decks (4 of each type) and 10 dual-color decks. Each deck should follow the rules of Jumpstart deck construction.
Let’s start with creating themes for each of these decks and assigning some cards to match those themes. Key constraint is that we cannot assign a card more than once from the Pauper cube list as they are uniques.
CONSTRAINTS:
- You may only use a card once across all 30 decks
- You may only use cards that are in the list of cards provided
- You must ensure that the decks you construct are valid; cards in each deck should be usable with mana from that deck
- You must ensure the chosen cards match the themes you have defined
A fuller version to copy:
I’m returning to Magic: The Gathering and want themed Jumpstart decks built only from my limited collection. My card file is [attach CSV with card names, colors, types and quantities], and my deck-building rules are [paste rules]. My target is [number and color mix of decks].
1. Suggest themes based on the file and wait for my choices.
2. Help write a small Python program that assigns cards to those themes. Keep the parts small enough to check separately.
3. Add checks that every assigned card exists in my collection, quantities aren’t exceeded, deck sizes meet my rules and mana colors fit.Give me the deck lists and a short validation report. Don’t replace missing cards with invented ones or assume a valid list is balanced. Explain failed checks in plain words so I can fix them before playtesting.
Do it yourself
These steps are my suggested way in, not Peter’s setup.
Level: Advanced for a program that builds every deck. The first version below is Intermediate.
What you need
- Your card list in a spreadsheet or CSV: one row per card, with colors and type.
- A chat assistant, and a coding assistant for the full version: GitHub Copilot, Claude Code or Cursor.
- Python, which is free.
Start simple
- Export or type your collection into a CSV.
- Ask the chat assistant for deck themes only, based on your list. Pick the ones you like.
- Ask for one deck at a time, using only cards from the file.
- Ask for a short Python script that checks every deck: each card is in the list, each card is used once, and colors match.
- Run the script on each deck and fix what it flags.
Take it further
- Ask the coding assistant to have the program pick cards for every deck, with the checks built in.
- Split the code into small parts with tests, as Peter did, so changes don’t break it.
- Upload the result to a cube site such as CubeCobra to share it.
Check your work
- Trust the script, not the chat, for “is this card in my collection” and “is it used once.”
- Shuffle up two decks and play them against each other before you build the rest.
- Count each deck by hand once to confirm the script.
Source checked. The link, author, date and quote were confirmed against the source. The result itself has not been reproduced. Their prompt is quoted from the source; any fuller version is written for this library. Business size: Individual. Results are quoted as the source claimed them and never improved. Spot an error or a broken link? Email charlie@cbarmorecpa.com.