Starting front end development with a Design System
It is well known that agentic development needs proper context to work. When it comes to front end agentic development I cannot highlight enough how important it is to use a design system.
storybook.evangelosvatikiotis.com ↗What an agent does without one
Ask an agent for a card and it writes a card. Ask again on another page and it writes another one: a padding of 18 here, 20 there, a grey picked by eye, a hover held in React state. Each answer is reasonable on its own. Together they are a site that drifts a little with every request.
The agent is not careless. It has nothing to be consistent with. With a design system and proper skills the agent is able to be consistent with development.
the skills this site's agents use, on GitHub ↗Let's see an example
This site is built from its own design system, and so is polifonia.gr from its own. Here that means tokens for every value (2 themes, 13 text sizes, 13 spacing steps), 22 components with a story each, and a 95-line rules file that says when to reach for what.
Take the smallest piece, a line of text. Without a system, an agent writes a p with a font size, a line height and a grey picked by eye, and the next line it writes is a div with slightly different ones. With one, both are a Text. It renders the same p or div underneath, but its size is one of 13 steps on the type scale and its colour one of 4 tones: body, muted, label and accent.
The rules are enforced, not just written. Text takes no style prop, so a font size or colour typed into a style is a type error, and so is a size that is not on the scale. Tailwind's default palette is wiped, so text-gray-400 has nothing to compile to. An agent that guesses gets told by the build, not by me in review.
Two gaps are left: nothing stops an agent from writing a bare p again, or from passing Text a made-up class like text-[15px]. That half rests on the skills, which tell the agent to write a Text where it would write a p or a div, and on review.
// Before: a bare p and div, size and colour typed in again, by hand or by an agent.
<p style={{ fontSize: 15, lineHeight: 1.6, color: "#9aa39a", margin: 0 }}>
cert-manager, a DNS challenge and Cloudflare.
</p>
// After: Text renders the same p and div, with a size and a tone from the scale.
<Text tone="muted">
cert-manager, a DNS challenge and Cloudflare.
</Text>Where the system lives: Storybook
A design system is only useful if you can see it. Storybook is where every component lives on its own, with a story for each state it can be in, outside any page. That makes it the place to check a change before it reaches the site, and the place an agent's work gets reviewed: if a component has no story, it is not part of the system yet.
this site's Storybook ↗