Builds polished, fully playable 3D game prototypes in three.js, Roblox, Unity, or Unreal Engine, with high-quality (.glb/.fbx) meshes from the Thrixel API, and (for three.js and Unity) publishes finished games to a public thrixel.world link that anyone can play in a browser. Use when the user wants to make a game, build a playable prototype, or generate 3D assets, and also when they want to publish or host a game folder they already have, share a playable link, or list, rename, update, unpubl...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Build World?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/thrixel-build-world)
---
name: build-world
description: Builds polished, fully playable 3D game prototypes in three.js, Roblox, Unity, or Unreal Engine, with high-quality (.glb/.fbx) meshes from the Thrixel API, and (for three.js and Unity) publishes finished games to a public thrixel.world link that anyone can play in a browser. Use when the user wants to make a game, build a playable prototype, or generate 3D assets, and also when they want to publish or host a game folder they already have, share a playable link, or list, rename, update, unpublish or find the link for a game they published earlier.
---
# Budget and publishing decisions
Give the user a clear choice about the game's assets before spending cubes, then keep
building. Recommendations should name the visual improvements more cubes would enable.
Use the actual balance and asset plan, not the account's free or paid label.
| checkpoint | when to raise it | what to do |
|---|---|---|
| Before generation | The planned assets and reasonable iteration headroom exceed the available cubes | **HARD STOP 1:** explain the shortfall and recommend a top-up or suitable paid plan alongside building with the current balance. Wait for their choice, not for payment. |
| During the build | Any balance, including zero | Continue gameplay, integration, testing, and polish. Do not interrupt with payment questions or checkout links. |
| At the completed-build handoff | Specific planned assets or refinements remain limited by cubes | Offer one concrete asset-improvement pass, with purchase options that fit the user's preferences and a no-purchase option. Deliver the game regardless of the answer. |
| A later follow-up | The user requests new assets or a substantial visual improvement that the current balance cannot cover | Reassess that request before starting its generation work. Do not repeat the same offer for bug fixes or unchanged scope. |
An initial choice to build with the current balance permits one offer at the completed-build
handoff, when the missing art can be assessed in context. An explicit "no spending", spending
ceiling, or request to stop payment suggestions takes precedence at every checkpoint. After a
handoff offer is declined, do not repeat it for the same unfinished assets unless the user
reopens the budget or asks to improve those assets. A new session alone is not a new reason
to ask. Before budgeting, restore the project's saved decisions using
[Remember budget decisions across sessions](#remember-budget-decisions-across-sessions).
If the balance covers the work, skip the payment question on every plan, free included.
Never imply that a subscription alone changes the quality of an identical generation call:
more cubes fund additional Thrixel assets and refinement, and plan benefits depend on the
current catalogue. Do not promise that a purchase guarantees a finished or better-looking game.
**HARD STOP 2** remains the publishing choice at the first playable build. Keep payment
optional and separate from publishing: purchasing cubes is never a condition for handing
over, running, or publishing the game the user already has.
# Before anything else - update this skill
You are reading a copy that was installed at some point in the past, and it does not update
itself. The Thrixel MCP server does: its config pins `thrixel-mcp@latest`, so it re-resolves
every session. A stale copy of this file will eventually tell you to call the server in a way it
no longer supports.
Do this at the START of every session, before you read further. It is one command.
**1. Is this a plugin install?** If any segment of this file's path is `plugins` - for example
`.claude/plugins/cache/...` or `.codex/plugins/cache/...` - stop here and do not run git at all.
A plugin snapshot belongs to the plugin system, and some of them ARE git clones, so the check
below would happily pull into one and leave the installed copy disagreeing with what the plugin
system believes it installed.
For a plugin install, check staleness without touching git. If one segment of the path is a
12-character hex string, that is the commit this copy was built from; compare it against the
tip of `main`:
```sh
curl -sL --max-time 5 https://api.github.com/repos/thrixel/build-world/commits/main
```
The returned `sha` starts with that hex segment -> this copy IS current. Continue, and do not
describe it as possibly out of date. Anything else -> tell the user once that a newer version is
available and how to get it (Claude Code: `/plugin update thrixel@thrixel`; Codex:
`codex plugin marketplace upgrade thrixel`), then continue with the copy you have. No hex
segment in the path, or curl fails -> continue silently; do not retry, do not mention it.
Either way, **skip steps 3 and 4**.
**2. Otherwise, confirm this file sits where its own repository puts it, and not inside the
user's repo.** Skills are often installed under a project's `.claude/skills/`, and that project
is usually a git repo of its own. Git searches upward, so pulling without this check can pull
the USER'S OWN repository. Never skip it.
```sh
git -C <the directory this file is in> rev-parse --show-prefix
```
- Output is exactly `skills/build-world/` (or `skills/goal-to-game/` in an older clone) -> this
is its own clone, safe, go to step 3.
- Any other path -> git walked up into the user's project. **Stop. Do not pull anything.**
Continue with the copy you have.
- `not a git repository` -> this copy was downloaded rather than cloned, so it cannot update.
Say so once ("my copy of the Thrixel skill cannot self-update, so it may be out of date"),
then continue. Skip steps 3 and 4: there is nothing to pull and no remote to read.
**3. Pull.**
```sh
git -C <the same directory> pull --ff-only
```
- `Already up to date.` -> continue.
- Files changed -> **re-read this file, and any other file from this skill you have already
read.** You are holding the old text in context and it is now wrong. This is the whole point
of the step; skipping it wastes the update.
- Anything else (local edits, diverged history, no network) -> do not fight it. Say what
happened in one line and continue with the copy you have.
This step must never block the build. One command, read the result, move on.
**4. If the remote still names the old repository, retarget it once.** Only when step 3 actually
ran and succeeded:
```sh
git -C <the same directory> remote get-url origin
```
Contains `goal-to-game` -> this clone was made from the repository's name before it was renamed.
GitHub still redirects that name, which is why everything above worked and why nothing here is
broken. But the old name stays baked into the folder and into every `git remote -v` the user
runs, so point it at the current URL once and say a single line about it:
```sh
git -C <the same directory> remote set-url origin https://github.com/thrixel/build-world
```
Anything else -> silent. No output, no comment, no second look.
This is cosmetic. It must never block the build, and it must never feed back into step 2.
The check is on the path inside the repository, not on the repository's name or remote. Matching a
name looks equivalent and is not: a copy whose origin does not match would read its own remote,
fail, and conclude it had walked into the user's project - so it would stop updating itself
silently, and be sure it was right to. Asking git where this file sits relative to the repo root
answers the question actually being asked, survives the folder being renamed, and gives the same
answer whether the clone is at `~/.claude/skills/thrixel` or anywhere else. Step 4 reads the remote,
but only to relabel it, and only after step 3 has already decided this copy was safe to pull.
# Returning to a game
Read the game's `.thrixel/preferences.md` before making budget recommendations, even if
it has never been published. Follow [Remember budget decisions across sessions](#remember-budget-decisions-across-sessions).
**An update to a published game keeps its existing `game_id` and URL, including in
a new agent session.** A new title, version number, folder, or build does not make
it a new publication. Before working on an existing game, read
[Publication identity](#publication-identity) and recover its saved
identity. This is also required before every publish, including a folder you did
not build. A missing local record does not mean the game has never been published.
# What is being asked for - route before you read further
This skill covers three jobs, and only one of them is a build. Decide which one
you are on now, because the wrong route wastes a lot of the user's time: an agent
asked to publish a folder that starts planning an asset list and calling
`thrixel_account_status` looks like it did not read the request.
**1. Build a game** ("make me a game", "build a X prototype"). The default, and
the rest of this file. Continue below.
> The gates from the top of this file apply to route 1, and only to route 1.
> Routes 2 and 3 generate no new assets and spend no cubes, so none of them fires there.
**2. Publish a game that already exists** ("publish the game in ~/mygame", "put
this online", "I have a game folder, can you host it"). **Skip everything between
here and "Publishing to thrixel.world"** - the settings check, the asset list, the
plan offer, the engine choice, every generation step. None of it applies: no
assets are being generated, so nothing is being spent, so there is nothing to ask
about. Go straight to **Publishing to thrixel.world**, and specifically to
"Publishing a game you did not just build".
**3. Manage what is already published** ("what have I published?", "what was the
link for my racing game?", "take the golf one down", "rename it", "hide it from
the directory"). One or two tool calls and an answer. Go straight to **Managing
published games**. Do not read the rest of this file.
**4. Run it, or record it** ("run my game", "let me play it", "make a preview video
for it"). Running: serve the assembled bundle with `tools/serve.mjs` and hand over
the address, exactly as HARD STOP 2 describes, without the publish question if the
game is already published. A preview: go to **Record the preview** and hand over the
file and its frames; that is the whole job. Publishing is a separate decision, and
the clip only reaches the card if they choose to republish (same `game_id`) - say so
in one line and do not do it unasked. A published game can be recorded from its
address too (`record.mjs https://<slug>.thrixel.world`), no folder needed. Neither
job touches anything else in this file.
Jobs 2 to 4 need no Thrixel plan, no cubes and no account balance - publishing is
free. The only requirement is a signed-in account, which the MCP server handles;
if it is not signed in, the tool says so.
# Check your own settings first
**Every question you ask costs the user something, so ask as few as possible.** Across the whole
setup you may ask about sign-in, an unresolved asset-budget choice, and decisions about the
game itself. Everything else you work out yourself or stay quiet
about. A setup that interrogates the user is the failure mode here, not a thorough one.
That applies to this check. If you can see that you are on a weak model or low reasoning effort,
say so once, because it changes the result more than anything else on this page:
"
One thing before we start: I'm on <model> at <effort> effort. Building a whole game in one pass is
a long-horizon planning job, and on a lower setting I lay out noticeably flatter, more generic
scenes. If your plan allows it, switch to the most capable model at the highest reasoning effort
(in Claude Code that is /model), then tell me to continue.
"
**If you cannot determine your own settings, say nothing and continue.** Do not announce that you
could not check, and do not ask the user to go and look. It is a question they usually cannot
answer better than you, it delays the build, and it makes setup feel like a form. If you can see
your model but not your effort level, that is not worth a message either.
# First time setup - go through setup and installation flow.
IMPORTANT! MUST DO! If you are reading this, and the user has just asked you to install the skill into the project, then read [SetupAndInstallationFlow.md](SetupAndInstallationFlow.md) and you MUST follow the instructions there. Do this before anything else.
(This is about INSTALLING the skill. A user who asked you to publish an existing folder, or
asked what they have published, has not asked for an install - do not run the setup flow at
them, and do not install a game engine to publish a folder that is already built.)
# Overview
Use Thrixel for 3D assets. Use the target engine to orchestrate game logic, UI, effects, and sounds.
The game MUST be polished and visually stunning. The game should do everything thats
done in a AAA game, anything from high quality models and environment polish, to physics, including:
- UI (HUD, health bars, etc.)
- A mix of Architect and Architect -> Detailer meshes from Thrixel
- Visually stunning environments (atmosphere, terrain if relevant, set and background dressing, shaders)
- Rigorously playtested gameplay with intuitive keyboard controls
- **Playable on a phone**, with touch controls and a HUD that fits a small screen
- Optimized framerate of at least 30 FPS
## Mobile is a requirement, not a port
**Build every game to be playable on a phone from the start.** The finished game
becomes a public link (see Publishing, below), the user sends that link to
someone, and that someone opens it on a phone. A game that needs WASD is dead on
arrival for most of the people who will ever see it.
This is a design constraint before it is a technical one, so decide it while you
are deciding the controls, not afterwards:
- Every action needs a touch equivalent. A scheme built on a modifier key, a
scroll wheel, or four simultaneous keys cannot be retrofitted onto two thumbs.
- On-screen controls have to be visible. Touch input with no visible controls is
the most common mobile failure and it does not read as a bug to the player:
they see a 3D scene, tap once, and leave.
- HUD text and buttons have to work at 390 px wide, with 44 px as the floor for
anything pressable.
- A phone reports `devicePixelRatio` 3, so an uncapped renderer asks a phone GPU
for several times the pixels of a laptop. Cap it.
The three.js kit does most of this for you: `lib/input.js` feeds touch into the
same input snapshot the keyboard feeds (so gameplay code needs no touch branch),
`lib/touchui.js` draws the on-screen controls, and `tools/mobilecheck.mjs` is the
gate - it emulates a phone with no keyboard and asserts a thumb can actually move
the player. Read the Mobile section of
[engines/threejs/threejs.md](engines/threejs/threejs.md). For Unity, the
equivalent notes are in [engines/unity.md](engines/unity.md) under Publishing.
**Verify it, do not assume it.** `node tools/mobilecheck.mjs` before you call a
game done, and look at the screenshot it writes - a HUD designed on a big monitor
fails in ways no assertion catches.
**And never report a property you did not measure.** "Works perfectly on desktop
and mobile, 60 FPS" is a claim, and a game that throws a ReferenceError on its
first frame produces exactly the same terminal output as one that works. Run
`tools/playcheck.mjs` (see Publishing) and say what it returned. If you could not
run it, say the game is unverified - that is a useful sentence, and a confident
wrong one is not.
Pay special attention to mesh quality, realism, character quality, and UI to ensure it looks AAA.
Work alone, do NOT launch subagents to do work - subagents will interfere with each other and make
everything more difficult. However, frequently launch subagents as harsh critic agents to inspect
your work. If the subagent determines the game doesn't look absolutely AAA, you must continue the
build until the subagent decides the game looks good enough.
## Player Guidance and UI Design
Teach and guide the player primarily through the **game itself**, not through HUD explanations.
The first question should not be “what UI should explain this?” but **“how can the game design communicate this?”** Use level layout, encounters, environmental cues, animation, sound, object behavior, NPC dialogue, diegetic signs/displays, pacing, and player experimentation to convey mechanics and objectives whenever practical.
A mechanic can be introduced by creating a safe situation where the player naturally discovers it. A required action can be taught by designing an obstacle that makes that action necessary. A control can appear on a sign, device, NPC prompt, or other element that belongs in the world. Sightlines, lighting, landmarks, contrast, recurring colors/materials, and spatial composition can guide attention without explicitly telling the player where to go.
The player does **not** need to understand everything immediately. It is often better to let them experiment, notice patterns, and build an understanding through play. Introduce complexity progressively and make cause and effect clear enough that the player can learn from what happens.
### Use Non-Diegetic UI Sparingly
HUD space and player attention are scarce. Treat **all onscreen text—persistent or temporary—as something that must justify interrupting the game**.
Persistent UI should primarily show information the player genuinely needs during play, such as health, resources, time, score, or other important state. Temporary text should not become a substitute for good teaching or level design.
Generally avoid:
- persistent chapter, area, or scene titles that are not useful during play;
- prose explaining mechanics or controls;
- repeated reminders of basic actions;
- text that merely narrates what just happened;
- decorative or poetic flavor popups attached to ordinary interactions or collectibles;
- labels that restate information the world already communicates.
For example, collecting an important item can usually be communicated through animation, sound, effects, and a visible state change rather than a flavor text popup on the screen. Likewise, a mechanic such as rolling or dashing should preferably be taught through play rather than a popup explaining how the player can roll.
If explicit instruction is genuinely needed, keep it **brief, contextual, and integrated into the experience**. Showing `Shift - Roll` beside the first obstacle that requires rolling is very different from repeatedly explaining the mechanic in the HUD.
### Design Hierarchy
When deciding how to communicate something to the player, prefer roughly this order:
1. **Game and level design** — let the player learn by doing.
2. **Environmental/diegetic communication** — world design, NPCs, signs, objects, animation, audio, and feedback.
3. **Minimal contextual UI** — only when the first two approaches would be unclear or impractical.
4. **Persistent explanatory UI** — use only when the game genuinely requires it.
Do not add text simply to make the game completely self-explanatory. Some uncertainty, experimentation, and discovery are part of good gameplay.
The UI that does exist should also feel like part of the game's **visual identity**. Typography, shapes, iconography, spacing, motion, and materials should fit the game's art direction and tone rather than feeling like a generic overlay.
These are principles, not rigid rules. Different games communicate differently. The goal is to make the **game itself do as much of the teaching and guiding as possible**, with UI supporting the experience rather than explaining it.
# Plan the asset list - REQUIRED first step when BUILDING a game
**"Required" means required on the build path.** If the user asked you to publish a folder
they already have, or asked about games they published earlier, none of this section applies -
no assets are being generated, so there is nothing to plan or to spend. Go to Publishing or to
Managing published games.
Otherwise, once the user has asked for a game, do this FIRST. It applies to every game, whether
or not you walked them through [SetupAndInstallationFlow.md](SetupAndInstallationFlow.md) this
session: most games are built by someone who installed the skill weeks ago and never sees that
file again.
**Plan the assets the game needs, then compare that plan with the balance.** Rank
player-visible assets by their contribution to the intended art direction. Distinguish
required assets from optional decoration and identify sensible reuse. Do not inflate the
list to justify a purchase, or silently replace its important assets with procedural stand-ins
to make a budget appear sufficient. If the user chooses a smaller scope, keep that choice.
**Reuse what the account already has.** `thrixel_list_assets` lists finished models from every
project, not just this game's; reusing one costs nothing. Check it before generating, and reuse
every model that fits, most of all when the balance is low. Copy a model from another project
into this game's project with `thrixel_copy_asset` (free) and use the copy's `submission_id`, so
each game's models stay in one project. A game needs **at least three
distinct Thrixel models** to publish to thrixel.world, and models loaded from other sites do
not count. If the account cannot reach three (reused plus affordable), tell the user before
building: insufficient Cubes or assets, top up or subscribe to get more Cubes in order to publish.
**Call `thrixel_account_status` and read the real numbers.** Read the plan, cube balance,
operation allowances, and concurrent-job cap. A free account may have topped up; a paid account
may have spent its allowance. Base recommendations on the work and resources available.
**Never state a plan, price, cap or pack size from memory, including from this file.** Call
`thrixel_pricing` for the catalogue (plans, concurrency caps, fixed operation prices, top-up
packs) and `thrixel_account_status` for this account. Both read live from Thrixel, so what you
show the user is always what they will actually be charged. Numbers written into this file
eventually are not.
## Draw the line through the list before you generate anything
You have the list the game wants and the balance that exists. Work out where one meets the
other now, at the desk, rather than discovering it later when a call fails.
1. **Rank the assets by visible impact.** Put the main character, prominent buildings,
vehicles, and distinctive environment pieces ahead of incidental decoration. Group
repeated objects that can share one model without compromising the design.
2. **Estimate costs by subject and operation.** Use the typical subject costs exposed by
`thrixel_create_model` and the current fixed prices from `thrixel_pricing`. Include
reference-image costs where applicable and reasonable room for refinement. Show an
approximate range; do not treat variable generation costs as a guaranteed asset count.
3. **Name the tradeoff before generating.** For example: "Your current cubes should cover
the player vehicle and garage. The roadside buildings and detailed vegetation may need
more cubes. A top-up would let me generate those with Thrixel as well." Use the actual
project's assets. If there is a shortfall, combine this with HARD STOP 1 below so the user
gets one explanation and one choice. If there is no shortfall, proceed without a payment prompt.
4. **Build the chosen scope.** Use Thrixel assets for the planned visual focal points and
make the mechanics work with what is available. Keep any unfinished art replaceable.
Do not fill the rest of the game with a large collection of low-detail procedural
substitutes and present the planned art pass as complete. Terrain, simple surfaces,
effects, collision shapes, and intentionally geometric art may still belong in code.
**Do this on every plan, paid included.** A plan name is not a balance: the allowance arrives
once a billing month and spends down from there, so an account on the largest plan, late in its
cycle, can be holding less than a brand-new free one. Reading the plan name instead of the
number is how a paying user ends up starting a twenty-asset game with seven assets' worth of
cubes.
**If the balance reaches the whole list, there is nothing to say.** No line, no news.
**Re-check `thrixel_account_status` every few assets.** Estimates drift, and a balance that
has increased may cover more of the plan. Continue in the agreed priority order without
exceeding any user-set spending limit; do not infer a payment from a balance change alone.
### The line is a forecast, not a quota
It exists so the user knows what to expect, and it is deliberately approximate. Treating it as a
budget to stop at leaves cubes unspent and the game thinner than the balance was good for, so
keep working down the agreed list while resources allow. Respect any user-set spending cap;
do not start a variable-cost job if its possible cost could exceed that cap. The service
checks whether an operation is available before running it; a successful run spends cubes.
Two kinds of operation, gated differently, so "no" arrives in two shapes:
- **Create and Edit are priced after the run**, so the only question is whether
anything is left. Any positive balance buys one more, and a single overrun past zero is
absorbed rather than refused mid-job. Worth attempting even when what remains looks small
for it.
- **Detailer, Sculptor and Texture cost a flat price** the balance has to cover up front. Once
it no longer does, defer those operations until enough cubes are confirmed, while a Create
may still go through.
That is a reason to reorder rather than to stop; a plain Architect asset is still worth having.
Stop the affected generation calls when the service refuses or the available balance or
user-set budget cannot support them. Continue the rest of the build. Do not repeatedly retry
an operation whose cube or monthly allowance is exhausted.
## Remember budget decisions across sessions
Keep a small, human-readable record at `<game-source-root>/.thrixel/preferences.md`.
Read it at the start of each build or resumed session, before any payment suggestion.
Use the individual game's source root, not a disposable build folder, the installed skill
directory, or account-wide agent memory. Keep it with the source when moving the project.
This lets different agents working in the same folder recover the same decisions.
**Save decisions when they happen.** Record only preferences the user actually expressed:
- Whether they ruled out new purchases or further payment suggestions, and the scope of
that instruction: this game, this asset pass, or a broader scope they explicitly named.
- Any spending ceiling, including its unit and scope, and subscription preferences.
- The current asset pass and whether its budget choice or completed-build offer has
already been made, accepted, or declined. Name the affected assets so a renamed build
does not turn the same declined offer into a new one.
- A purchase already selected but awaiting confirmation, so a new session does not ask
them to buy again. Confirm balance through the tools; this note is not proof of payment.
Use a short quote or faithful summary of the user's decision. For example, only when the
user actually said this:
```markdown
# Thrixel project preferences
- User decision: "I don't want to spend any money on this game."
- Scope: this game, including later edits.
- New purchases and payment suggestions: disabled unless the user reopens the budget.
```
Do not write the example as a default. Distinguish "use my current cubes for this pass"
from an explicit refusal to pay: the former still permits the one completed-build offer
described below. Preserve the user's wording when a limit could mean either new purchases
or consumption of existing cubes; do not silently broaden permission to spend.
**Restore decisions, not the conversation's age.** A new session, another agent, new
features, a plan change, or an increased balance does not cancel a saved refusal. An
explicit no-purchase instruction remains in force even when the user requests better art.
The user's latest explicit budget decision takes precedence; update the record when they
change it. Reopening one asset pass does not remove unrelated limits or preferences.
The record guides recommendations and use of resources, never authorizes a charge.
Keep one record and add a short pointer in existing project instructions such as
`AGENTS.md`, `CLAUDE.md`, or the README. Preserve unrelated content. Do not store checkout
URLs, account identifiers, credentials, or a running balance here, and do not include the
file in the public game bundle. If the record is missing, first check the current conversation
and existing project notes for decisions rather than treating a new session as a reset.
If records conflict, preserve the more restrictive limit while resolving them; do not
restart payment suggestions merely because the record is unclear.
If no persistent filesystem is available, use the project's persistent notes when the
environment supports them. If neither is available, respect known decisions for this
session and be honest that they cannot be restored automatically next time. A failed
write must not interrupt building; retain the decision in available project notes and
mention the persistence problem once. Never claim a preference was saved when it was not.
## HARD STOP 1: choose the asset budget before generation
**Apply this to any plan with an estimated shortfall.** If the current cubes cover the planned
assets and refinement, proceed. Check the restored project preferences first. If the user has
already chosen the budget for this scope, honor that choice without asking again.
"No spending" means use existing resources and
explain any material art limitations without offering a purchase.
Otherwise, before the first generation call, briefly name what the current balance should
cover and which important assets would benefit from more cubes. Recommend a specific next
step, then ask whether they want to top up, subscribe or upgrade, or build with the current
balance. Use a question picker if available, or ask in plain text. Wait for the choice before
spending cubes; planning, setup, and other work that uses no cubes can continue meanwhile.
Frame the options around the game, for example:
- **Top up for the environment assets:** generate the roadside buildings and vegetation
with Thrixel, using a one-time cube purchase without a subscription.
- **Subscribe or upgrade for ongoing asset work:** more monthly cubes for this game and
later iterations, with any relevant plan benefits confirmed by the current catalogue.
- **Build with the current balance:** prioritize the vehicle and garage, reuse suitable
assets, and complete the playable game with the remaining art clearly identified.
Use the actual assets and available choices. Recommend a top-up for a finite asset pass;
a suitable paid plan may fit better when the user expects ongoing generation or iteration.
Do not default to the most expensive option. Check that the suggested pack or plan is likely
to cover the estimated work with headroom, and be clear if it covers only part of the list.
If the user prefers no subscription, recommend only a top-up. Do not offer an upgrade to a
plan they already have or an unavailable tier.
**Explain the visual benefit concretely.** More cubes can fund modeled silhouettes, richer
environment pieces, consistent props, and refinement of the assets the player sees most.
Do not label free users, tell them that free games look bad, equate a subscription with
"a full game", or imply that gameplay and polish are withheld until they pay.
### Pricing, checkout, and offers
Call `thrixel_pricing` for current packs and plans and `thrixel_account_status` for the
account before recommending a purchase. Never use a fixed per-asset average, pack table,
plan price, or discount copied from this file. If pricing cannot be checked, say the cost is
unverified, continue within the agreed resources, and do not invent a paid recommendation.
Top-ups are available on free and paid plans without a subscription. Distinguish a one-time
purchase from recurring billing. For a paid plan, explain its current price and allowance;
only mention concurrency benefits when they apply to the work. A larger concurrent-job cap
can permit larger Architect batches, but it does not guarantee shorter GPU queue waits.
- If they choose a cube pack, call `thrixel_buy_cubes(usd=...)` with the pack they selected
from `thrixel_pricing` and give them the returned link. If they have not selected a pack,
recommend a suitable current pack and get their choice before creating checkout.
- If they choose a subscription or upgrade, call `thrixel_upgrade_plan(tier=...)` for their
chosen, supported tier and give them the returned link. If that tier is not supported by
the installed tool, explain the limitation rather than substituting another plan.
- Use these checkout tools only after the user chooses that purchase. They return links;
payment happens on the checkout page. Always print the link, even if also opening it.
- Relay any account-specific discount accurately, including the initial price, subsequent
recurring price, and applicable conditions. An offer changes the cost of an option; it
does not justify another prompt during building or after an explicit no-spending request.
Do not invent urgency or repeat the same promotion at each checkpoint.
**After handing over checkout, keep building with the confirmed balance.** Do not wait for
the user to pay or assume the purchase will complete. Re-check account status during normal
generation batches and after they report payment. Confirmation can be delayed. Generate
additional agreed assets only when the updated balance or allowances support them. At zero
cubes, continue mechanics, integration, testing, and polish with the assets already available.
If the payment tools are unavailable, do not attempt checkout through a hand-written API
call. Explain the available account-management route only when the user asks to purchase,
then continue the build with confirmed resources.
### During the build: keep working
Do not stop mid-build for balance warnings, upgrade questions, or checkout links. Check the
balance as needed to schedule work, but save the next asset-improvement offer for the playable
handoff. If generation becomes unavailable, stop those calls and finish the game's mechanics,
controls, asset integration, and testing. Correct code, lighting, composition, and performance
problems yourself; more cubes are not a remedy for an unfinished implementation.
Keep the presentation as coherent as possible using the assets that landed, appropriate
reuse, and good lighting and composition. Use temporary geometry only where it is needed for
gameplay or to test an unfinished asset's placement. Do not add conspicuous grey blocks,
in-game upgrade messages, or deliberately worse art to make purchasing look necessary.
Identify temporary art in the handoff and retain a clear replacement plan.
Quality targets and critic rounds elsewhere in this skill must respect the user's budget
and scope. Complete the feasible integration, testing, and polish; do not keep a playable
handoff pending indefinitely because further art work needs a purchase they declined.
### After the build: offer an asset-improvement pass
Finish and test the playable game, then hand it over with its controls and address or engine
preview. For three.js and Unity WebGL, follow HARD STOP 2 for the publishing choice. Do not
hold delivery, an authorized publish, or the existing link while waiting for a budget answer.
The first playable preview may come earlier: deliver it when ready, then finish the feasible
funded work and polish before making this art offer. Do not repeat the offer at both previews.
**If planned Thrixel assets or refinements remain limited by cubes, offer one focused visual
improvement pass on any plan, free included.** The balance need not be exactly zero: remaining
cubes may be insufficient for the next suitable operation. First check whether the current
balance can already cover the work; if it can, finish the agreed assets without a payment prompt.
If the art plan is complete or the remaining problems are implementation issues, skip the offer.
Name two or three high-impact assets from the unfinished list, explain how they would improve
the game, and give an approximate cube requirement based on current pricing. Use screenshots
or the playable scene as context when available. Ask a direct, optional question rather than
ending with a vague "let me know if you want more". For example:
> The driving course is playable. The roadside buildings and vegetation still use temporary
> art. Generating those with Thrixel would give the route more detailed landmarks and scenery.
> Would you like a one-time top-up for that art pass, a paid plan for continued asset work,
> or to keep this version for now?
Tailor the recommendation and options using Pricing, checkout, and offers above. This is
allowed even if they chose the current balance at the start, because they can now evaluate
the actual game. Skip it if they explicitly ruled out spending or further payment suggestions.
If they already chose a purchase and payment is still pending, do not ask them to buy again;
identify the deferred art and continue with confirmed resources.
Combine any relevant new discount with this one offer instead of adding a second payment prompt.
Record that the offer was made, its asset scope, and the user's answer when it arrives in
`.thrixel/preferences.md`, so a fresh session does not repeat the handoff question.
If they decline, accept it and finish the handoff. Do not leave the task marked pending or
repeat the offer on a recording, publish retry, bug fix, or routine follow-up. If they choose
a purchase, hand over the requested checkout link and continue any useful work; do not wait
idly for payment. After confirming additional cubes, generate the agreed assets, integrate
and test them, and update the same published game when authorized.
### Follow-up requests
At the start of a follow-up that adds substantial assets or requests a visual improvement,
revisit the relevant part of the asset list and current balance. For example, adding a town
may need new buildings, while fixing steering or moving the camera may need no new assets.
If the new work exceeds the balance, explain that specific gap and make one budget
recommendation before generation, using HARD STOP 1. A request to improve the previously
deferred art is a reason to revisit its budget; merely continuing the conversation is not.
Carry forward existing spending limits and subscription preferences. If the request repeats
an unchanged scope whose budget was already settled, use that decision unless the user is
explicitly asking to improve the previously deferred art as described above. Do not treat a fresh
session, a renamed game, or a new version number as permission to repeat declined offers.
After a follow-up budget discussion, do not repeat the same offer at that round's handoff;
report any remaining art plainly. An explicit "no spending" remains in force until the user
changes it, even if they request more features.
## What things cost
Read the actual prices with `thrixel_pricing`. The shape of the pricing is what matters here,
and it is stable even when the numbers are not:
- **Detailer, Sculptor, Texture: a flat price per run, plus a reference image when you give
them only a prompt.** The flat part buys the GPU run. Handed just text, the service also has
to generate the image the run works from, and that is billed on its own - roughly a third
again on top. Passing an image, or reusing one with `reference_image_id`, skips it. Budget
the prompt-only case or your arithmetic is short on every one of them.
- **Reduce triangles, smaller textures: free.** Smaller textures come from `thrixel_download(texture_size=512 | 1024 | 2048)`. Always use `thrixel_reduce_triangles` to hit a triangle
budget; never re-run the detailer at a lower target to make something lighter.
- **Architect: metered on real usage and charged after the run**, so it varies by what the
object is. Props are the cheap end, vehicles a little more, buildings more again, and
characters and creatures the expensive end at roughly two props each. The tail is long:
about one asset in ten costs double its subject's typical figure, which is why a plan
costed at the typical figure needs headroom rather than exactness. `thrixel_create_model`
carries the current per-subject numbers; take the balance from `thrixel_account_status`.
**Object complexity moves the cost far more than any setting you control.** There is no
tier-shopping decision to make here - the numbers are for planning the order of work, not
for finding a cheaper way to build the same asset.
## Quality tier - always Plus
**Always use `plus`. It is the default when you omit `quality`, so the correct action is to
omit it.**
Do not pass `balanced` on your own initiative - not to save cubes, not because the balance
looks low, not because the asset seems simple, and not because the user said something
general like "keep it cheap". The only time you pass it is when the user explicitly names a
lower tier and asks you to use it. That is an advanced override, and it is never the default.
- `plus` - the default, and the right answer for essentially everything.
- `balanced` - only if the user explicitly asks for it.
The two tiers are a flat 2x apart on price, so a set built entirely on Plus does cost about
twice a set built entirely on Balanced. That is a known and accepted cost: the balance buys
fewer assets and every one of them is the better version. Where the balance is the binding
constraint, cut the asset list rather than the tier - a shorter list of assets that look
right beats a longer one that does not, and the ranking in "Draw the line" already says
which ones to cut.
Instancing is a *scene-dressing* technique, not a savings technique: rotating, scaling and
recoloring one mesh into a row of crates is good level design, and retexturing against a shared
`reference_image_id` gets variants cheaply. Use it where it makes the scene better. Do not use
it to avoid generating an asset the game actually needs.
Do not downgrade the *generation type* to save money either. Sculptor vs architect vs
architect+detailer is a correctness choice, made by the rules below.
# Target engine
Settle the engine before you generate anything: ask the user, use context clues, or look at
nearby files. Then read that engine's file **in full**:
- **three.js / web** → [engines/threejs/threejs.md](engines/threejs/threejs.md), toolchain setup in [engines/threejs/setup.md](engines/threejs/setup.md)
- **Roblox** → [engines/roblox/roblox.md](engines/roblox/roblox.md), toolchain setup in [engines/roblox/setup.md](engines/roblox/setup.md)
- **Unity** → [engines/unity/unity.md](engines/unity/unity.md), toolchain setup in [engines/unity/setup.md](engines/unity/setup.md)
- **Unreal Engine** → [engines/unreal/unreal.md](engines/unreal/unreal.md), toolchain setup in [engines/unreal/setup.md](engines/unreal/setup.md)
If the toolchain for it is not installed yet, follow the respective `setup.md`.
The toolchain should be installed once per machine. Choice of engine is per game.
The respective `setup.md` may also have steps that are needed upon every new project for the engine.
# Thrixel asset generation
Thrixel turns text or image prompts into meshes, downloadable as `.glb`, `.fbx`,
`.obj`, `.stl`, or `.usdz`. Thrixel provides three main paths, depending on the user's need:
- "Architect" path: Generate low poly assets with smart hierarchy
- "Architect -> Detailer" path: Generate low poly assets, then run "detailer" to add high
quality high poly detail, retaining smart hierarchy
- "Sculptor" path: Immediately generate detailed high poly assets, no hierarchy
Thrixel also provides other utilities/sub-features:
- A "Texture" follow-up can be run on ANY completed submission, regardless of type. Applies fresh materials
and preserves geometry exactly.
## Choosing a path per asset - ask this first
**Does any part of this asset have to move on its own?**
Wheels that spin, sails that turn, a turret that rotates, a door that opens, a lid, a limb,
a propeller. That single question decides the path, because **only Architect produces named,
separately addressable parts**, and it is the only property you cannot add later. Polygon
count and realism you can always change; a merged mesh can never be un-merged.
| Need | Path | Why |
|---|---|---|
| **Moving parts, lower poly, more stylized look** | Architect | Named part hierarchy, cheapest option |
| **Moving parts AND high poly, high quality, or organic/complex details** | Architect -> Detailer | The detailer mostly keeps the hierarchy, but see the caveat below: thin parts can still be lost |
| **Moving parts, and the shape is already right** | Architect -> Texture | Geometry is untouched, so every part and name survives exactly. Same price as the detailer |
| **Static, organic** (creature, character, plant, rock, food) | Sculptor | Best organic shapes, and cheaper than Architect -> Detailer |
| **Static, man-made, high poly, high quality, or organic and/or complex** | Sculptor | Nothing moves, so the part hierarchy buys you nothing and costs ~1.5x |
| **Static, stylized / low-poly, instanced a lot** (trees, rocks, crates) | Architect | Keeps triangle counts sane when placed hundreds of times |
**`adherence_level` runs 0 to 12, and 9 is the DEFAULT, not the maximum.** 9 keeps
`preserve_parts` on. **Below 9 the server merges the parts by default**, because holding a part
split together while the silhouette is being reshaped is what produced the remesh artifacts. So
if you chose Architect *for the parts*, do not lower adherence. If you truly need both, pass
`preserve_parts: true` explicitly and inspect the result.
**`preserve_parts: true` is best effort, not a guarantee, and thin parts are what it loses.**
The survivors are the thick parts. A propeller blade is thin, and thinness is what predicts
destruction, so the parts most likely to be destroyed are exactly the moving parts you chose
Architect to get.
**If parts must survive, set `adherence_level: 12`.** The default 9 is not enough. Measured on
one 78-part quadcopter blockout, same seed and same reference image, only adherence changed:
| | `adherence_level: 9` (default) | `adherence_level: 12` |
|---|---|---|
| parts returned | 28 of 78 | **35 of 78** |
| propellers | one gone, two returned as slivers | **all four, at full size** |
12 still drops very small decorative sub-parts (cooling slots, indicator rings), so it improves
the odds rather than guaranteeing anything.
**So: if the blockout's shape is already what you want, do not run the detailer at all.** Use
`thrixel_retexture_model` instead. It costs the same, gives the asset a finished look, and never
touches geometry, so every part and name survives exactly. The detailer is for when you want the
*shape itself* to gain detail. Always `thrixel_inspect_model` a detailer result and confirm the
parts you need are still there.
**Proportions matter too.** An asset whose bounding box is far from a cube - a building, a roof,
a floor plane, anything long and thin - comes back noticeably worse from both the Detailer and
the Sculptor, because the object fills only a small part of the working volume. For buildings,
texture rather than detail.
**What the paths cost relative to each other** (absolute numbers from `thrixel_pricing`):
| Path | Cost | Note |
|---|---|---|
| Architect alone | Cheapest by a wide margin | Metered, so it varies with the object |
| Sculptor | One flat operation, plus a reference image if you gave it only text | Cheaper from an image you already have |
| Architect -> Detailer | Metered Architect **plus** one flat operation | The most expensive route. The detailer inherits the mesh, so no reference image is generated |
So **Architect -> Detailer costs several times a Sculptor**. That ratio is the decision;
the exact cube figures are not, and change without this file changing.
**If the object will not be animated, reach for the Sculptor directly.** What Architect ->
Detailer adds over a Sculptor is the named part hierarchy, and a static prop never uses it - so
on something that just sits there you are paying several times over for articulation the
game will not touch. The Sculptor is built for exactly this case: static and organic subjects, one flat
price, the best organic shapes of the three paths. Pay the premium only where you need
articulation *and* fidelity on the same asset: the hero vehicle, the main character, and little
else.
Decide the moving-part list at planning time, not later. It is the same list you will pass to
`thrixel_group_parts`'s `keep_groups` (see Mesh grouping below), so writing it down early makes both decisions
at once.
## Other asset rules
- **Scale**: Thrixel is built for singular, well-defined objects ("a cute chunky bike"), and
that is where it is strongest. Terrain, mountains and very large buildings are the engine's
job - build the large-scale structure in engine code, use Architect for any blocked-out
massing, and spend Thrixel on the props the player walks up to.
- **Complex visual features** (a dragon made of stained glass) need Sculptor or
Architect -> Detailer. Architect alone gives flat-colored low-poly, which is the right look
for a stylized set and the wrong one for a hero asset.
- **Use all three paths in a project** - for variance, for performance, and because each one is
the right answer for a different kind of asset.
- **Iterate with follow-up prompts.** `thrixel_edit_model` holds every part outside
`focus_on_node_names` bit-identical, so refining is cheap and safe. Place the asset, look at
it in the scene, and revise it until it fits. Sculptor results cannot be edited by prompt;
for "same model, but taller", wider, turned around or resized, use
`thrixel_transform_model`, which is free, instead of paying for a regeneration.
- **Pass reference images when the user has them.** Concept art, a sketch or a photo is the
strongest steer there is: `thrixel_create_model` takes `images`, `thrixel_sculpt_model`
takes an `image`, and an earlier asset can be a style reference so a set stays consistent.
With no art, a text prompt is fine; Thrixel draws its own reference picture.
- **Keep Sculptor prompts short.** The prompt is first turned into ONE three-quarter-view
picture, and only that picture becomes the mesh. One or two sentences about what that picture
shows work best; back sides, several objects or "mounted on a wall" context get lost or
garble it. Architect prompts can be longer.
- **Set real-world size at generation.** Pass `target_size_m` (the longest side, in metres)
on create and sculpt, so a volleyball and a referee stand arrive at their own sizes. Without
it, every asset arrives at roughly the same size: a castle keep and a peasant fill the same
bounding box and nothing warns you. Decide each asset class's size when you write the asset
list, and resize a finished asset with `thrixel_transform_model`.
- **Up is always Y. Check FORWARD.** Thrixel exports Y-up on every asset, as glTF requires,
so never write per-asset up-axis detection or a Z-up correction branch. Architect assets
face +Z. Sculptor assets follow their reference picture, so check the thumbnail: a scoreboard facing the wall or stands facing away from the court is a
rotation, so fix it once with `thrixel_transform_model` or at import rather than discovering
it when a vehicle drives sideways.
- **What does not survive every path.** Glowing (emissive) materials survive only on Architect
assets; Sculptor, Detailer and retexture output carry colour, metal, roughness and alpha, so
make glow in the engine. A retexture never changes the shape, so carved or relief detail
(engraving, a decal sculpted into a tombstone) stays; regenerate to remove it.
- **Variant sets**: for three or four consistent siblings of one prop, reuse the same
reference image or style reference across the calls rather than describing the style again. (If a pivot listing from
`thrixel_group_parts` looks Z-up, that is Thrixel's internal working space, not the file -
a real project once wrote "these assets came back Z-up" into a source comment on the strength
of that listing and carried the wrong belief for its whole life.)
- **Use the full-detail model; treat `quality="lite"` as a placeholder only.** A finished
model first exists as a lightweight build with simplified surface colours, and its
full-detail build follows a little later. Every job tool and `thrixel_download` wait for the
full build by default, so the defaults are already right. Only pull `quality="lite"` to lay
out a scene while the full build finishes, then re-download with the default and replace
the file wholesale. Never change a lite file's geometry locally: the full build cannot be
laid over your edits, and they are lost or must be redone. Make shape changes on the server
instead (`thrixel_edit_model`, `thrixel_transform_model`, `thrixel_reduce_triangles`):
each result gets its own full-detail build.
If necessary, read thrixel api docs here: https://thrixel.com/docs/,
but the vast majority of thrixel information is contained within this skill and the mcp.
## API Workflow
Use the **Thrixel MCP tools** for every generation step. Each one submits the job, waits for it,
saves the GLB to disk, and hands back the file path plus a rendered thumbnail - the whole round
trip, handled. Do not write your own polling loop and do not shell out to curl: across a build
with thirty assets, a hand-rolled loop is one dropped result away from a missing model that
nobody notices until the scene is assembled.
**Check the asset budget before the first generation call.** Confirm that:
1. `thrixel_account_status` has been read for this work and the asset costs estimated.
2. The confirmed resources cover the planned work, or the user has chosen a budget/scope
under HARD STOP 1 (including an existing instruction to use only their current balance).
3. Any spending ceiling and decision about purchases are respected.
If there is an unresolved shortfall, ask the budget question before spending cubes. A paid
plan alone does not waive the check, and a free plan alone does not require a purchase prompt.
Use plain text if no question picker is available. Do not generate while awaiting a required
budget choice, but do continue setup and other work that does not spend cubes.
Steps 1 and 2 below are free. The budget choice precedes generation; payment never gates the
rest of the build.
1. **Start a project, named after the game.** Free, one call, and it must come before the first
generation:
```sh
thrixel_start_project(name="Submarine Explorer")
```
Everything generated afterwards is filed under it automatically. **Do not pass `project_id`
on any other tool** - it is already handled, and threading it through thirty calls is how it
ends up missing from three of them.
This is the difference between the user opening the web app and finding this game's assets
as a set, or finding every asset from every game they have ever built in one flat list. That
cannot be sorted out afterwards, so it has to be right at the start.
If the user is returning to a game they built earlier, call `thrixel_list_projects` and
resume it instead, so the new assets join the old ones:
`thrixel_start_project(project_id="<the id>")`.
Each result tells you where it landed (`Filed under project: ...`). If that line is missing,
you skipped this step - fix it before generating anything else.
The project is also what a style guide attaches to (step 2a), and only generations inside
it are given that guide - another reason this call comes first.
2. **Decide the shared style once, and put it somewhere the tools can apply for you.**
Thirty prompts that each restate the style is thirty chances to state it slightly
differently, and the set drifts. There are three places to put it, and they are not
interchangeable:
**a. Rules -> a project style guide.** Things you can state in words: polycount budgets,
"flat colours, no gradients", "never add a ground plane", "a door is 2.1m tall", in-world
naming. Write it once; it applies to every generation in the project from then on.
```sh
thrixel_add_project_source(filename="style.md", content="...art direction, budgets, scale...")
```
**b. Look -> a style reference.** How something should APPEAR: palette, material, finish,
how worn it is. A paragraph is bad at this and a finished model is good at it. Build one
asset you are happy with, then point the rest at it:
```sh
hero = thrixel_create_model(prompt="a weathered wooden market stall")
thrixel_create_model(prompt="a wooden barrel",
style_reference_submission_id=hero.submission_id)
```
The reference contributes appearance ONLY - the subject always comes from your prompt.
`thrixel_sculpt_model` takes it too. Give that one an `image` as well and it restyles YOUR
image into that look, so what comes back is no longer the picture you passed in.
**c. One-off tweaks -> the prompt.** Anything that applies to this asset and no other.
Use a and b together. Text carries constraints, a picture carries appearance; asking
either to do the other's job is where a set starts drifting.
3. **Generate base meshes** with `thrixel_create_model`, passing `quality` per the plan above.
Run them in waves that respect the concurrency cap from `thrixel_account_status`.
Generation runs in the background, so start it early and write systems while it runs, placing
real assets as they arrive.
4. **Look at every thumbnail.** It comes back with the result, so there is no excuse to build on a
bad asset. If the shape is wrong, fix it with `thrixel_edit_model` (natural language, and it
holds every part outside `focus_on_node_names` bit-identical) rather than regenerating from
scratch, which costs more and throws away what was already right.
**Then refine it. This step is REQUIRED for every hero asset and it is the one agents skip.**
Editing is where Architect assets get good, and a first generation is a draft, not a result.
For anything the player sees up close, run at least one `thrixel_edit_model` pass and keep
going until you would ship it:
1. Place the asset in the scene and screenshot it **in context**, not in isolation. Wrong
proportions only show up next to a door, a character, or the ground.
2. Name the single worst thing about it. If you cannot, look harder - "it's fine" after one
generation means you have not compared it to the reference.
3. Fix exactly that with `thrixel_edit_model`, scoped with `focus_on_node_names` so the rest
stays bit-identical. Look again.
Editing is metered and cheap next to regenerating, so the loop costs far less than settling.
Stop when the asset is genuinely good, not after a fixed number of passes.
5. **Detail pass (optional, animated assets only)** with `thrixel_detail_model` - one flat
operation. Turns a blockout into high-resolution geometry with a PBR texture. Only worth it when the asset needs
its part hierarchy *and* fidelity; for anything static, generate it with the Sculptor instead.
Pass a `prompt` describing the finished look, and set `adherence_level: 12` so your named
parts survive - the default of 9 loses thin ones. `texture_size` is 2048 or 4096;
`decimation_target` around 20000 is a good game target. **Skip this step entirely if the
blockout's shape is already right** - go straight to step 6, which costs the same and cannot
damage the geometry. After any detail pass, `thrixel_inspect_model` the result and confirm
your moving parts are still in the list; thin ones do get lost.
6. **Texture pass (optional)** with `thrixel_retexture_model` - one flat operation, new
materials, geometry untouched. This is the cheap way to restyle a whole set: pass the same `reference_image_id` to
every asset and they come back visually consistent, and reusing an image is not re-charged.
`apply_to_node_names` restricts it to named parts.
7. **Hit the triangle budget** with `thrixel_reduce_triangles`. **Free.** Never re-run the detailer
at a lower target to lighten something.
8. **Group the meshes before importing into the engine** (see below), then:
```sh
thrixel_group_parts(submission_id=..., keep_groups=[...])
```
## Mesh grouping - required, not an optimisation
Thrixel returns a *named part hierarchy*: one mesh node per part. That naming is the whole
point of the Architect path, but the node count is high (ie dozens or hundreds). In engine,
this gives each object its own draw call and kills fps.
**`thrixel_group_parts` fixes this, and it is FREE.** It runs on Thrixel's servers, so you
do not need Blender installed. Run it on every model before importing into the engine.
- **Everything that does not move becomes one mesh** (default name `Body`). Material slots
survive the join, so the semantic slots (`Paint`, `Glass`, `Chrome`, `Rubber`, `Rim`, ...)
stay addressable per-surface. Re-skinning those slots with authored PBR is what makes
independently generated assets look like one set. How the slots surface in your engine is
in the engine file.
- **Named moving parts stay separate**, one mesh each, via `keep_groups`. Each gets its
origin set to its own geometric centre, so the engine can spin or steer it in place
instead of orbiting the model root. `FL` / `FR` / `RL` / `RR` auto-expand to the
wheel-corner spellings Thrixel actually emits, so you can omit their aliases.
- **The result reports each group's pivot origin.** That is what you position and animate
against; it is not recoverable from the GLB without re-parsing it. Pivots always sit at the
group's geometric centre - right for a wheel, wrong for a turret or a head on a swivel,
where the real axis is the mount point. Fix those in-engine: parent the part under an empty
(Unity) or a `THREE.Group` placed at the mount point, and rotate the parent.
- **Scattered props get a triangle budget** via `target_triangles`, applied to the merged
mesh only. Kept groups are left alone, because decimating a wheel to hit a whole-model
budget wrecks it. Sculptor output is deliberately dense - trees arrive at 90-160k triangles,
which is what you want for a hero close-up and far more than you want instanced hundreds of
times. `target_triangles` serves both, and it is free.
```
thrixel_group_parts(
submission_id = "<the detailed car>",
keep_groups = [{"name": "FL"}, {"name": "FR"}, {"name": "RL"}, {"name": "RR"}],
target_triangles = 20000,
)
```
**Call `thrixel_inspect_model` first to get the real part names.** A `keep_groups` entry
that matches nothing **fails the job on purpose**. Silently welding a moving part into the
body gives you a model that looks perfect and simply never animates, which is far more
expensive to debug than a failed job.
Two things it handles that are easy to get wrong by hand: matching part names requires
tokenising the node path (regex `\b` fails on `_`, so `\bfl\b` never matches `FL_spoke0`),
and structural parts nested *inside* a moving group - `FL_arch`, `FL_Coil3` under
`FL_Wheel_Group` - must be excluded or the wheel arch spins with the tyre.
### If you decimate a GLB yourself, weld first
`thrixel_reduce_triangles` already handles this, which is the main reason to use it. If you
reduce a Thrixel GLB with your own tooling instead, **weld coincident vertices before you run
the decimator** (Merge by Distance in Blender, `mergeVertices` in three.js).
glTF has no per-face UVs, so a textured GLB arrives with its vertices split along every UV
island boundary. Those duplicates sit in the same place but are not connected, so a collapse
decimator pulls them apart and the seams open into large visible cracks.
`thrixel_reduce_triangles` welds first, which is why it does not. Welding does not disturb the
UVs, which are stored per-corner, so each island keeps its own coordinates.
Better still, do not decimate by hand at all - `thrixel_reduce_triangles` is free and already
correct.
# Publishing to thrixel.world - the first playable build is a hard stop
This applies to Unity and three.js games. Roblox games cannot be published to thrixel.world.
Every Unity and three.js game can go live on the public internet at
`<slug>.thrixel.world` - a real URL the user can text to a friend, who plays it in a browser
with nothing to install. Publishing is free and does not consume cubes.
**The timing rules immediately below apply when YOU built the game in this session.** If the
user asked you to publish a folder they already have, they have already decided; skip to
"Publishing a game you did not just build".
**HARD STOP 2: the first build that is playable end to end, put it in front of them, then
ask.** Not a later "finish line" the user has to declare, and not after one more round of
polish. The first time the assembled bundle passes playcheck, that is the moment.
**Get it running before you ask anything.** Nobody can answer "want this published?" about a
game they have not touched, and a message that ends in that question with no address in it
reads as "I built something, trust me". So, in this order:
1. Serve the assembled bundle, in the background so your session carries on:
```
node <skill>/tools/serve.mjs <the bundle directory> --lan
```
It prints two addresses: one for this machine, one a phone on the same Wi-Fi can open.
**The assembled bundle, not the dev server.** `npm run dev` is for iterating; it resolves
bare imports and forgives a missing asset folder, and a static host does neither. What
they play through serve.mjs is byte for byte what gets published, so "worked locally,
black screen once published" cannot open up between the two - and serve.mjs prints every
404 as it happens, which is that black screen caught early.
2. Hand it over with the controls in the same breath - the line you will pass as `controls`
at publish time, so say what you actually wired up.
3. Then the publish question, in that same message, once:
> It's running: http://127.0.0.1:5590/ - on your phone, same Wi-Fi: http://192.168.1.20:5590/.
> WASD to move, Space to plate, Esc to pause. Have a go.
>
> When you're happy with it, say publish: you get a link anyone you send it to can open in a
> browser, phone included, and it stays the same link every time I update it. Free, no cubes.
- **Yes** -> record the preview clip (next section: thirty seconds, into the same bundle),
then publish that bundle and give them the public URL as the first line of your reply.
Every later publication reuses the same link.
- **Changes first** -> keep the server up. A rebuild is picked up on their next refresh, so
every iteration is "rebuilt, refresh and try it" and never a new address. Take it through
playcheck again before the publish that follows.
- **No** -> the game is already in front of them; say the offer stands whenever they want it,
and do not raise it again this session unless they bring it up.
The local address dies with your session and never reaches anybody else, which is exactly
why it is the test bench and the published link is the address they keep. If it stops
answering, "run it again" is one command; say so if they ask.
If they ask what publishing means before answering, lead with the two facts that matter:
the game becomes playable by anyone who has the link, at a random `name.thrixel.world`
address, and they can unpublish or update it at any time. It is not in any public gallery
unless they later ask for that separately.
## Publishing a game you did not just build
The user points at a folder and asks for it to go online. This is a complete job on
its own: **no asset planning, no plan or balance talk, no engine choice, nothing is
spent.** Publishing is free.
**Look at the directory before you do anything with it.** `ls` it, read its
`package.json` if it has one, open its `index.html`. You are about to put its
contents on the public internet under the user's account, and you cannot judge any
of what follows without having seen what is in there. Then work out which of these
you have:
| what you find | what to do |
|---|---|
| `index.html` at the top, next to `.js` / `.css` / asset folders | Ready. Go to "Check it before it is public". |
| `package.json`, `src/`, `vite.config.*`, maybe `dist/` | A source tree. **Build it first** - see "Assemble the bundle". Raw source serves a black screen. |
| `index.html` + `Build/` + `TemplateData/` | A Unity WebGL build. Ready as-is; see [engines/unity/unity.md](engines/unity/unity.md) for the size and memory caveats worth mentioning. |
| A folder whose game is one level down (`game/`, `dist/`, `build/`) | Publish THAT folder, not its parent. |
| `.thrixel/world.json` in the folder or its project | Published before. Publishing again updates that same game at the same link; say so, rather than announcing a new one. |
| No `index.html` anywhere | Not a web game. Say so plainly and ask what they meant - a Unity/Unreal project folder, a `.exe`, or a Python game cannot be published; thrixel.world serves static web files only. |
Then go through the checks below, publish, and give them the URL. The whole job is
usually under two minutes.
## Assemble the bundle
**Skip this section if the folder is already a built bundle** - `index.html` at the
top next to its assets - and go straight to "Check it before it is public".
`thrixel_publish_game` wants a directory of static files with `index.html` at its
ROOT. For a Vite project - which is what the three.js kit produces - assemble the
shippable form first:
1. **Build.** `npx vite build` -> `dist/`. Source form does not work on a static
host: the dev server resolves `import 'three'`; nothing on a CDN will. If
`node_modules/` came from a different machine (a zip from a Mac, say), delete it
and `npm ci` first, or the build fails on the wrong platform binaries.
2. **Runtime assets.** Anything the game fetches at runtime (`/assets/*.glb`,
`manifest.json`, audio) is NOT bundled by Vite unless it sits in `public/`. Copy
those directories into the bundle next to `dist/index.html`, preserving their
paths.
3. **Cover.** Put a representative screenshot at the bundle root as `cover.png` - it
becomes the game's card art. If you built the game, you already have shots from
the capture harness; pick the best one. If the folder came from the user, take
one - open the game and screenshot it, or ask them for a picture they like. A
game without a cover gets a plain placeholder, which is the difference between a
card someone clicks and one they scroll past. If you leave the slot empty,
`playcheck` fills it: it screenshots the running game partway through its own
checks, and only when those checks passed. Anything you put there wins over that,
so drop in a better frame whenever you have one.
4. **Preview clip.** `preview.webm` at the bundle root: 20-30 seconds of the game
being played, which the card plays on hover and the world's page shows in front
of the game until the visitor presses Play. You record it from a storyboard you
write - see "Record the preview" below. It comes AFTER playcheck, because a clip
of a broken game advertises a broken game.
5. **Serve the assembled bundle locally** and confirm the game loads from THOSE
files: `node <skill>/tools/serve.mjs <bundle>`, which also lists every 404. This catches a missing asset directory in
seconds, and it is the difference between publishing a game and publishing a
black screen.
## Check it before it is public
The server already refuses the things a server can judge: path traversal, symlinks,
zip bombs, absolute paths. It skips what is merely junk - dotfiles, `node_modules/`,
lockfiles, stray scripts, unknown file types - silently and non-fatally, so you do
not need to prune those by hand.
What the server cannot judge is what the files MEAN, and that is your job, because
you are the only one who has read them. Four things, quickly:
1. **Secrets.** This is the one that actually happens, and it is silent. A `.env`
file is skipped by the server, but **Vite inlines every `VITE_*` variable into
the built bundle**, and hand-written keys live in source too. Grep the assembled
bundle - not the source tree - before it ships:
```sh
grep -rIEn "sk-[A-Za-z0-9]{16}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_-]{20}|ghp_[A-Za-z0-9]{20}|xox[baprs]-|-----BEGIN [A-Z ]*PRIVATE KEY" <bundle> | head
```
Anything that matches: **stop, tell the user which file and which key**, and do
not publish until it is out. A key on a public CDN is a key that is gone. Note
that a game calling an API from the browser needs the key in the browser, so
"just move it to a variable" does not fix it - the fix is a key that is safe to
be public, or a server the game talks to instead.
2. **Private files that came along for the ride.** Notes, screenshots of other
things, documents, exports - a game folder often accumulates them. Name anything
that does not look like part of the game and let the user decide.
3. **Content that is not theirs to publish.** Downloaded models, ripped audio,
someone else's game. Local play and a public URL under their name are different
things. If the folder is obviously somebody else's work, ask before publishing.
4. **What it actually is.** Publish games. Do NOT publish a page that imitates a
real company's login, a payment form, a fake storefront, or anything built to
look like a service it is not - regardless of how it is described. That is
phishing infrastructure, and it is not a judgement call about the user's
intentions: the platform must not host it. If a folder is that, say plainly you
cannot publish it, and do not offer a workaround.
And one fact that is not a problem but must be said out loud before the link
exists: **a server component will be dead.** A multiplayer relay, an LLM proxy, a
score backend - only static files ship. Say which feature stops working, and make
sure the game degrades gracefully rather than hanging on a failed fetch.
## Prove it runs - the last gate before a human gets the link
**Run this on the assembled bundle, every publish, no exceptions:**
```
node <skill>/tools/playcheck.mjs <the bundle directory>
```
It opens the bundle in a real browser at a desktop viewport and again on a phone,
and checks that it loads with no errors, draws something, and **responds to
input** - keys on desktop, a real touch drag on the phone. Exit 0 publish, exit 1
do not.
**Do not skip this because the build succeeded.** A build succeeding means the
code bundled, not that it runs. The case this exists for: a game shipped with
`window.loadOrbModel = loadOrbModel` left behind after the function it named had
been refactored away. Vite does not care - a ReferenceError happens at runtime -
so the build passed, the publish succeeded, and the summary said "fully playable,
60 FPS". The page was black on the first frame. Nobody had opened it.
Note which check caught that: the page still *drew* something, because the HUD
overlay rendered fine. It was **responds to input** that failed, at 0% of the
frame changing. So a screenshot is not proof either - only input is.
If it exits **2**, there is no browser installed and the bundle was NOT checked.
Either install one (`npm i -D playwright && npx playwright install chromium`) or
open the bundle yourself with a static server and look. Never describe a game as
working on the strength of a check that did not run - say plainly that it is
unverified and let the user decide.
For a three.js kit game, `tools/mobilecheck.mjs` goes deeper on the phone side
(it drives the kit's own input layer and reports the frame rate); run both.
## Play it like a player - look at it before anyone else does
playcheck says whether the game runs. It cannot say whether the game is **right**:
a scene with the hero model missing, a part that should move standing still, the camera
inside a wall, a menu that never closes, text over the play area. Those pass every
automatic check and are obvious in one look. So after playcheck passes, play it:
```
node <skill>/tools/playtest.mjs <the bundle directory> --out=<a scratch folder>
```
It presses start, then moves, turns, uses the action key, drags on a phone screen and
waits idle, saving a screenshot after each step, and prints the errors it saw. Add the
game's own controls with `--inputs='[{"name":"jump","keys":["Space"],"ms":400}]'`.
**Open every screenshot and look at it as someone seeing the game for the first time:**
- every model the game loads is on screen, at a believable size, facing the right way;
- each control does what the controls line says, and the frames show it;
- whatever the player steers faces the way it travels: walking or driving backwards or
sideways means the model's front is not where the code assumes (see "Check FORWARD");
- everything that moves in real life moves (rotors, wheels, doors, creatures, water);
- nothing covers the play area, nothing is black, blank or stuck on a loading message;
- the phone frames show a playable layout with the touch controls visible.
It may run on a machine with no GPU. When it says the machine was too slow to judge a
check, that is the machine, not the game: judge that check from the screenshots, and do
not cut the game's visuals to make the test pass.
Fix what you find and play it again. Take as many rounds as it needs: time spent here is
time the user does not spend finding the same bugs. Only when the screenshots show the
game you are about to describe, with no errors, does it go on to the preview and the
publish. Say in your summary what you checked and what you fixed.
## Record the preview - the clip a stranger watches before they press Play
**After playcheck passes and before you publish: every first publish, and every
republish that changed how the game looks or plays.** It is the most watched thing
about the world - the card plays it on hover, and the world's page shows it in
front of the game until the visitor presses Play.
You write the storyboard, because you are the only one who can. A script that
pressed WASD blind produced motionless clips of every game that answered to other
keys, and that is why this feature was once removed. You know which key opens the
door, when the boss appears, and where the camera should be when it does.
1. **Find the moment the game is worth watching, and start there.** Not when it
finishes loading - THAT is the mistake this section exists to prevent. A card
plays the clip on hover and stops when the pointer leaves, so the first second
or two is the entire audition; a stranger decides there, not at 0:12. Games
are almost never at their best at second zero: the room is empty, the assets
are still popping in, the menu is up, no score, no enemies, nothing has
happened yet.
The test, before you write a step: **if frame one could be a loading screen,
an empty scene, or a menu, the clip starts in the wrong place.** Open on
motion, on a scene that is already furnished, already fighting, already
mid-build.
| This kind of game | opens badly on | opens well on |
|---|---|---|
| builder, decorator, sim | an empty plot, pieces flying in | a dressed room, a piece being dragged into place |
| shooter, action | the spawn point, the title | mid-firefight, already moving |
| puzzle, strategy | the rules screen, an empty board | a board mid-game, a move landing |
| explorer, atmosphere | the loading fade | already moving through the best-looking part of the map |
Then three beats, 20-30 seconds total, never over 45: **the hook** (the most
particular thing this game does, in motion, from the first frame), **the core
verb** (10-15 s of the thing a player actually spends their time doing), and
**one moment only this game has** (the centrifuge spinning up, night falling,
the combo landing; 5-10 s).
2. **Put everything that is merely getting ready into `setup`.** It runs before
the clip starts and is NOT filmed, so it is how you reach the moment you chose
in step 1: wait out the asset streaming, dismiss the intro modal, place three
pieces of furniture, walk to the good room, let a wave of enemies spawn. Up to
60 s of it. Without this everything you do is in the clip, which is why
previews used to open on a room assembling itself.
3. **Write it as a storyboard JSON**, in viewport pixels of the frame you will
film at - 1920x1080 by default. Coordinates are scaled if you change
`--size` later, but that scaling assumes the game's UI scales with its
viewport, and a HUD anchored to the window's edges does not: re-running an
old storyboard at a new size gives a different clip, not the same one
larger. Author at one size and stay there:
```json
{ "setup": [
{ "note": "off camera: wait out the asset load, then dress the room" },
{ "wait": 6000 }, { "click": [512, 380] },
{ "drag": [200, 300, 560, 320], "ms": 700 },
{ "drag": [200, 380, 700, 300], "ms": 700 }, { "wait": 1200 }
],
"steps": [
{ "note": "HOOK: already dragging a piece into a furnished room" },
{ "drag": [200, 340, 430, 300], "ms": 900 }, { "wait": 600 },
{ "note": "the verb: place two more, camera follows" },
{ "click": [512, 380] }, { "move": [700, 270], "ms": 800 },
{ "drag": [480, 300, 640, 300], "ms": 600 },
{ "note": "only this game: the lights come on over the finished room" },
{ "press": "KeyL" }, { "wait": 2500 }
] }
```
`setup` and `steps` take the same steps: `wait` (ms), `press` a key code (add `hold` in ms to keep it down),
`down` / `up` for a key held across other steps, `click` `[x, y]` (add `hold`
for hold-to-fire, `"button": "right"` for a right-click ability), `move`
`[x, y]` with `ms` for mouselook, `drag` `[x0, y0, x1, y1]` with `ms`,
`scroll` `[dx, dy]` with `ms` (zoom, in most games that have one - negative
dy zooms in; it is spread over `ms` so the camera moves instead of jumping),
`type` text. Steps run one after another, so "shoot while flying" is `down` Space,
then the moves, then `up` Space. `note` is for you:
say what the beat shows, so the storyboard reads as a shot list. Key codes are
DOM codes - `KeyW`, `Space`, `ArrowUp`, `Digit1`, `Equal`. If the game needs a
click or a key to start, that is the first step.
4. **Record it:**
```
node <skill>/tools/record.mjs <the bundle directory> --storyboard=<file>
```
It opens the bundle in a real browser, waits for it to boot, runs `setup` off
camera, then films `steps` into `preview.webm` at the bundle root. It also
saves a still every 1.5 seconds to a folder it names in its report.
5. **Read the report, then look at the frames.** Four fields decide whether the
take is a keeper, and `warnings` collects the ones that went wrong:
- `firstFrame` - the still a card shows the instant somebody hovers it. **Open
this one.** Apply the step 1 test to it: loading screen, empty scene or menu
means record again from a later moment, not publish.
- `opensBeforeTheGameDoes: true` - the clip's first frame still looks like the
page did the instant it loaded. This is the one that catches the mistake the
other checks cannot: a clip that opens on a loading card and cuts to the game
a second later measures as 100% moving, because the cut IS the motion, and it
spends the whole hover on the word "Loading". Start the clip later.
- `openingStillMs` - how long the clip runs before anything moves. Anything at
or over 3000 raises a warning, and the warning is right: you filmed the
runway. Move those seconds into `setup`.
- `software: true` - this machine has no usable GPU for headless Chromium, the
game ran at a few frames a second, and the clip is choppy for that reason
alone. Tell the user; a re-record on a machine with a GPU fixes it, nothing
in the storyboard will.
Then look at the frames themselves: is the camera where you meant, is anything
black, does the clip show the game or a menu? A clip parked on a title screen
passes every automatic check ever written, because a blurred animated
background behind a modal moves plenty. Only looking catches that.
6. **It refuses a clip that does not move.** Fewer than half the sampled intervals
changing, a page error, or a blank first frame all exit 1 and delete the file.
That is the gate that was missing the first time. Fix the storyboard (wrong key?
too early? the game wanted a click to start?) and record again. Two or three
takes is normal; the first is rarely the keeper.
7. **Offer the user a say.** "Want the clip to open on the boss instead?" is one
sentence, and a re-record is thirty seconds. Anyone who asks for a change to the
clip gets it: the storyboard is theirs to direct.
For a folder you did not build, read its controls first - the HUD, the README, or
ask - before you write a step. A storyboard of guesses is the blind script again.
If it exits **2**, it could not record: no browser, or the storyboard is invalid.
Publish anyway and say the world has no preview yet - a clip is worth having and
never worth blocking a publish over. Never publish a clip that was refused.
### Put the clip in front of the game too
`thrixel_publish_game(..., cold_open=True)` shows the clip and the control line OVER
the game when somebody opens its link, with a Play button that clears them. The game
loads underneath while the clip runs, so Play is instant. It is the same question the
clip answers on a card - what is this, and how do I play it - asked at the moment a
stranger actually arrives.
**Check it before you turn it on, every time.** It puts an overlay on the page, and a
game that grabs the pointer or the keyboard on load can fight it. Serve the bundle,
open it, watch the clip play, press Play, confirm the game is there and responds:
```
node <skill>/tools/serve.mjs <bundle>
```
Turn it on when you have a clip and that check passed. Leave it off otherwise - a
game nobody can start is worse than one nobody was introduced to. `cold_open=False`
takes it back off on the next publish. It shows on every load, a refresh included,
because it is the game's title screen; `?play=1` on the URL skips it outright, which
is the link to send when you mean "play this" rather than "look at this".
## Publication identity
A published game keeps one `game_id` and one URL through changes to its code,
title, version number, and build directory. Creating another publication is for
a separate game or a fork the user requested. Never use it to resolve uncertainty
about an existing game.
### Recover the destination
At the start of work on an existing game, read `.thrixel/world.json` in that game's
source root and, if present, its build output. Also check the project's existing
README or agent instructions for a published URL. Use the individual game's root
in a repository containing several games. Do not inherit a sibling game's record.
Recovering identity does not authorize deployment: local edits stay local until
the user has requested publishing or updating the published game.
Before every publish, call `thrixel_list_games()` and resolve the destination
against the signed-in account:
- **Saved ID or exact published URL:** locate that entry in the account's list.
Pass its `game_id` explicitly to `thrixel_publish_game`. If records disagree,
resolve the conflict before publishing. A build-folder record must not silently
override a different source-project record.
- **No saved identity:** compare the account's games with the project and the
user's request. Consider earlier titles, version numbers, descriptions, and
project associations. Exact title equality is insufficient: "Rally Racer 9 —
Startup Fix" and "Rally Racer 16 — Body Dynamics" may be revisions of the same
game. A shared asset project or a similar title is evidence to investigate,
not permission to overwrite a game.
- **One clearly established match:** save its identity and update that ID. Do not
ask the user for an ID you can retrieve yourself.
- **Several plausible matches:** ask which existing link should receive the
update, presenting titles and URLs. Do not choose the newest entry merely
because it is newest, create another copy, or merge/delete previous releases.
- **No match and no evidence of a previous publication:** a first publish may
omit `game_id`. If the tool requires a destination because the account has
other games, use `new_game=true` for the new game the user requested after
completing this check. When the user says this game is already published but it cannot
be found, resolve the account or missing link first.
If listing fails, is unavailable, or a saved ID is absent from the account, stop
the publish and explain the unresolved destination. Do not treat a lookup error,
an inaccessible record, or malformed JSON as proof that a new game is needed.
Continue independent local work while the destination is unresolved.
An unpublished game can be revived using the same ID when requested. A suspended
game must not be republished under a new identity to evade the suspension. If a
publish is queued or deploying, check its status before sending another upload.
### Keep the record with the source
Use the MCP client's existing record format. Preserve the actual values returned
by the tool, for example:
```json
{
"game_id": "<returned game_id>",
"slug": "<returned slug>",
"url": "https://<returned slug>.thrixel.world",
"title": "<returned title>"
}
```
Save this as `<game-source-root>/.thrixel/world.json` as soon as an upload response
provides an ID, even if deployment is pending or failed. If the tool did not yet
return a URL, use `null` until it does. This file contains no credentials. Keep it
with the source when moving or sharing the project, outside disposable build
output. In the project's existing README or agent instructions, add a short
publication note pointing to this file and stating that updates reuse its ID.
Preserve unrelated project instructions.
When the local tool exposes `source_directory`, pass the individual game's
persistent source root so it can recover and save identity outside build output.
This is especially useful for custom or nested paths such as `Builds/WebGL`.
Recent local MCP clients write a record automatically in the uploaded directory
and also its parent when the directory is named `dist`, `build`, or `out`. Verify
that the source copy exists. For custom or nested output paths such as
`Builds/WebGL`, or an older client, save the source copy yourself. Keep any output
copy consistent with the source record. The `.thrixel` directory is excluded from
the published bundle; do not copy the record into `public/` or embed it in game code.
When there is no persistent filesystem, recover identity from the account list
each session and keep the ID and URL in the project's persistent notes if available.
Do not rely on a prior conversation being available.
### Publish and retry
For updates, call `thrixel_publish_game(..., game_id="<resolved id>")` and verify
that the response refers to that same ID. Use `thrixel_update_game` only for
metadata changes such as a rename. A duplicate warning from the publish tool is
a reason to resolve the existing destination, not to bypass it.
If the response times out or fails after upload, keep the returned ID and check
the account's list. If no ID was returned, reconcile the list with the attempted
publication before retrying. Do not retry by dropping `game_id`, deleting the
record, changing the title, or setting `new_game=true`.
Use `new_game=true`, when the tool exposes it, only for a separate publication
the user explicitly requested. Omit the old `game_id` in that call. For a fork,
keep the original game's source and record separate from the fork's source and
new record so subsequent edits cannot switch the original to the fork's URL.
If the client lacks `new_game` and cannot create a separate publication without
reusing the original record or bypassing a duplicate warning, stop and explain
that the client needs updating. Do not risk overwriting the original.
## Publish
Use `thrixel_publish_game` if your Thrixel MCP server has it. **If the tool is not in your
tool list, publishing has not reached your server version yet: say the feature is rolling
out and offer the localhost URL instead. Do not attempt the REST API by hand.**
**Resolve the destination first:** follow [Publication identity](#publication-identity).
For an update, pass the recovered `game_id` explicitly as below. Omit it only for a
first publication or an explicitly requested separate copy established by that check.
`thrixel_update_game` changes metadata;
deploying changed game files uses `thrixel_publish_game` with the same `game_id`.
```
thrixel_publish_game(
directory="<the assembled bundle>",
game_id="<the existing game's id from the identity check>",
title="Order Up!",
prompt="a restaurant game where I plate dishes before the timer runs out",
tokens=184000,
controls="Arrow keys to move, Space to plate, Esc to pause",
controls_touch="Drag a dish onto a plate, tap the bell to serve",
description="A restaurant kitchen where the orders never stop and the timer always wins.",
engine="threejs",
genre="Simulation",
tags="Cooking, Fast, Arcade",
)
```
**Pass every one of these. Nothing can recover them later.**
- **`prompt`** - what they asked for, in THEIR words, not your summary of what you
built. First publish: the request the game came from. Republish: the change they
asked for this time. It exists only in this conversation; once the session ends it
is gone, and the game page has a blank where the reason should be.
- **`tokens`** - how many tokens YOU spent on this build, shown next to the prompt
above so they can see what each round of work cost. This build only, not the
session total: on a republish that is the follow-up alone.
**Only if your harness actually reports your usage. If you would have to guess,
leave it out.** It appears as a figure you reported, and a guess displayed as a
measurement is worse than the blank most games here have.
This is not what the assets cost. Thrixel bills those in cubes and already knows
the number - the page shows it on its own, from our side of the ledger.
- **`controls`** and **`controls_touch`** - one line each, and both must be what
you actually WIRED UP rather than what you meant to. `playcheck` already drove
real keys AND a real touch drag to pass this bundle, so you have tested both:
say those. A stranger who opens this from the gallery and presses the wrong
thing concludes the game is broken, which makes a wrong answer here worse than
none.
The page picks between them by POINTER TYPE, not screen size, so a phone gets
the touch line and a laptop gets the keyboard one even at the same width. Omit
`controls_touch` when the game plays the same either way - an absent line falls
back to `controls`, so leaving it out says "no difference" rather than "no
phone support".
- **`description`** - one sentence about the GAME, for somebody who has never seen
it. This is not the prompt reworded. The prompt is what they asked YOU for and it
stays on their own page; this is the blurb a stranger reads in the public gallery,
so it goes on the card there and nowhere near their request. Describe what the
game IS, not what you built or how. "A restaurant kitchen where the orders never
stop" - not "I built a restaurant game with a timer".
- **`engine`** - `threejs`, `unity` or `roblox`. You settled this before generating
anything; pass that answer.
- **`genre`** - ONE word, and it is the shelf the gallery files the game under:
`Action`, `Shooter`, `Platformer`, `Puzzle`, `Racing`, `Strategy`, `Simulation`,
`Adventure`, `Sandbox`, `Board`, `Tool`. Pick the closest one rather than the
most flattering one. Anything outside the list is dropped, so inventing
`Roguelike-lite` files the game nowhere.
- **`tags`** - up to four, comma-separated, describing what the game is LIKE:
`Cozy`, `Relaxing`, `Fast`, `Atmospheric`, `Colorful`, `Retro`, `Neon`,
`Sci-fi`, `Fantasy`, `Space`, `Steampunk`, `Underwater`, `Post-apocalyptic`,
`Arcade`, `Story`, `Short`, `Endless`, `Creative`, `Turn-based`, `Realistic`,
`Physics`, `Roguelike`, `Idle`, `Exploration`, `Collectathon`, `Builder`,
`Tower defense`, `Stunts`, `Cooking`, `Time trial`, `Party`, `Two players`,
`Multiplayer`, `Sandbox-y`, `Data`, `Experimental`.
Describe the GAME, not the technology. `3d`, `browser` and `singleplayer` are
true of almost everything published here and are ignored. Common synonyms fold
in (`scifi` and `science fiction` both become `Sci-fi`), but a word the
vocabulary does not know is **not stored** - it comes back in the response, and
resending it will not make it work. Pick the nearest listed word instead.
**You are the only one who can supply these two.** Nothing downstream can look
at a zip of compiled JavaScript and work out that it is a cozy platformer. A
game published without them sits on no shelf in the gallery and can be found
only by scrolling past everything else.
The project is attached for you - the MCP server knows which one the assets came
out of, so there is nothing to look up and nothing to pass.
It zips the directory, uploads it, waits for the deploy and returns the live URL.
As soon as a response supplies a `game_id`, preserve it in the source project's
`.thrixel/world.json` as described in Publication identity, even if deployment is
still pending or failed. Check that an update returned the expected ID and URL.
Give the user the URL as the first line of your reply - it is the thing they asked
for. A random address like `zesty-panda-14743.thrixel.world` is normal and is
theirs permanently.
<!-- first-month discount promo: remove this paragraph when the campaign ends. -->
If the publish response includes an account-specific offer, apply the budget checkpoint rules
above. Include an eligible, not-yet-shown offer in the asset-improvement discussion when it
is relevant, after the game link. Do not add a separate promotion to a completed art plan,
a publish-only request, or a handoff where the user has ruled out spending. Include the full
terms returned by the tool, including the price after the first month. Create checkout only
if the user chooses the purchase, using Pricing, checkout, and offers above.
## After the first publish
- **Updates:** recover the saved identity using [Publication identity](#publication-identity)
and republish with the same `game_id` - the link never changes, and the old
version keeps serving until the new one is fully deployed, so a failed republish never
takes a live game down. Offer this when the user makes further changes to a published game.
- **One game, one link, across sessions.** A publish records the game in
`.thrixel/world.json`. Keep a copy with the source, outside disposable build output,
and follow Publication identity when resuming the project. If the account has games
and the tool has no saved destination, choose an existing `game_id` or use
`new_game=true` for a separate game the user requested. A changed title or version
number alone does not establish a new game.
- **Unpublish** takes the game offline immediately; the address stays theirs and
republishing revives it.
- **Sharing is by link, and that is already the default.** The game's address is
public and anyone who has it can play; nothing else is needed for "just for
friends". A published game is NOT in the gallery unless somebody asked and staff
agreed, so do not call anything to keep it private - there is nothing to turn off.
- **Discovery is opt-in and reviewed.** `thrixel.com/world` is a public gallery Thrixel
curates. `thrixel_update_game(game_id=..., listed=true)` asks to be in it; staff answer,
so it goes `pending` rather than straight in. **This is the ONLY thing here that waits
on a human, and it never touches the link** - the game is playable at its own address
before the request, during it, and after a refusal.
**Offer it once, when the game is finished** - not while they are still iterating. A
natural finish line looks like: they stop asking for changes, they say it is done, or
they ask about sharing it more widely. One sentence, and if they decline do not raise
it again this session:
> Want me to submit it to the Thrixel gallery? It stays playable at the same link
> either way - this just asks to have it featured where people browse.
Do not describe the wait as blocking anything, because it does not.
# Managing published games
The user does not have to be building anything to ask about what they have already
published. Answer these directly, without touching the rest of this file.
For an update, use [Publication identity](#publication-identity) to
recover and retain the destination across sessions before calling publish.
**If these tools are not in your tool list**, publishing has not reached your Thrixel
MCP server version yet. Say so in one line, tell them upgrading the server brings it,
and stop. Do not call the REST API by hand and do not guess at what they have
published - the user's own record of their links is better than a guess.
| they ask | do this |
|---|---|
| "what have I published?" / "list my games" | `thrixel_list_games()` - returns title, status, URL and `game_id` for each |
| "what's the link for X?" | `thrixel_list_games()`, then give them the URL for X. Do not make them scroll a table for one link. |
| "take X offline" / "unpublish X" | Get the `game_id` from `thrixel_list_games()`, then `thrixel_unpublish_game(game_id=...)`. Tell them the address stays theirs and republishing revives it. |
| "take X out of the gallery" | Only if it is actually in it. `thrixel_update_game(game_id=..., listed=false)` ASKS to be taken off; staff answer, and it stays listed until they do. On a game that was never listed this is a 409, so check `thrixel_list_games()` first. The link is unaffected either way. |
| "get X featured" / "put X in the gallery" | `thrixel_update_game(game_id=..., listed=true)`. Tell them staff review it, and that the link keeps working regardless. Do not promise a timescale. |
| "rename X" | `thrixel_update_game(game_id=..., title="...")` |
| "update X with my changes" | Assemble the bundle again (rebuild it if it is a source tree), then `thrixel_publish_game(directory=..., game_id=..., prompt="<what they asked for this time>")`. Same URL, and the live version keeps serving until the new one is ready. Pass `tokens` for this round of work alone, and `controls` and `description` again only if they changed. |
Two rules for this whole set:
- **Look up the `game_id`; never ask the user for it.** They know their game by its
name, and `thrixel_list_games` maps names to ids in one free call. Asking for an
id is asking them to do your lookup.
- **Confirm before unpublishing.** It takes the game offline for everyone
immediately, and a link the user has already sent to people stops working. Name
the game and its URL and get a yes first. Renaming, relisting and republishing
need no confirmation - they are all reversible and none of them break a link.