# Drawstep engine wiki — Working with an outside AI > Have ChatGPT, Claude, Gemini or any chat write a card from this wiki: the start page and per-primitive pages it reads, the Studio's Import that checks the answer with the engine, and the feedback to paste back. Engine: Magic: The Gathering (`mtg`). Page: https://drawstep.xyz/wiki/mtg/ai-workflow · Raw Markdown: https://drawstep.xyz/wiki/mtg/ai-workflow.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. ## Working with an outside AI You do not need an API key to have an AI write a card: any chat you already use — ChatGPT, Claude, Gemini, Perplexity, Copilot — can read this wiki and answer with card JSON the engine checks. This page is the exact workflow, for you and for the assistant. **1. Hand the assistant the reference — two ways.** Every document is plain Markdown, public (no account, no JavaScript, served as `text/plain` so every fetcher can read it), and generated from the card schema, so it is never stale. - **It can open links.** The **AI prompt** button in the Studio, and the box on the wiki's landing page, copy a prompt that **writes out the address of every reference document**: the core of the pack (`https://drawstep.xyz/wiki/mtg/pack/core.md` — role and rules, the output contract, the self-check, card anatomy, how the engine reads a card, the ability kinds, every vocabulary name), each of the other parts (each under 100 KB, together every field of every name), the JSON Schema, and — in the Studio — the pages of the primitives your card's text most likely uses. Writing the addresses out matters: ChatGPT's browser opens a URL by itself only when it is in your message or already in OpenAI's search index, so a link it finds inside one of these pages can be refused however public the page is, while an address in your message always opens. **Open in ChatGPT / Claude / Perplexity** opens a new chat with the prompt typed in; attach the card's image or paste its text and send. - **Upload the reference.** The same box downloads the whole reference as one Markdown file (`https://drawstep.xyz/llms-full.txt`, saved as `drawstep-mtg-reference.md`) and the card format as JSON Schema (`https://drawstep.xyz/card.schema.json`), with a prompt to send with them attached. Nothing is fetched, so nothing can fail to open — the most reliable way, and the one for a chat that cannot browse. (The Studio's **Download .md** is a third: the instructions, your draft and the whole reference in one file.) What the assistant reads, in order: the core part; the part of each topic the card touches (or the page of each primitive, `https://drawstep.xyz/wiki/mtg//.md` — every field, the minimal form, stock examples; `https://drawstep.xyz/wiki/mtg//index.md` lists a topic's primitives with one line each); **Relationships & references** (`https://drawstep.xyz/wiki/mtg/pack/references.md`) for how one part of a card refers to another ("it", "that creature", "that player", "the exiled card", "the chosen color", "that much"); the **Cookbook** (`https://drawstep.xyz/wiki/mtg/pack/cookbook.md`) for complete validated cards of the hard patterns; **Custom mechanics** only when a clause seems to have no primitive. `https://drawstep.xyz/llms.txt` is the map of every document for assistants that follow links freely, and `https://drawstep.xyz/wiki/mtg/start.md` a shorter start than the core. **2. The format, mechanically.** `https://drawstep.xyz/card.schema.json` is the card format as JSON Schema (draft-07), generated at build time from the same zod schema the engine validates with. An assistant that can run code can check its answer against it before replying; the schema cannot express every rule (the engine's gate adds structural checks and the English read-back), so the Studio's Import is the final word. **3. Validate in the Studio.** Paste the whole reply into **Card Studio → Import** — prose, ```json fences and all; several cards in one reply (a transform pair, a token and its creator) each open in their own tab. For every card the dialog shows the **gate's verdict** (valid, or each error by JSON path with the valid values: `abilities.1.effects.0: Unknown \`effect\` "zap" — did you mean …`), the **engine's read-back** (every ability rendered back into English and held against the printed text, with each difference that makes it a *different card*: a number, a qualifier, who acts, who is affected, when it triggers), and the printed lines no ability implements. The Studio's **JSON** view (next to Flow and Advanced form) checks a card you edit by hand as you type — where the JSON breaks, then the same gate. **4. Send the feedback back.** **Copy feedback for the AI** writes the message for the chat — the issues by path, the lines the engine reads differently with the field each difference points at, the printed lines left unimplemented, the engine's complete reading, and the instruction to return the complete corrected JSON. Repeat until the card reads as written; two or three rounds is normal for an unusual card. **5. Gaps, stated honestly.** When a clause has no primitive, the assistant must say so — never invent a name, widen a filter or approximate. The order to try: search the vocabulary index and the topic indexes; compose the selection axes (`https://drawstep.xyz/wiki/mtg/targets.md`) and the references (`https://drawstep.xyz/wiki/mtg/references.md`); check the cookbook and custom mechanics. Only then climb the honesty ladder: a `{ "effect": "tableRuling", "text": "" }` step where the clause's timing is clear (the engine runs the rest and pauses for the table at exactly that point), an on-demand format ruling for a deck-construction sentence, or the line verbatim in `unparsed` (the card is then shown as *partially enforced*). The answer should name the clause it could not express and why, in one sentence. If the assistant could not fetch a page, it should say which URL failed rather than conclude that a primitive does not exist. **6. Load, look, play.** Load the card (valid or not — issues stay visible in the Studio), check **Explain** and the flow, set the frame and the art (an outside assistant cannot touch looks — `appearance`, art and per-face images are yours in the Studio), **Playtest** it, save it. **If an assistant says it cannot open the pages.** The documents need nothing but an HTTP GET, and they answer every AI assistant's fetcher. A page that "fails to open" is the assistant's own link rule (above): paste the exact address it names into the chat — an address in your message opens — or switch to uploading the reference. Every wiki page URL also answers with its Markdown when fetched by a known AI assistant or `curl`; a browser gets the page already rendered into the HTML, with `` pointing to the Markdown. A server operator must set `PUBLIC_URL` to the address the site is reached at — the links inside the documents, `/sitemap.xml` and `/robots.txt` are written with it, and a search index (OpenAI's included) only learns the pages from a sitemap on the right host — and, behind a CDN that blocks AI crawlers or challenges bots, allow `https://drawstep.xyz/wiki/*`, `https://drawstep.xyz/llms.txt`, `https://drawstep.xyz/llms-full.txt` and `https://drawstep.xyz/card.schema.json` for them (deploy README). **Which model.** Any current frontier model does well from the core pack — the pages are small and exact. Smaller or older models manage simple cards (keywords, one trigger, a vanilla spell) and struggle with double-faced cards, tokens that carry their own abilities and unusual triggers; the feedback loop still gets them there, with more rounds. **What is public.** `https://drawstep.xyz/llms.txt`, `https://drawstep.xyz/llms-full.txt`, `https://drawstep.xyz/card.schema.json`, `https://drawstep.xyz/wiki/index.md`, `https://drawstep.xyz/wiki/mtg/start.md`, `https://drawstep.xyz/wiki/mtg/pack.md` and `https://drawstep.xyz/wiki/mtg/pack/.md`, `https://drawstep.xyz/wiki/mtg/.md`, `https://drawstep.xyz/wiki/mtg//index.md`, `https://drawstep.xyz/wiki/mtg//.md`, `https://drawstep.xyz/wiki/drawstep--ai-pack.md`, `/robots.txt` (which names and allows every AI assistant), `/sitemap.xml` and every wiki page — also on a members-only server (`REQUIRE_ACCOUNT`).