UI/UX Reference
This page holds the facts of UI/UX work. Read it to look one fact up. The story, the routes and the map are on UI/UX. The agents, hooks and files are on Agent Harness.
On this page: Scope · Routes · The agent · Size cap · Design canon · Installed skills · Definition of Done · Verification · Pipelines · For developers
What counts as user-visible work
A change is user-visible when a person will read, see or decide from its result. The language, the layer and the file extension do not matter. The canon is rules/ux/user-visible-dod.md.
| In scope | Examples |
|---|---|
A screen or its parts |
A component, style, layout, icon or animation. |
A string a person can read |
An error message, toast, banner, empty-state text, status label, button label, validation text, notification, confirmation, or operator-facing CLI output. A Java, Go or Rust handler that writes the string is still in scope. |
A failure or degraded path that reaches a person |
A 4xx or 5xx body, a maintenance reply, a retry notice, a timeout, a partial result, a permission denial. |
A payload field added to be displayed |
The wire between the two sides is part of the surface. |
A flow |
A new step or route, a changed default, a changed order. |
Out of scope: machine-to-machine payloads that no human reads, and log lines written for grep. A log line shown in a UI panel is in scope again. So is an error string forwarded verbatim to a screen. If the case is ambiguous, treat it as in scope.
The paths: glob on the rule file is a floor, not the boundary. A change in a file that the glob does not match is in scope when a person will see its result.
Where the work goes
The first question is whether the work needs new data, a new API field, logic or a new flow.
| Work | Route | Notes |
|---|---|---|
A critique of an existing screen |
|
Read-only. |
A redesign, a new screen or a new flow, as a design pass |
|
Writes a UX spec. Writes no production code. Direction options go to you. |
A presentation-only build of ONE unit on an existing screen: restyle, polish, an accessibility or motion pass |
|
|
A larger build, a redesign build, or a UI change that needs new data or a new flow |
|
|
A bug whose root cause is purely presentational |
|
A MAJOR or CRITICAL bug runs through |
A small change with no design choice: wording, a path, a one-line config |
|
A full pipeline for this costs a design pass for nothing. A small addition that follows an existing pattern goes to |
Source: the routing paragraph of deploy/templates/claude-md/main-rules.md, agents/ft-developer.md and agents/bugfix-agent.md.
The agent ft-ui-ux-design
The agent runs on opus with a one-hour cache. The brief names the mode (Mode: design | change | review), the repository and paths, the app URL and route, and what done means. If the brief names no mode, the agent infers the mode and says which mode it took.
Only Mode: and Size: are read by a script in an installed harness. price-gate.py checks Size: (see The unit size cap). The other lines are free text for the agent. Do not set a model: the agent definition runs it on opus. No installer installs delegation-gate.py. If you install it by hand, its schema also requires a writes: line for this agent.
Callers:
-
ft-developer: Stage 3 for a design, Stage 6 for presentation units. -
bugfix-agent: a purely presentational root cause. -
The main loop: a UI-only change.
-
/ft-ux-audit: a lane of the audit, inreviewmode.
The agent is not for business logic, data or API changes. Those go to the stack coding agent. The agent never reviews its own diff. The verifier lens does.
The three modes
| Mode | What it does | What it produces |
|---|---|---|
|
Drives the existing surface and runs |
A UX spec at the path in the brief, else |
|
Edits templates, markup, styles, tokens, component view code, display copy and its internationalization (i18n) keys, motion, accessibility attributes and their tests. Runs the test and lint commands of the repository until they are green. |
Edited files and component tests for every changed state. A browser check with before and after screenshots. |
|
Takes the same baseline as |
Findings in order of severity. Each finding has a |
As a lane of /ft-ux-audit, review mode reads a Lens: line and an Output dir: line from the brief. The lens replaces the owner list of canon skills. The agent writes only into the output directory and its scratch directory, and it changes nothing in the repository.
The spec of design mode lists the screens and routes, and the state matrix per element, with copy for every failure and empty state. It maps each event to a rendered state and its words. It names the existing screen for control placement, the tokens, the motion (property, duration, easing, reduced motion), the files that change and the component tests.
Limits of change mode
-
The zone is the presentation layer. A change that needs new data, a new API field, business rules, routing logic or state management is a
SCOPE_BREACH. The report names what the coding agent must add. -
The approved spec or the brief is the direction. The agent invents nothing new.
-
The agent keeps the stack and the dependencies. It never migrates a framework or a styling library.
-
Spacing comes from the spacing scale only.
-
The unit cap is about 400 changed lines or 10 files. See The unit size cap.
-
The agent never starts the app. If no URL exists, it adds a launch request to the report.
The agent edits in small steps, in this order: type, color and tokens; frame and spacing; states; then the replacement of stock components.
The browser check
In change mode the agent drives the route with agent-browser. It opens the route, takes an interactive snapshot, exercises each state and takes a screenshot of the failure state. It checks that the console is clean. It compares the result with the recorded before state at the product widths and themes. It never uses the Chrome-extension browser tools, because they drive your own browser.
Before it reports, the agent runs review-animations on a motion diff. It also runs impeccable audit and polish on its own diff. This self-review is not independent review.
The report
The report has named fields: Status (OK, NEEDS_USER, SCOPE_BREACH or BLOCKED), Mode, Routing, Spec, Files, Tests, Verification, Deviations and Bounds. It ends with a ## HANDOFF block. On NEEDS_USER you choose one of the options in the report. On SCOPE_BREACH the report names the work that a coding agent must add. On BLOCKED the report carries the question.
The unit size cap
price-gate.py checks a Mode: change dispatch from the main loop with its ux_change check. The brief needs a Size: line with the files and the changed lines, for example Size: files 6 · lines ~240. A dispatch from ft-developer or bugfix-agent is checked by the pricing checks for producers instead.
| Item | Value |
|---|---|
Target of the canon |
About 400 changed lines or 10 files. |
Denied when |
The |
Atomic form |
The denial text asks for |
A line with no numbers |
Passes. The check reads no numbers from it, for example |
Knobs |
|
Reason |
A unit far above the target grows its context without limit. That build belongs to |
The check applies only to Mode: change. A Mode: design or Mode: review dispatch passes.
Measured case: one change unit of 133 files and about 8000 lines ran to 564K tokens of context and cost $80 (evidence §73 in deploy/evals/dispatch-economy-evidence.md).
Design canon routing
The canon is rules/ux/design-skill-routing.md. The agent routes by the property in play. It does not route by the words of the task. The agent states the routing before work, as Routing: <property> → <owner>. It states no <property> for each property that the code rules out.
| Property | Owner | Skills |
|---|---|---|
Motion, transitions, animation |
Motion canon |
|
Gestures: drag, swipe, sheets, springs, momentum, interruptible transitions |
Apple canon |
|
States, accessibility, layout, UX copy, edge cases, i18n |
Structure and QA canon |
|
Visual direction for a new screen or a restyle |
Direction |
|
Restyle of an existing surface |
Audit first |
|
A whole new screen or flow, a redesign, or a UI-only change to an existing screen |
The UI/UX agent |
|
Charts, dashboards, KPI tiles |
Data display canon |
|
The module or interface behind the UI |
Design canon |
|
Throwaway exploration before you commit |
Prototype |
|
Driving the running app |
Browser canon |
|
Exploratory QA of a whole flow |
QA |
|
Anything else |
None |
|
The agent rules a property out with a grep of the code it will touch. These patterns count as evidence:
| Property | Pattern in the code |
|---|---|
Motion |
|
Gesture physics |
|
Direction |
A route or screen that did not exist before. |
Loading impeccable alone is not routing. It owns states, accessibility and copy. It does not own motion, gestures or direction.
These skills fire only on an explicit request:
-
The taste set:
bolder,quieter,delight,overdrive,colorize,typeset,layout. -
The
impeccablecommandslive,onboard,init,documentandextract. -
Every image-generation skill.
impeccable animate stays unwired, because the motion canon owns motion.
Precedence
If two canons disagree, the order is fixed. The agent never blends two canons on one property.
-
The existing design system of the product. In an enterprise UI, conformance is the direction.
-
The direction that you approved for this change.
-
The domain owner from the table above.
-
Taste skills, and only where the earlier steps leave room.
A product-taste question that stays open goes to you. The main loop asks it directly. A sub-agent returns NEEDS_USER.
The escalation ladder
Each rung costs more than the rung below. Use the smallest rung that answers the question.
| Rung | What it is | Cost | When |
|---|---|---|---|
0 |
The UI Definition of Done, inline. |
No extra model call. Minutes. |
Every user-visible change. |
1 |
Read the ONE skill that owns the property in play. |
One skill file into context. |
Before you author that property. |
2 |
An |
A few thousand tokens per snapshot. About one minute. |
Any user-visible change that renders. With nothing to render, the text artifact of the DoD replaces it. |
3 |
A read-only evaluate pass on the finished diff: |
One skill load and one pass over the diff. |
A non-trivial slice, a redesign, or authored motion. |
4 |
A verifier agent with the Visual/UX lens, or another sub-agent. |
A whole fresh context per agent, and minutes of wall clock. |
A new screen or journey, a MAJOR or CRITICAL user-visible fix, or an unsettled finding. |
Never run rung 3 or 4 on code that is still moving. Rung 4 is one pass after the code stops. Parallel agents get disjoint lenses. You may skip a rung, and you state the reason.
What the toolkit installs
The installers (deploy/scripts/install.sh and install.ps1) set up part of this set. Each step asks for consent.
| Installed by the toolkit | How |
|---|---|
|
Offered as a workflow plugin ( |
|
Offered through |
|
Offered through |
|
Offered through |
The toolkit does not install dataviz. Neither installer mentions it. If a skill is not installed, the agent reports a named degradation. It does not fall back silently to impeccable. The agent checks the installed set in the session skill listing, not in ~/.claude/skills.
The UI Definition of Done
The canon is rules/ux/user-visible-dod.md. The UI Definition of Done is an inline self-check that takes minutes. It starts no agent and loads no skill. Every user-visible change answers all 18 items before it is reported as done.
-
An item that does not apply gets one word, for example
n/a: no motion. -
An item that you could not verify gets a stated reason.
-
Silence on an item counts as a skipped test.
All 18 items
The rule file is the canon. This table names each item and its question in short form. Other documents cite the core items by name, not by number.
| Item | Group | The question |
|---|---|---|
Reachability |
Reachability and core |
Is every new message reachable from a real path? Does every path that can fail produce a message? |
Consumer contract |
Reachability and core |
Does every field for display have a consumer, and every rendered field a producer? |
The failure view |
Reachability and core |
What exactly does the person see for each failure? |
State truthfulness |
Reachability and core |
Does the screen match what happened? |
Recovery |
Reachability and core |
Does every error name a next action and a way back? |
State matrix |
States and content |
Is each state rendered, from default to success, or ruled out with a reason? |
Copy |
States and content |
Does the text say what happened and what to do next, in the voice of the product? |
Destructive and irreversible actions |
States and content |
Does the confirmation name the exact target and count? |
Keyboard and focus |
Access and form |
Does the flow work by keyboard, with focus in a sane place? |
Contrast and hit targets |
Access and form |
Is the contrast ratio computed per color pair and theme? Are targets at least 24px, or 44px on touch? |
Layout integrity |
Access and form |
Does the longest realistic string fit at the smallest viewport, in every theme? |
Readability |
Access and form |
Is the text at the base size, in the 45 to 90 character band, with line height of at least 1.4? |
Motion floor |
Visual system |
Are the transition properties exact, durations under 300ms and reduced motion honored? |
System conformance |
Visual system |
Does it use the tokens, components and patterns of the product? |
Spacing and alignment |
Visual system |
Does every gap come from the spacing scale? Do related controls share an edge? |
Control placement and order |
Visual system |
Does the primary action sit where this product already puts it? |
Seen, not read |
Visual system |
Can a person tell what happened before reading the sentence? |
Seen in a running browser |
Evidence |
Did one |
The core four
If you check only four items, check these. Other documents cite them by name, not by number.
| Core item | The question |
|---|---|
Consumer contract |
Does every field added for display have a named consumer, and every rendered field a producer? Do both sides branch on a code and not on a message text? |
The failure view |
For each failure, what exactly does the person see: title, body and next action? Nothing internal reaches the screen. |
State truthfulness |
Does the screen match what happened? Each event maps to a rendered state and its words. A refusal and a crash are different events. |
Recovery |
Does every error name the next action and a way back? Every loading state has a timeout and a view after it. |
These items cross the wire between backend and frontend. A green unit suite, a clean lint and a one-sided review miss them.
Reporting the gate
The report carries one line with its evidence. Every one of the 18 items is either met or n/a with a reason. The count covers the items that apply: with 2 n/a, the line says 16/16.
DoD: 16/16 — 2 n/a (no motion, no new colors); consumer @ <file:line>; failure copy: "<the exact sentence>"; contrast <pair> = <ratio>; screenshots at <paths>
Coding agents put the line in the Verification field. Orchestrators put it in their report.
Verification
The verifier agent runs a Visual/UX lens whenever the outcome is user-visible. The lens is part of the mandatory core. It is not the test executor. It is the only other lens that executes. It drives the app instance that the orchestrator names in a browser. It needs no worktree and runs no tests. The test executor is described in Quality Pipelines Reference, The executor and worktrees. Its model is opus.
The lens works in this order:
-
Check reachability, consumer contract, the failure view and state truthfulness statically, from the code.
-
Check that the design gates ran:
impeccable:audit,impeccable:polish,impeccable:critique. If they did not run, the verdict isNEEDS_EVIDENCE. If the skill is not installed, the lens declares a degradation and runs the DoD floor. -
Drive the running product with
agent-browser.
The browser drive covers these attacks:
-
Every state that the design brief or the fix plan names is reachable and rendered.
-
The console shows no new errors.
-
The accessibility tree labels the interactive elements. The changed flow works by keyboard.
-
Motion follows the
emil-design-engcanon. A gesture-driven flow also followsapple-design. Withprefers-reduced-motionenabled, the lens drives it again. -
The layout holds at the named breakpoints.
-
The surface conforms to the product design system and not to a generic AI kit.
-
A first-time user can finish the primary journey and one recovery path.
-
The
Routing:line holds. A property that the diff shows and the line ruled out is aREFUTED-grade miss. -
One adjacent screen or flow that the diff could have broken still works.
If the orchestrator names no app instance, the lens returns NEEDS_EVIDENCE with a launch request. It never judges from the screenshots of the author. The author’s captures are claims. The lens’s own drive is the evidence.
If the diff is user-visible only through text and no instance runs, the lens does not stop there. It delivers its findings from the code and scopes the launch request to what needs the browser.
Where UI work enters the pipelines
A design brief is the one-page design that ft-developer drafts and you approve before architecture-led code. The file is SDD.md.
| Pipeline step | What happens |
|---|---|
|
The orchestrator classifies the task as user-visible or not, by outcome and not by file type. |
|
Vague motion language from you is resolved with |
|
|
|
A presentation-only unit goes to |
|
|
|
The final report carries the |
|
A purely presentational root cause goes to |
|
A user-visible fix adds the |
For developers
| File | Role |
|---|---|
|
The agent. |
|
The trigger and the 18-item UI Definition of Done. Installed to |
|
The routing table, the escalation ladder and the precedence. Installed to |
|
The |
|
The |
|
The routing paragraph for the main loop. |
Other agents point to the two rule files. They do not copy the rules. If a restatement and the canon disagree, the restatement is the defect.