# Designs

The 10 tools for designs. Before an agent first makes one, it reads guide topic design.

## create_design

Add a design to a space: a canvas of artboards (landing pages, app screens, posters…) built on a design system (tokens) and components. People select any element to restyle it, comment, and click through linked artboards. Read guide topic "design" first. Returns the files with versions and any problems found.

Parameters:
- `space_id` (string, required)
- `title` (string, required)
- `tokens` (object): tokens.json: W3C design tokens (DTCG). Omit for a neutral placeholder system.
- `components` (object[])
- `boards` (object[], required)

## read_design

Read a design as it is now, including people’s edits: the canvas (boards with size, kind, viewports), tokens.json and the CSS variables it generates, components and artboards — each file with its version for edit_design/write_design. Pass files to read only some.

Parameters:
- `item_id` (string, required)
- `files` (string[]): e.g. ["Main.html", "components/Tier.html"]

## write_design

Write whole design files in one all-or-nothing call: artboards (Name.html), components (components/Name.html) or tokens.json. Each file: path, full content (null deletes it), base_version = the version you read (null for a new file), and for a new artboard its board {w, h, kind, viewports}. The canvas follows by itself. If anyone saved a file after your version, nothing is written and the error names the files to read again. For small changes use edit_design.

Parameters:
- `item_id` (string, required)
- `files` (object[], required)

## edit_design

Change one design file in place, leaving everything else (and people’s edits) as it is. On an artboard or component: set_style (inline style properties), set_text, set_html, replace, insert (before/after/prepend/append html), remove, set_attrs, add_class/remove_class — each by CSS selector — and replace_text (exact text). On tokens.json: set_token / remove_token. Edits apply in order, all or none, against base_version. board resizes or moves the file's frame (e.g. set h to the content height render_design reported).

Parameters:
- `item_id` (string, required)
- `file` (string, required): e.g. "Main.html", "components/Tier.html", "tokens.json"
- `base_version` (integer, required): The version you read
- `edits` (object[])
- `board` (object): Where and how the file shows on the canvas. New files are placed for you; give w, h and kind.

## render_design

See a design: renders artboards in Chromium exactly as the canvas shows them and returns screenshots plus problems with selectors — things sticking out of the frame, cut-off text, frame height vs content height, broken images, fonts not loaded, small text and tap targets, and WCAG failures from axe-core (contrast ratio, alt text, names, heading order). Every frame of a page (each viewport) is checked. Tall frames come in slices; pass from_y for the rest.

Parameters:
- `item_id` (string, required)
- `boards` (string[]): Files to render; default every artboard (not components)
- `screenshots` (boolean): false = checks only (faster, no images)
- `from_y` (integer): Start the screenshot slices this far down

## find_icons

Search Lucide icon names (2,000+) for <x-icon name="…">. Query by meaning, e.g. "arrow right", "settings", "shield check".

Parameters:
- `query` (string, required)
- `limit` (integer)

## find_fonts

Google Fonts families (most popular first) to use in font tokens or font-family; any family you name loads by itself.

Parameters:
- `query` (string): Part of a family name
- `category` (string)
- `limit` (integer)

## design_history

The versions of one design file, newest first (each save makes one; the last 100 are kept): who saved it and when. Read an old one with read_design_version, bring it back with restore_design_version.

Parameters:
- `item_id` (string, required)
- `file` (string, required): e.g. "Main.html", "tokens.json"

## read_design_version

The content of one earlier version of a design file (see design_history).

Parameters:
- `item_id` (string, required)
- `file` (string, required)
- `version` (integer, required)

## restore_design_version

Bring back an earlier version of a design file: its content becomes the newest version (the current one stays in the history). base_version is the current version you read; refused if someone saved since.

Parameters:
- `item_id` (string, required)
- `file` (string, required)
- `version` (integer, required)
- `base_version` (integer, required)
