Rosemary, a machine-readable design system
- client
- This site
- years
- 2026
- categories
- [systems] [ai]
- role
- Everything, from the tokens and components to the agent guidance and the eval
- access
- open
- markdown
- /ai/showcase/rosemary.md
- human
- /rosemary
- tokens
- /rosemary/tokens.json
## project
Rosemary is the design system this site is built on. I wrote it for the people and the AI agents who build with it, then measured whether the agents follow it.
## evidence
- guidance
- The project's agent instructions tell Claude which tokens, text styles, motion, layers and components to use, and what to do when something is missing.
- check
- A script flags any color, font size, spacing, radius, motion or z-index value that bypasses a token, and the site will not build until every one is fixed.
- eval
- I gave Claude 9 everyday requests, such as a filter, a dialog and a newsletter sign-up. Each one was built by a fresh Claude agent in its own copy of the site, once with the Rosemary guidance removed and once with it in place.
- result
- Off-system values fell from 6.3 to 0.0 per 100 CSS declarations. The agent used the right Rosemary component in 27 of 27 runs with the guidance and 9 of 27 without it. The site still built after 27 of 27 runs with the guidance and 26 of 27 without it.
- motion
- Three durations in ms (quick 150, settle 350, slow 700), three easings (out, spring, in-out) and one 80 ms stagger, all as variables. Every transition on the site uses them, and the check flags a literal duration or easing.
- illustration
- Drawings follow five rules: one ink (--il-line at 1.5px), one hard shadow, 21 --il-* color roles, one 100 by 100 box with the ground line at y = 96, and hover as light plus one small movement per object.
- icons
- 22 Phosphor icons (MIT, version 2.1.1) at 16, 20 and 24px. The weight follows the text beside the icon: bold at 16px, regular at 20px, regular at 24px. Rosemary has no custom icon set.
- method
- Each task ran three times in each version with Claude Sonnet, and the same check scored both. I dropped a tenth task because the site already did what it asked. I built the eval with Claude Code.
## results by task
- Newsletter sign-up
- Request: "Add a small newsletter sign-up to the site footer: an email field and a Subscribe button. It does not need to submit anywhere yet." Without the guidance: 0 values outside the system in 22 declarations, and the expected Rosemary component in 3 of 3 runs. With the guidance: 0 in 19, and the component in 3 of 3.
- Open to work banner
- Request: "Add a banner at the top of the homepage that says I'm open to senior product design roles, with a link to the About page and a button to dismiss it." Without the guidance: 1 values outside the system in 28 declarations, and the expected Rosemary component in 2 of 3 runs. With the guidance: 0 in 47, and the component in 3 of 3.
- Back to top button
- Request: "Add a back-to-top button that appears in the bottom right corner once a visitor has scrolled down a long page, and scrolls smoothly to the top when clicked." Without the guidance: 0 values outside the system in 56 declarations, and the expected Rosemary component in 1 of 3 runs. With the guidance: 0 in 36, and the component in 3 of 3.
- Writing filter
- Request: "On the Writing & talks page, add a way to show only talks, only articles, or everything." Without the guidance: 3 values outside the system in 50 declarations, and the expected Rosemary component in 3 of 3 runs. With the guidance: 0 in 5, and the component in 3 of 3.
- Colleague quotes
- Request: "Add a section to the About page with three short quotes from colleagues, each with a name and role. Use placeholder text for now." Without the guidance: 0 values outside the system in 51 declarations, and the expected Rosemary component in 0 of 3 runs. With the guidance: 0 in 9, and the component in 3 of 3.
- Copy email confirmation
- Request: "When someone clicks the email link in the footer, copy the address to their clipboard and briefly show a small "Copied" message." Without the guidance: 4 values outside the system in 28 declarations, and the expected Rosemary component in 0 of 3 runs. With the guidance: 0 in 4, and the component in 3 of 3.
- Photo dialog
- Request: "Make the photo on the homepage open a larger version in a dialog when it is clicked, with a way to close it." Without the guidance: 15 values outside the system in 102 declarations, and the expected Rosemary component in 0 of 3 runs. With the guidance: 0 in 62, and the component in 3 of 3.
- Speaking page
- Request: "Create a Speaking page at /speaking with a short intro and a list of upcoming events showing the date, event name, and city. Use two placeholder events and link the page from the site navigation." Without the guidance: 5 values outside the system in 43 declarations, and the expected Rosemary component in 0 of 3 runs. With the guidance: 0 in 30, and the component in 3 of 3.
- Now page
- Request: "Create a /now page that lists three things I'm currently working on, each with a title, a status label such as "In progress", and a sentence of description." Without the guidance: 0 values outside the system in 62 declarations, and the expected Rosemary component in 0 of 3 runs. With the guidance: 0 in 25, and the component in 3 of 3.
## how to read this system
- tokens
- Fetch /rosemary/tokens.json for the color roles in both themes, the type, space and motion scales, the icon names and sizes, and the illustration roles.
- rule
- Use roles and scale steps, never literal colors, font sizes, spacing, radii, durations or z-indexes. A check fails the build on any literal.
- components
- Reach for the Rosemary component first: button, input, switch, filter, badge, card, index rows, facts list, sheet, nav links, empty state, photo print, quote and status note. If something is missing, add it to the system and record the decision.