Skip to content

reconcile_direction

Read a direction's hero reference into build tokens, a builder brief, the kept references and the board's draft room, and save the board palette on the direction. Call it before each draft and before export_kit.

Plan Quota Changes data Hints
All None Yes: saves the palette, contrast and mood on the direction, and rewrites its spec’s color line idempotent, open world, not destructive

Your agent calls it once per direction before a draft, and before export_kit (which also runs it itself for a kept direction whose board changed since its last run). It reads up to 12 of the direction’s placed images (in the board palette, images rated great weigh three times as much) in memory from the allowed image hosts, then drops them. Each image is first cut to its product screen, so a presentation backdrop or a phone’s bezel never sets the colors; when no screen is found inside it, the solid block inside a smooth backdrop band (a plain colour or soft gradient around the shot on three sides) is read instead, so a phone on a grey gradient never reads as a grey ground; a page with a sidebar or header running edge to edge is never cut this way (see extract_palette).

It answers with:

  • Build tokens read from the direction’s hero reference: colors (the ground is the flat colour covering most of the product screen, its edges counted twice, so a gradient glow never sets it; when a big panel and the main canvas differ, such as a white side rail beside a black map, the ground is the larger product area; a large flat panel of another tone that holds text, such as that white rail, is surface-2 with its own ink on-surface-2, checked at 4.5:1 and named in the brief’s look line; on a web page hero that scrolls, the ground is its first screen’s own flat ground when it has one, and the page’s ground becomes the second ground; the ink is the text colour, read from text strokes that reach 4.5:1 on the ground, and on a one-ink hero, whose text and line work are drawn in one saturated colour such as cobalt, that colour is the ink and never an accent; the accent is the most used saturated hue, a small button or map pin included, and a control’s colour (a button, a chip or a progress bar, even a muted green one) comes before a colour seen only in a photo, and tokens.accents lists every accent the hero holds, most used first), type, radius, density, depth, imagery, the viewports to render at, the one language, and a ready <head> (tokens.starterHead; it also writes the shadcn variable names, --background, --foreground, --card, --primary, --muted, --accent, --border, --ring, --radius and their pairs, from the same engine as the design system, so a draft and your app share one set of names; --radius stops at 32px and --brand appears only when --primary had to move from the brand to pass 4.5:1). tokensFile holds them as one compact JSON line: your agent writes it to tokens.json verbatim, in one write, and the check scripts read that file. It carries the hero’s typeScale at the top level when it is known.
  • Type on a slide, social post, logo or brand identity board comes from the hero’s own record, in this order: its craftSpec, its board note, then its title’s serif, sans, condensed or wide words (never a title’s other words, so a set titled “calligraphy” is not read as a script face), then your taste words with the direction’s type words. A serif named there is never overridden by a generic sans word, unless that sans is tied to display or headline words. A serif tied to a figure word in the same clause (“clean sans layout, a high-contrast serif figure”) sets tokens.typeClass.figure; when the display class is no serif, tokens.fonts.figure names a display serif face for the figures, the starter <head> loads it and writes --font-figure, and the reply’s Fonts line says “figures in (–font-figure), as the hero sets them”. Set the big number in var(--font-figure).
  • A taste accent on a slide, social post, logo or brand identity board (round 5): when one of your first five taste words names a mood (festive, celebratory, vibrant, playful, a bold colour word) and the hero’s colours are all near neutral, the tokens add one accent, tokens.colors.accent-taste, from the board’s own colours when one has the mood’s saturation and lightness, else a named colour for the mood, never one a must-keep rules out. The conflicts say so: “The hero is neutral; your ranked word “festive” adds one accent: #c8102e.” Use it on one element per artboard, never body text. On an Arabic only static board the figures are set in the Arabic display face (tokens.fonts.figure), and a light hero loads its 300 weight on the display faces, the Arabic one included. A social post’s floors are 47px body, 50px Arabic body and 42px for labels and data on the 1080 frame, as seen 368 wide in the Artifact.
  • A builder brief of 12 lines at most, to paste into the build as is: the hero whose look leads, its look, the layout (composed for the job from the hero, the kept references’ parts and the direction’s skeleton, never one reference’s page), a Parts: line naming each part reference (“Parts: list rows from “Pricing grid” (ref_3m7k). Each adds that part to the layout, redrawn in the hero’s palette and type, never its whole page.“), the mechanic, the language and the floor.
  • The kept references, hero first, at most 30, each with its source link and image link, and its part when it was kept with one (see rate_references). A draft starts from this list instead of reading the whole board.
  • Draft room: how many draft screenshots the board still holds (48 per board, one per draft, two for a landing page).
  • Conflicts where the hero’s look differs from the direction’s own words (the direction’s ground, light or dark, decides which ground its words ask for; a tone word that colours a part, like “black outlines” or “white text”, is not a ground), or where the hero image could not be read. A colour line counts the hero’s own accent colours as on the board, so it never says a hue is missing from the board while the tokens take that hue from the hero; a hue the hero lacks is still named. The agent tells you about each one.

The hero must be hero tier, a curated reference picked with search_references and heroes: true. Any other hero is flagged: the tokens are still read from it, and the reply says to pick a hero-tier hero before a draft.

Name Type Required Limits What it does
canvasId string Yes 1 to 100 characters The board
directionId string Yes 1 to 100 characters A direction id from get_canvas or bend_brief
page string No 1 to 80 characters The page to build, like review inbox or overview. Left out: taken from the direction’s stored pages
platform enum No desktop, mobile, responsive The platform to build for. Left out: inferred, and the reply says so
{
"name": "reconcile_direction",
"arguments": {
"canvasId": "c3f1a0d2-6b1e-4d8a-9f4b-0a1b2c3d4e5f",
"directionId": "bd-mob5pq35",
"page": "trip overview",
"platform": "mobile"
}
}

Trimmed: the real reply goes on with the full kept list, the builder brief and the tokens file on one line.

Reconciled "Fare as a cereal box" with its board: 5 of 5 placed images read.
Palette: the hero's, the same as the tokens below (the board's own colours are saved for exports and parts).
Built for page "trip overview", platform mobile, rendered at 390x844 (tokens.viewports).
Kept references (4), hero first, in place of the full get_canvas (get_canvas summary: true still gives the board's other drafts). Each note is a caption; the image is the source.
- ref_8k2p "Ride summary" https://example.com/shot/123 [hero, craft]
- ref_3m7k "Pricing grid" https://example.com/shot/456 part "list rows"
...
Room on the board: 47 more screenshots of 48 (a screen draft takes 1, a landing page 2: its 390 and 1440 shots).
Builder brief (paste it into the build as is):
...
Web link: https://gobanana.fun/c/c3f1a0d2-…

structuredContent is shorter than the text, each thing once: notes, canvasId, directionId, builderBrief, tokensFile, kept (with part) and room ({ shots, drafts, max }, or null when screenshot storage cannot be read), plus keptMore, inferred, heroNotTier and heroReplaced when they apply. notes holds the reply’s own lines (the direction’s title, the conflicts, images that could not be read, the room) and names builderBrief, kept and tokensFile instead of repeating them, with no code fence, for clients such as Claude Code that show the agent the structured result only. The full tokens object and the saved palette are not in the reply: tokensFile is the tokens file itself, a JSON object (not a string), so one Write copies it to tokens.json as it reads, and the palette, contrast and mood are saved on the direction, where get_canvas and export_kit read them.

Message Meaning
“Pass a canvasId and a directionId.” Both are required
“This canvas has no direction with that id. Call get_canvas to see the direction ids.” Use a direction id of this board
“The hero … is not a hero-tier reference. Pick a hero-tier hero first: search_references { heroes: true, directionId: “…” }, rate one with hero: true, then run reconcile_direction again before a draft. …” The tokens are read from it for now; pick a curated hero before drafting
“No colors could be read from this direction’s images, so the spec color line is unchanged; …” Place images from allowed hosts and run it again
“Only 2 images are placed for this direction; 3 or more give a steadier palette.” Not an error; more images give steadier colors
“The board is full: 48 of 48 draft screenshots used. Tell the user before building, so they can pick another canvas.” No room for another draft screenshot on this board

How the draft uses all this: see Drafts.