The xgenia-mcp Skill
The XGENIA MCP server is in early alpha. See Driving XGENIA from Claude Code for install and setup.
The MCP server gives an agent hands on the editor. The skill is what stops it using them badly.
It ships with the xgenia plugin, at plugins/xgenia/skills/xgenia-mcp/ in the XGENIA repo — see Install. Claude Code loads it when the work matches its description — "use XGENIA", "build a game in XGENIA", "build a slot", "send a prompt to the XGENIA chat", "screenshot the editor", "XGENIA is stuck" — or you can ask for it directly with /xgenia-mcp.
What it adds on top of the tool schemas:
- The call sequence — which tool answers a question, and in what order.
- The cost rule — check the model before any run longer than a couple of turns.
- How to prompt the panel's AI — outcomes, not mechanisms.
- How to get evidence — read and press the running game yourself.
- The traps below, each of which makes a working call look like it failed.
- How to tell whether a change to the panel actually reached the running editor.
Prompting the panel's AI: outcomes, not mechanisms
The panel's AI knows XGENIA's node library, ports and tools far better than a prompt written from outside does. Telling it how to build something — which node, which port — when you are not certain how XGENIA works produces a worse graph than telling it what you want to see.
- Describe the observable result. What appears on screen, what a press does, what the label shows after three presses. Leave node types, ports and wiring to it.
- Ask it to prove the result from the running game, not from the graph. "Press SPIN three times yourself and tell me what the balance showed after each press, read from the preview." It has tools to click and read the preview; make it use them.
- Then check its claim yourself with
xgenia_preview_readandxgenia_preview_click. A confident report and a first-hand read that agree is evidence; the report alone is not. - If you must name a mechanism, say why and mark the uncertainty — "I believe X, check it" — so the AI can push back with what it knows instead of following a wrong instruction.
| Instead of | Write |
|---|---|
| "Add a Variable node called Balance and connect Spin.Pressed to a Subtract node" | "Pressing SPIN takes the bet off the balance. Show me the balance after three spins, read from the game." |
| "Use a Tween on each reel's y position" | "Reels blur and speed up, then stop one after another left to right, with a slight bounce as each lands." |
One editor, many drivers
There is one XGENIA per machine. The dev ports are fixed, and another Claude Code session, a test harness, or a person can take the editor from you at any moment. Four run-killers, all silent from the driver's side:
| What happened | How it looks | Guard |
|---|---|---|
Another agent ran quit and launch for its own run | chat-frame-missing, then a different project open | Re-check xgenia_health.project before and during a run |
| Someone opened another side panel | The chat iframe is gone from the frame tree | Reopen the panel and resume |
| A source edit hot-reloaded the panel | The frame reloads mid-turn; the transcript survives, the turn does not | Never edit panel or editor source while a run is in flight |
A script closed its CDP connection with browser.close() | Project closed, lobby showing, nobody touched it | Never close a CDP connection to XGENIA — it exits the project. The harness's own connection never does |
A restart mid-run is recoverable: reopen the project and send "continue — the editor restarted mid-turn; pick up exactly where you left off". The transcript survives a reload, so the AI can resume from its own last message.
The art loop
When the panel builds a themed game, it generates key art first — one image of the whole screen — and cuts the backgrounds, symbols and buttons out of it.
- Declare the screen first. Key art takes the shape of the declared screen, and the key-art call refuses when nothing is declared.
- The approval card times out after 300 seconds. Unattended, key art auto-approves, and the whole build inherits it. The panel says so in its next message — watch for that line if the look matters to you.
User is locked. Reason: TOP_UP.is a fal.ai billing refusal, not a size or key problem. Large sizes sit in a pricier tier, so a smaller size may still draw. Tell the user to top up; do not let the AI rebuild its art plan around it.- A named slot only receives a piece whose name matches it. A slot the splitter cannot match stays empty rather than taking the next layer in line.
Traps that make a working call look broken
A send that "may not have been sent" usually was
xgenia_chat_send confirms by watching for the input to clear and the prompt to appear in the transcript. Both signals lie, in different directions:
- The input is
contenteditable, so an unsent prompt is in the frame's body text too. data-emptyhas been observedfalseon a send that had already landed and was being answered.
Current behaviour reads the input's own text separately, so a match in the body while the input no longer holds it proves the send. When it still comes back unconfirmed, the error code tells you which case you have — render-lag means read, don't resend; not-submitted means resend is safe. See the tool reference.
Prompts that name nodes
XGENIA prompts refer to things as @Paytable, @GameState, @SpinCalc. The panel opens a mention autocomplete on @.
Typing character by character let that autocomplete swallow the rest of the prompt into a mention chip and eat the Enter. Nothing was sent, twice, and only the contents of the input showed why. The harness now inserts the whole string as a single input event and presses Escape before Enter. On an older server build, avoid @ in prompts, or check the input after sending.
Screenshot coordinates
imageSize is the buffer; contentSize is the page. Convert through scale from the same response, and treat anything beyond contentSize as empty space rather than as editor UI that failed to render.
scale was wrong before 2026-09-06 — it reported 1.2503 where the truth was 1.0, because it measured the blank margin and called it zoom. On an older build, measure against a known element rather than trusting it.
busyForMs is a floor, not a duration
Measured from the server process's first sight of the busy state. A panel stuck for hours reads the same as one that just started.
Deploying while a turn is in flight kills the turn
Shipping the Chat panel or its backing function mid-generation produces Failed to fetch or AI Communication Error in the transcript. That is the deploy, not an XGENIA bug. Wait for idle before shipping, or expect to re-send.
Recovery
| Symptom | Call |
|---|---|
not-running | xgenia_launch |
connect-stalled | Retry. The editor page answered; only the harness's attach stalled. Do not force-restart on this alone |
chat-frame-missing with the panel open on screen | xgenia_probe. chatIframe found but chatFrame not found is the Windows blank-URL issue — see Windows notes |
A **Model Error** message in the transcript | Not a harness failure — the provider refused the turn. Read the text: see Running on free models. Do not resend on a rate limit; the panel already retried for two minutes |
editor-unresponsive — wedged renderer | xgenia_restart with force: true, which skips the connect and every in-page read and goes straight to the kill |
| Chat stuck generating forever | xgenia_restart, or xgenia_chat_send with force: true if the panel is otherwise fine |
not-authenticated | Stop and tell the user. A human signs in once, in the editor. There is no tool, flag or environment variable that types, stores or reads a password |
selector-missing | xgenia_probe — the Chat panel deploys independently of XGENIA releases, so selectors move |
After a restart, check recoveryError, declinedPorts, save.confirmed and hardKilled before assuming it was clean — a restart can succeed and still have lost something.
Verifying a change actually reached the editor
The Chat panel is served separately and iframed by the editor. Editing its source locally changes nothing you can observe until it has been built, deployed and reloaded. Three checks, in order:
- Deploy it, with whichever command re-points the production alias — not just a preview build.
- Confirm the bundle reached the edge. Fetch the deployed page and match the bundle hash against what the deploy expected. A mismatch immediately after a deploy is usually CDN lag; re-check in 30–60 seconds.
- Reload the panel.
xgenia_restart, then exercise the changed behaviour and read the result out of the transcript.
Skipping step 3 is how a "verified" fix turns out to have been tested against the old bundle. The panel also shows an opt-in "A new version of the AI panel is available — Reload" banner; it does not hard-reload mid-use.
It is a local process started when the session began. Rebuilding it does not affect the running session — the client has to be restarted to pick up a new build. If you have just fixed the harness, say so rather than claiming the fix is live.
Judgement while driving a build
- Watch, do not just wait. Poll
xgenia_chat_readduring long runs and stop a run that is going astray, rather than paying for it to finish. - Ask for evidence, not reasoning. The panel's AI will state a confident mechanism it has not checked. Ask it to run its own timeline and execution-status tools and report what actually executed. It retracts cleanly when shown runtime evidence — and a retraction under evidence is a sign the earlier claim was invented, not a reason to trust the next one more.
- A fix is not verified by arithmetic. If a tool reported a number before a change, do not accept a calculated number after it. Make the tool print the new figure.
- Screenshot when the text is ambiguous.
region: "chat"for the conversation and the model footer,canvasfor the graph,fullfor the whole window.
Read next
- Build a Game with Claude Code — all of this applied to one real build.
- MCP Tool Reference — all 19 tools and their arguments.
- Driving XGENIA from Claude Code — install, environment, and the cost rule.