ui-from-reference
Skill1 starsChanged 35 days agoMITView on GitHub
Build or change web UI by translating the project's approved reference screens and design tokens into components, then checking screenshots against the references side by side. Use for any ticket that touches screens, components or styles in a repo that has docs/design/README.md.
In this repository14 other files it gives its agents.
- skills/setup-project/templates/AGENTS.mdAGENTS.md
- grill-meSkill
- addressSkill
- conventional-commitsSkill
- design-packageSkill
- doneSkill
- implementSkill
- preview-prSkill
- researchSkill
- setup-projectSkill
- stop-previewSkill
- takeSkill
- ticketsSkill
- visual-notesSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Add a UI library, font or icon set the contract doesn't list.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UI from reference
You translate; you don't design. The project's design contract is docs/design/README.md: tokens, the component inventory, the screen list and the rules. If the screen or state you need has no reference in docs/design/screens/, stop and ask for one instead of inventing it.
Steps
- Read
docs/design/README.mdand only the screen files the ticket names. Skip_ref.css. - Map each element to a component from the inventory. If the reference marks elements with
data-component="Name"(anddata-variant,data-size,data-state), each marked element is that component with those props. Search the components folder first and reuse what exists. Create a component only if the inventory lists it; give it typed props and no data fetching. - Copy classes. If the contract says the references use the app's own Tailwind classes, copy each class string verbatim into the component; don't retype, reorder or "improve" it. Otherwise style only through the contract's tokens. Either way: no hex values, no arbitrary values (
w-[13px],text-[#abc]) unless the contract allows them. - States. Implement every state the reference shows. For a state it doesn't show (empty, loading, error, disabled), use the contract's default pattern.
- Preview. Each screen renders with fixture data at the contract's preview route, with no sign-in or backend needed. Presentational screen components take props; the page container loads data.
- Compare. Run
just run(returns at once if the app is already running), thenjust shots <screen-id>saves the preview and the reference at phone and desktop widths, in light and dark, and writes.shots/compare.html. If you can view images, compare them; otherwise ask the human to opencompare.html. Fix layout, spacing, type and colour differences; ignore placeholder art. - Accessibility. Clickable things are buttons or links with a visible focus ring; inputs have labels; motion respects
prefers-reduced-motion.
Don't
- Restyle anything outside the ticket.
- Add a UI library, font or icon set the contract doesn't list.
- Change tokens, references or
_ref.css. Propose changes in your report instead.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

