Skip to content
/ Lonca
Documentation contents

Orchestration

Figma UI step

Components built from a linked Figma selection, each checked against the Figma render, then wired to data.

PlansFreeStandardProTeam

A task whose issue links a Figma selection gets a UI step before implementation. The UI implementer builds the presentational components from the design, with the repository's own structure, design tokens and component library, and Lonca checks each one against the Figma render in its own browser. Screens behind a sign-in are shown in a small preview kit Lonca keeps per repository, outside the pull request. The implementer then wires the components to real data without changing how they look. The Figma token stays in Lonca; agents never see it.

What a task needs for the UI step

A task is split into a UI step and an implementation step when all three hold:

  1. its repository has figma: true;
  2. a Figma token is saved under Settings → Figma;
  3. its issue, its parent story or its brief links one or more Figma selections.

Otherwise the task runs exactly as before. A task with Figma links and no token runs without the step, with a notice that says why. The UI step is in the Pro and Team plans. Until plans are enforced everyone runs as Pro, so nothing is locked. Once plans start, a repository marked for Figma runs its tasks without the step on Free and Standard, and Settings → Plan says so. See Plans.

The Figma token

Settings → Figma takes a Figma personal access token with read access to the files you design in. Lonca uses it only to read designs.

  • Paste it into Figma personal access token and press Save. Test token asks Figma who it belongs to and says Connected as …. Clear removes it.
  • It is encrypted with the macOS Keychain and kept beside config.yaml, never in it. Settings only ever learns whether one is saved.
  • It never reaches an agent: no environment variable, prompt, command line, settings file, or file in a worktree or context directory. The UI implementer reaches Figma only through Lonca, which holds the token.
  • The Configurator cannot change it.

Marking a repository

config.yaml
repos:
  - path: ~/Projects/sales-mfe
    figma: true      # default: false; leave it out for a backend repository

The Configurator sets figma: true for a repository with a browser UI: a package.json that depends on react, vue, svelte, @angular/core or solid-js, plus a bundler such as vite, next, webpack or parcel. The value must be true or false; anything else fails to load.

Copy a link with Figma's Copy link to selection. Lonca reads the links from the issue text of the task and of its parent story:

  • the description, the comments and the web links;
  • a Jira smart link, in any of its views (inline, card or embed).

A link must name a selection (its node-id): a link to a whole file is not used. Past 20 links the rest are left out.

The links are read whenever the issue is: when the task is set up and when you Refresh it. A link added to Jira after the hand-off counts from the next refresh.

Links in the brief

The task's brief may name Figma selections of its own. When it does, they take the place of the issue's and the story's: only the brief's are inspected, and the issue's come back once the brief names none. They count as soon as the brief is saved, and because the links changed, the task's next implementation round starts at the UI step again. This is how you replace a wrong selection, or give a task a design mid-way: tell the task lead, and save the brief it proposes.

The UI step

The step is implement/ui, the first part of the Implement stage. The UI implementer is a terminal stage agent, like the implementer, on opus by default (see Configuration).

  1. Lonca prepares. It inspects every linked selection in turn: the node tree, variant states, design-system marks, visual assets, and a render. It copies the preview kit into the worktree and checks the kit's health, without an agent.
  2. The UI implementer builds. It builds the presentational components from the design, using the repository's own structure, token layer and component library, and checks each one against the Figma render.
  3. Lonca checks the end of the run (see below). After a pass, the kit and the repository's design notes are saved back for its next UI task.
  4. The implementer wires. In implement, the implementer connects the components to real data, routes and state, without changing how they look.

Test, review, the gate and the pull request then go as for any task. Every terminal stage agent's settings deny edits to the task's own issue file and to Lonca's Figma state, for every task. The UI implementer reaches Figma only through Lonca's commands, and only while its step runs.

Checks against the render

A visual check renders the component in Lonca's own browser, on the running preview, and compares it against Lonca's copy of the Figma render. Lonca records every check itself, bound to the code as it was when the check ran.

  • The UI step passes only when each component has a check that passed on the code as the agent left it, or an explanation in the agent's report: a row in its ## Visual checks table marked explained or skipped, with a reason. A row that only says pass counts for nothing.
  • Otherwise the agent tries once more, and then you are asked.
  • The check is text in the UI implementer's terminal and the Visual checks table in its report; there is no separate check panel.

The preview kit

The preview kit is how a screen behind a login is checked: a minimal page per component, with the global stylesheet, the theme or provider, and the component with mock props. It never includes the app's router, sign-in or shell. The repository's own bundler serves it.

  • It is not in the pull request. Lonca keeps the kit per repository in its own state, copies it into each UI task's worktree hidden from git, and removes it again when the task leaves the step, passed or not.
  • The first UI task builds it. Later tasks only add a small fixture for their component. The agent repairs the kit only when the health check says it is broken.
  • Work is not lost. A kit not yet saved is kept for the task until it comes back to the step. The preview stops when the step ends: a pass, a question, a pause, a move. A retry of the same step keeps it running.

Approving the preview command

The kit runs the repository's own serve command, and the bundler's config runs code, so you approve it once in a system dialog when the UI implementer first starts the preview. Show files in the dialog opens the kit's folder.

  • It asks again when the command, or any shell file of the kit, changes. A repository keeps its last five approved shells.
  • The approval is kept encrypted, out of the Configurator's reach.
  • A command you refuse is not asked about again for the same kit in that task's same run. Once the run ends (a question, a pause, a move) the next start asks again, and other tasks are asked as usual.

When Figma gives none of the designs

When Lonca gets none of the task's designs from Figma, the UI step stops with a question that says why, in Figma's own words. A token that cannot read the file, a wrong or deleted node, or a render Figma could not make all end here. For a render, it also says what the node shows: hidden, no size, or a frame too large to render. A render that fails at 2x is tried at 1x first. You can:

Try again
Reads the same links again. A Figma link written in your answer is not read.
Fix the token
Save one that can read these files under Settings → Figma, then try again.
Another selection
Add its link to the task’s brief first, then try again: the brief’s links take the place of the issue’s.
Move the task to Implement
Goes on without the UI step.

A saved token Lonca cannot read is a question too, saying how to go on.

Configuration

config.yaml
orchestration:
  stage_agents:
    ui_implementer: { agent: claude-stage, model: opus }   # optional
  stage_timeout_minutes:
    ui_implementer: 90                                     # default 90; 1–480
  • ui_implementer is written like the implementer (agent, model, prompt_file, effort) and held to the same rules for its agent's command. Absent, it runs on the implementer's agent at effort high, on opus when that agent is Claude Code and on the implementer's model otherwise. It may run on Claude Code or Codex.
  • Its time limit is stage_timeout_minutes.ui_implementer, 90 minutes by default: it builds a component and checks it against the render. Under consultant or autopilot, one still working and not looping gets more time.
  • Settings → Orchestration shows its model and effort once the config has it. See Stage agents.

A task that holds the UI step keeps it after a move to a smaller plan. See Moving to a smaller plan.