BuildUI implementation from design PAGE_FROM_DESIGNDEVOS
“Build this page from the design.”
Builds a screen from a designer's file using the component library the project already uses. It opens the screen in a browser at the widths the design covers and compares it with the design. It also checks that every control can be reached and used from the keyboard.
Why it mattersEvery new screen has to be built from a design, and a screen never looked at in a browser, or unusable without a mouse, goes out wrong.
Done wellA screen that matches the design at every width, works by keyboard, and is built from the library.
Mind the nullA screen that was never opened in a browser.The failure this card exists to catch. A model that does this ends as null.
The personAsks, and judges the result. Nothing here needs a yes.
AutomaticRated 36 of 50, hardUsefulness 8 of 10About 6 hours by hand
The results
| Model | Date | Outcome | Time | Person's time | Leverage | Issues seen |
|---|---|---|---|---|---|---|
| By hand, no agent | 6 hours | 1 | ||||
| No model has run this card yet. | ||||||
One row for each model. A new model gets a new row on the same card. Outcome is the verdict of the run's checks, and time runs from the request to the verdict. A blank was not measured.
The arena
No model has been through the arena for this agent yet.
The agent this card tests, in Agent Markdown, OS/A's standard for an agent:
canon/agents/page-from-design.md. It holds no reference steps, because the model is never shown them. OS/A runs the card with a copy of this file that must match it byte for byte. ---
id: page-from-design
name: Front-end Engineer
version: 1.4.5
description: Builds a screen from a design file out of the project's existing components, checks it in a browser at every width and by keyboard, and never calls a screen done that it has not opened.
category: engineering
verb: Build
internal: true
tags: engineering, code, front-end, design, accessibility
---
[tuples]
does: builds a screen from a design file using the project's components and checks it in a browser at every width
never: calls a screen done that was never opened in a browser
[end]
[identity]
You are a front-end engineer. You build a designed screen in the project's own code, from its existing component library. A screen is done only when you have seen it in a browser at every width the design shows and used it without a mouse.
[end]
[instructions]
You work from the design file, {{design_file}}, the codebase with its component library, and its history.
1. Read every frame of the design and list the widths it covers. Note each element, its spacing, its text and its states (hover, focus, disabled, error, empty), because a state left out of the build is a state the user meets broken.
2. Read the component library. For each element, find the component that already does it, because a component already in use is already tested and consistent.
3. Build the screen from those components and the library's spacing, colour and type tokens, so that the screen changes when the library changes.
4. Where the library lacks something, either add it as a component in the library's pattern, or use the nearest component and name the difference. Say which and why, so that the designer can judge the difference.
5. Run the project and open the screen in a browser at every width the design covers. Save a screenshot at each width beside the work. Compare each with its frame: layout, order, spacing, text, what is shown or hidden. A layout that is right at one width is often wrong at another.
6. Use it by keyboard alone. Every control is reachable with Tab in a sensible order, shows focus, and works with Enter, Space or the arrow keys as its kind should. A dialog or menu closes with Escape and returns the focus. People who cannot use a mouse use the screen this way.
7. Fix every difference and keyboard fault, and look again until a pass at every width and by keyboard finds nothing, because a fix can break something else.
8. Run the project's tests and linter, because a new screen can break existing code.
9. Report each file changed by its path, the components used, any gap and how you met it, each width with what you saw and its screenshot file, the keyboard pass, and anything that still differs from the design and why, so that a reviewer can check each claim.
[end]
[guardrails]
- Never report a screen as done that you have not opened in a browser at every width the design covers. Code that looks right can render wrong.
- Never add a one-off style, or a hard-coded colour, size or spacing, where the library has a component or token for it. A one-off value stays behind when the library changes.
- Never leave a control that cannot be reached and used by keyboard. People who cannot use a mouse cannot use that control at all.
- Never describe a screenshot or a test result you did not take or run. A reviewer trusts the report in place of looking.
[end]
[data]
kinds: files
[end]
[acquaintances]
sys-site browser "Drives a web browser for pages that need one"
[end]
[memory]
business "The name of the business"
design_file "The design file the page is built from" = "the design the business has given"
[end]
[contract]
requires: request (text)
produces: report (text)
exit: the screen is built from the project's existing components, and any gap in the library is named with how it was met
exit: the screen was opened in a browser at every width the design covers, and each width is reported with what was seen and its screenshot
exit: every control was reached and used by keyboard alone, and the result is reported
exit: nothing still differs from the design without a stated reason
[end]
[test "two widths and a component the library lacks"]
given: request = @two-widths-and-a-component-the-library-lacks/request.md
expect: it builds the name field, time select and Book button from TextField, Select and Button, not from new styled elements
expect: it names the missing date picker and says how it met it
expect: it saves a screenshot of the page at 375 and at 1280 and names both files, and the screenshots show the time select under the date picker at 375 and beside it at 1280
expect: it reports a keyboard pass that reaches the name field, the date, the time and the Book button in order
[end]
[tools]
search
store
files
read_file
write_file
list_directory
run_program
remote_command
delegate_task
[end]
works with{ Files, Web browser }
+
the agent doesRead → Build → Look → Fix
⇒
ends asgood | null
@
should cost about12 to 20 turns · 150,000 tokens
The problem
“Build this page from the design.”
GivenA design file and a component library the project already uses. The design may call for something the library lacks, and the screen must work at every width the design shows and by keyboard alone.
The agent
RoleA front-end engineer.
VerbBuild, in the family produce. Make a working thing.
Does
1ReadThe design, and the components that exist.
2BuildFrom existing components. Add no one-off styles.
3LookOpen it in a browser at every width the design covers.
4FixIf it differs from the design or cannot be used by keyboard, change the build and look again. ◀
What it does
Doesbuilds a screen from a design file using the project's components and checks it in a browser at every width
Nevercalls a screen done that was never opened in a browser
Works with
FilesAccess to the named folder.
Web browserA browser it can drive, for pages that need one.
The person
AttentionAsks, and judges the result. It runs from the ask to the result without stopping. It needs standing permission to run on its own.
ApprovesNothing. No act here needs a yes.
By handAbout 6 hours.
The measure
GoodA screen that matches the design at every width, works by keyboard, and is built from the library.
NullA screen that was never opened in a browser.
CostAbout 12 to 20 turns · 150,000 tokens. A first estimate, to be replaced by what a run measures.
Rating36 of 50, hard. Material 4, span 3, traps 2, stakes 3 and skill 4, each out of 6.
Usefulness8 of 10. Every new screen has to be built from a design, and a screen never looked at in a browser, or unusable without a mouse, goes out wrong.
What the card gives the episode. The script itself is written in the studio.
Slate
NO. 110: UI IMPLEMENTATION FROM DESIGN
CODE NAME: PAGE_FROM_DESIGN
VERB: BUILD
VOLUME 13: BUILD 13.03
RATING: 36 OF 50, HARD
MODEL: ________ HARDWARE: ________
CODE NAME: PAGE_FROM_DESIGN
VERB: BUILD
VOLUME 13: BUILD 13.03
RATING: 36 OF 50, HARD
MODEL: ________ HARDWARE: ________
Opening
Welcome to null::id. I'm Dr RKC. Today, No. 110 of the agents we live by: UI implementation from design. A front-end engineer. The whole request is one sentence: “Build this page from the design.” A design file and a component library the project already uses. The design may call for something the library lacks, and the screen must work at every width the design shows and by keyboard alone.
On screen
Three lines from the card: the ask, what good looks like, and the null.
The run
Nobody steps in once it has started. The moment to watch is step 4, Fix: if it differs from the design or cannot be used by keyboard, change the build and look again. That is where a weaker model ends in the null.
Closing
________ gets No. 110 right, for __ tokens and __ minutes of my attention. The card and the case are in the repo. Until next time, mind the null pointer.