# Drawstep engine wiki — Building cards in the Studio > The Card Studio workflow — rules text to blocks to Explain, Playtest and Save — several cards and double-faced cards, frames and art, and the assistant that asks before it guesses. Engine: Magic: The Gathering (`mtg`). Page: https://drawstep.xyz/wiki/mtg/studio · Raw Markdown: https://drawstep.xyz/wiki/mtg/studio.md · Complete AI pack (every topic in one document, with the output contract and worked examples): https://drawstep.xyz/wiki/drawstep-mtg-ai-pack.md. This page is generated from Drawstep's card schema; field names and discriminators are exact. A card definition is one JSON object; anything the vocabulary cannot express goes verbatim into `unparsed` instead of being approximated. ## Building cards in the Card Studio In **Card Studio**, a custom Magic card can cast spells, put triggers on the stack, change other permanents or replace events under the same engine as a printed card. The artwork and printed wording describe the design to players. The abilities you build in Flow tell the table how to play it. Start with the [worked custom-card example](https://drawstep.xyz/wiki/guides/card-studio), or use this reference for details on the editor. **The workflow.** 1. **Characteristics** — name, mana cost, type line, P/T or loyalty, colours — in the card header; the preview on the left redraws as you type. 2. **Rules text** — paste the printed text; each line becomes a to-do chip. Lines you translate disappear from the chips; lines you leave are saved verbatim in `unparsed` and the card is flagged *partially enforced* rather than guessed at. 3. **Flow** — the card's abilities as a pipeline of blocks. Pick a block to edit its fields in the right column; **+** inserts an effect, a trigger, a condition … and **Ctrl+K** searches the whole vocabulary by the printed phrase ("return target creature", "whenever a creature dies"). Give a printed ability word to the ability's **Name** field so the stack and the log can use it. 4. **Explain** — read the whole card back as English, line by line against the printed text. **Advanced** (Form) shows every top-level field generated from the schema; **JSON** shows the raw definition. 5. **Playtest** opens setup in a new tab with your draft in hand and lands ready to use. Set the targets, mana and library order, then choose **Play position**. Pilot either seat or give it to a bot. Add a checkpoint after the card resolves and save the test to repeat it. To try a revision, choose **Edit in Card Studio**. The lab detects draft edits before publication. Choose **Apply Studio changes** to inspect the revision, or **Apply draft and play** to start testing it. From a running test, choose **Return to setup** first. Use **Apply changes and start a new recording** to test the revision from your configured position. **Close playtest** leaves saved copies in **My playtests**. During play, open **Log > Rule log** to see why a decision happened. Follow a rule number into the [Magic rules wiki](https://drawstep.xyz/wiki/mtg/rules) or expand a named card's [published rulings](https://drawstep.xyz/wiki/mtg/rulings). 6. **Save to library** — a valid card is saved to your account (versions are kept); from there it goes into decks and onto the table. **Import** accepts a definition (an assistant's output, an export); **Export** gives you the JSON or the rendered image. **Several cards at once.** Tabs along the top hold any number of open cards — a commander and its partner, the faces of a cycle. Double-faced and multi-face cards are **one** card: the front's characteristics live at the root and `faces[]` names each face with its own abilities (`layout`: transform, modal_dfc, adventure, split …). A partner pair or a commander and its companion are *two* cards in two tabs. **Frames and art.** The **Frame** panel picks the style, treatment and variant (see *How a card is drawn*); **Frame library** lists the built-in styles, the community packs this server ships and the packs you import. The art editor crops your picture to the frame's window. **The assistant.** The ✦ **Assistant** button opens a chat that knows the engine: it reads the open draft, the wiki topics and the stock library, and every card it hands you comes through `propose_card` — validated with the gate, shown with **Apply** / **Undo**, never pasted as raw JSON. Its north star is **full enforcement**: every printed line expressed with engine primitives looked up in the wiki and the AI pack, and a one-line compliance report after each proposal. It can read a card photo, translate the untranslated lines, design a card with you, explain the draft, change the frame (`set_frame`), generate art that fits the art window, open and save cards, and work on several tabs. **It asks only what the card's logic needs**: when something the engine must know is genuinely open — the scope or timing of a mechanic, whether it is optional, who chooses, the colours and cost of a card designed from an idea — it asks one focused question with one-click answers and waits; it never quizzes you about looks or art on its own, and "you decide" makes it decide and say what it chose. It never approximates a clause the vocabulary lacks: it climbs the honesty ladder (a `tableRuling` step, an on-demand format ruling, `unparsed`) and tells you which rung it used. **Whose model.** Under ⚙ the assistant uses **your own key** (OpenAI, Anthropic, any OpenAI-compatible endpoint, a local Ollama / LM Studio — the key stays in this browser), the **server's house provider** when the administrator configured one, or **a key a friend shared with you**. Friends share a key from the same settings: the key is sealed on the server and never shown; the friend's requests go through the server, which injects it, pins the model, enforces a daily token budget and what the key may be used for (the Studio today; playing against the AI later). Unfriending ends access. Prefer an external chat window? See *Working with an outside AI*: the **AI prompt** button gives a short prompt that points ChatGPT / Claude / Perplexity at this wiki (or the whole AI pack for an assistant that cannot browse), and **Import** takes the answer, checks it with the engine and writes the feedback to paste back. **Conversations stay with their cards.** Every chat belongs to the tab it was started on and is kept in this browser from its first message, so a reload, a trip to another page or signing out never loses it; coming back to that tab brings the conversation back where it was. A chat is tagged with every card it touched — the one it started on, a card the assistant switched to (`open_card`) or proposed as a new tab — and switching between those tabs keeps the same conversation. When a card is saved, its chats follow it to the saved card and, signed in, are mirrored to your account under that card, so reopening a custom card on another device offers the conversation that made it. **New chat** starts a fresh one (the old stays listed); **Chats** lists this card's conversations and the rest, to continue or delete. Long conversations are trimmed for the model, not for you: old tool results are shortened and the oldest turns dropped from what is sent, while the card open in the Studio is always current. Images are kept as thumbnails in saved chats; ask for the art again if you want to use one from an old conversation. **Checking enforcement.** Untranslated lines are saved in `unparsed` and give a card the *partially enforced* badge. A `tableRuling` step can pause the game for the table to carry out a clause. An `onDemand` ruling can be opened during play. For a fully automated design, compare Explain with the printed text and test both an event that should trigger the ability and one that should pass without triggering it.