The .nibs format
Rules agents must respect when editing through batch_edit (from the Nib MCP guide).
batch_edit
Applies all operations atomically and saves the document. If any operation is invalid, none are applied.
{
"ops": [
{
"op": "insert",
"parentId": null,
"node": {
"id": "hero1",
"type": "frame",
"name": "Launch Hero",
"x": 0,
"y": 0,
"width": 1440,
"height": 900,
"layout": "column",
"padding": 80,
"gap": 24,
"fill": "$surface",
"children": []
}
},
{
"op": "insert",
"parentId": "hero1",
"node": {
"id": "title",
"type": "text",
"content": "Designed with intent.",
"font": "Newsreader",
"size": 88,
"weight": 600,
"color": "$text"
}
}
]
}
Supported operations:
insert:{ op, parentId, index?, node }. UseparentId: nullfor a top-level node.update:{ op, id, props }. Properties are shallow-merged and revalidated.delete:{ op, id }. Deletes the node and its subtree.move:{ op, id, parentId, index? }. UseparentId: nullto move to the document root.set_variable:{ op, name, value }.
Important schema rules:
- Every node ID is exactly five characters using letters, digits,
_, or-. - Top-level nodes require
xandy. - Nested nodes must not have
xory; they use their parent frame’s row/column layout. - Node types are
frame,text,rect,ellipse,image, andsvg. - Width and height accept numbers,
fill, orhugwhere applicable. - Variables are referenced as
$nameand may contain light/dark values. - Fills support colors, variables, solid fills, linear/radial gradients, and images.
Document model (summary)
- Every node
idis exactly five characters: letters, digits,_, or-. - Top-level nodes require
xandy. - Nested nodes must not have
xory; they follow the parent frame row/column layout. - Types:
frame,text,rect,ellipse,image,svg. - Width and height: numbers,
fill, orhugwhere applicable. - Variables:
$name, optional light/dark values. - Fills: solid, linear/radial gradients, images.
Do not edit .nibs on disk while Nib has the file open — use MCP tools.