Loora Design Guide
Create real, editable Loora designs through the MCP tools. Treat the Canvas document—not generated code—as the source of truth. Work like a designer: understand the product, establish a system, build coherent sections, inspect the render, and refine the weak parts.
Gate the MCP surface first
Inspect the callable Loora tools before creating or mutating anything. Require:
createPage,insertNodes, andpatchNodesfor new design authoringcreateComponentandcreateInstancefor reusable component worksetTokensfor tokens or themessetAnimationsandanimateNodesfor motion- branch lifecycle tools for branch work
If a required tool is absent, stop before createDesign or any partial mutation.
createDesign creates only an empty record; it is not a successful Canvas
design. Report the missing tools and the manifest/session mismatch. Do not
substitute HTML, JSX, browser clicks, or repeated speculative calls.
If a callable tool exposes nested arguments such as ref, nodes, or patch
as unknown, treat that as a schema-display limitation, not permission to
guess. Use the schema reference below.
Load references by action
| Before this action | Read first | Read as well when applicable |
|---|---|---|
| Select a design, target Main, create/use a branch, compare, propose, or apply | tool-workflows.md | worked-examples.md for branch theming or merge payloads |
Call createPage, insertNodes, patchNodes, component, token, interaction, or motion tools |
mcp-schema.md | worked-examples.md for a known-good envelope |
| Compose responsive layout, components, themes, interactions, or motion | canvas-authoring.md | design-craft.md for new or materially restyled work |
| Review pixels with image vision | design-craft.md | tool-workflows.md for screenshot limits |
| Verify without image vision | tool-workflows.md | mcp-schema.md to verify effective fields and collection semantics |
For a one-field text or spacing patch, read mcp-schema.md plus the target node;
do not load every design reference.
Follow the core loop
- Check capability and orient. Confirm the required authoring tools are
callable. Call
getUsageif budget matters. CalllistDesigns, select the target explicitly, then callgetDesignContext. For an existing design, inspect the relevant area withreadTree,readNode, orsearchNodes. - Protect the target. Confirm whether the user intends Main or a branch.
Carry the same
designIdand optionaldraftIdthrough every call. For a broad or speculative redesign, prefer a new branch. Never silently switch targets. - Form a visual direction. Extract the audience, job, content hierarchy, mood, constraints, and required states from the request. If the prompt is underspecified, choose a coherent direction and state it briefly; do not default to a generic dashboard.
- Establish the system. Reuse existing tokens, themes, components, spacing, and typography. For a new design, define a small token set and reusable components before repeating them. Use semantic, human-readable node names.
- Build in meaningful batches. Use
createPagefor the Page and its initial hierarchy. UseinsertNodesfor later sections,patchNodesfor atomic refinements, andmoveNodesfor source structure. Prefer flex/grid withfillandhug; reserve absolute positioning for intentional overlays or artwork. - Inspect after meaningful edits. Call
getScreenshoton the affected Page or node. With image vision, compare the pixels against the brief anddesign-craft.md. Without image vision, use the renderer result plusreadTree/readNodeas described intool-workflows.mdand state that pixel quality was not visually judged. A successful mutation alone is not proof. - Refine surgically. Fix the largest verified problem first. With vision, use visible hierarchy, spacing, contrast, alignment, content, and responsive behavior. Without vision, fix only structural issues supported by reads or renderer metadata; do not invent pixel problems.
- Verify structure. Re-read the affected tree or nodes. Confirm component
instances, interactions, token references, responsive overrides, and target
revision. Use
viewPageorviewNodefor a canonical Loora link. - Finish deliberately. If working on a branch, compare it with Main before
proposing or applying it. Do not apply, close, or delete anything without the
user's authority. Use
exportCodeonly when the user needs a one-way implementation artifact.
Preserve Canvas semantics
- Send structured nodes and fields. Never insert HTML, JSX, Tailwind classes, arbitrary CSS, or code nodes.
- Keep the three schema layers separate: the outer tool envelope, a NodeRef or descriptor locator, and the typed field value. Never move fields between those layers.
- Keep IDs distinct:
designIdselects a design,draftIdselects a branch,pageIdselects a Page,componentIdselects a component, a NodeRef selects an existing node, and descriptorrefis only a temporary label. - Use temporary descriptor
refvalues only inside a single create/insert payload. Save the permanent IDs returned inrefsfor later calls. - Use the exact NodeRef returned by
readTreefor component descendants.instancePathis meaningful; do not replace it with an empty array. - Edit a component source to change all instances. Patch an instance descendant only for a deliberate visual or content override. Do not structurally insert inside an instance.
- Use Page or component state definitions plus declarative interactions for behavior. Do not simulate application state with hidden duplicate trees when a typed state and action expresses it.
- Use tokens for repeated colors, numbers, and fonts. Use components for repeated structures with shared identity, not merely because two rectangles look similar.
- Set
modeon every container that will lay out children. A frame may flow within its parent while still defaulting its own children to absolute positioning. - Read before patching collection fields. Preserve existing Page/component states, interactions, animation lists, and an existing patch for the same breakpoint unless replacement is intentional.
- Keep motion restrained and purposeful. Prefer the provided presets. Always judge the static composition before animating it.
- Treat
deleteNodes,deleteDesign, andcloseBranchas destructive. Obtain explicit confirmation, then pass the requiredconfirmed: true.
Work efficiently
- Start with one context call, not a chain of broad reads.
- Read only the subtree being changed. Use
searchNodesto locate known copy or names. - Create a whole coherent section in one nested payload, but split very large pages by section so errors and refinements stay local.
- Batch independent node patches into one
patchNodescall. - Use
getScreenshotat useful milestones, not after every field. - Inspect at the Page's intended desktop width and at least one narrow width when responsive behavior matters.
- Report what changed, which target was used, whether verification was visual or structural, and any remaining uncertainty. Include the returned Loora URL when useful.
Handle failure without thrashing
- On schema rejection, read the error path from the outer envelope inward, then
compare it with
mcp-schema.mdand the live tool schema. Correct one coherent payload; do not retry variants at random. - If mutation tools disappear from the callable surface, stop. Do not create an empty design and hope later calls become available.
- On an invalid or stale ID, re-read the nearest tree and use returned IDs.
- On a locked node, stop and tell the user unless unlocking it is clearly part of the request.
- On a read-only branch, inspect its status. Reopen a proposed branch only when the user wants further edits.
- On merge revision drift, call
compareBranchagain. Never reuse stale revisions or guess conflict resolutions. - On
CANVAS_UNAVAILABLE, explain that the legacy design is unsupported; do not attempt to reconstruct or overwrite it. - On screenshot failure, preserve the successful structured edit, inspect the reported error or skipped images, and be explicit that visual verification is incomplete.
- On usage or plan limits, stop repeated calls and report the exact returned code and remaining work.