composites
Composites
This skill carries the shared composite format reference used by other Decentraland skills (create-scene, add-3d-models, sdk-scenes).
The mandatory workflow below applies to EVERY composite you author or edit: check the Creator Hub MCP gate first, compute scene bounds (Step 0), consult the format catalog in the reference while writing entities, then run the validation gate at the end before finishing.
Gate — use the Creator Hub MCP instead of editing the file (check FIRST)
Hand-editing main.composite is the fallback, not the default. The Creator Hub exposes an MCP server (skill: creator-hub-mcp) whose tools — scene_state, create_entity, set_component, remove_entity, place_smart_item, attach_script, set_scene_settings, … — change the open scene live: the viewport updates, the editor autosaves the composite itself, inspector::Nodes and the rest of the editor bookkeeping stay consistent, and every change is undoable by the user. Editing the file instead risks the classic failure: the editor's autosave regenerates the file wholesale and your work silently vanishes.
Before touching the file, pick the first row that matches:
- Creator Hub MCP tools are available in the session (
mcp__creator-hub__*in Claude Code; barescene_state/create_entityinside the Creator Hub's own AI assistant) → do NOT editmain.composite,main.crdt, orscene.jsonby hand. Use the tools for every entity, component, and settings change. The format catalog in this skill remains your reference for component shapes —set_componenttakes the same JSON the composite stores — and Step 0 (bounds) still applies. - The Creator Hub is running but the tools are not connected → tell the user the MCP is the safer route and how to connect (
{baseDir}/../creator-hub-mcp/reference/connect.md: Settings > Experimental > Expose AI assistant MCP server, copy the snippet). Fall back to file editing only if they decline, and only with the scene closed in the Creator Hub. - No Creator Hub in play (CLI-only project, CI, the app is closed and the user wants it that way) → the file workflow below applies in full.
Step 0 — Read scene.json and Compute Bounds (MANDATORY)
Before writing a single entity position, read scene.json and calculate the scene bounds. This must happen first — all entity positions must fit within these bounds or they will not render.