Building with agents

A design loop built for agents and humans building with Fern.

Reach for it when
  • Setting up an agent to work on packages/fern-dashboard.
  • Reviewing a UI PR an agent opened.

The agentic design system loop

  1. 1Read
    Every rule, with token tables.
    Every component and its props.
  2. 2Build
    Shared components. Fix them at the source.
    The only icon import. Never lucide-react.
    Storybook
    A story for anything new.
  3. 3Check
    check:design-system
    Flags when the docs or stories fall behind the code.
    design-system:ack
    Records that this site caught up.
  4. 4Review
    The agent runs it on its own diff before opening the PR.
    Design review in CI
    Runs it on every UI PR, comments, and asks a designer to look at anything new. Never blocks a merge.
    Code owners
    Requests Kapil and Mathieu on the PR.

What happens on a PR

For now nothing blocks the merge. The checks flag what they find, and one designer is asked to look at anything new.

Before the PR: the agent
ReadDESIGN.md, COMPONENTS.md
BuildFrom ui/ and icons, a story for a new ui/ component
Checkcheck:design-system, optional
ReviewThe skill on its own diff; fixes what needs changes
On the PR: CI
check:design-systemWarns on the PR when it finds issues
Design reviewRuns the check and the skill, posts one comment
Code ownersRequests Kapil and Mathieu on system files
What happens next
Needs changesThe author fixes it. No designer is asked.
Designer flaggedOne designer is asked to look, never the author
PassNothing to do
MergeNever blocked: no check or approval gates it for now
The system isn't used properly
A hex color, a default Tailwind palette class, text-[13px], a raw <button>, a lucide-react import, Title Case copy
  1. 1check:design-system warns on the mechanical ones, like a lucide-react import. The job still passes.
  2. 2The design review comment lists each finding under Needs changes, with the file, the line and what to use instead.
  3. 3No designer is asked: it's for the author to fix, not a design decision.
  4. 4The author fixes it. Nothing stops a merge if they don't.
Needs changesDesigner not neededMerge not blocked
A new component is added
A new file in src/components/ui, or new motion, a new token, font or icon
  1. 1check:design-system warns about what the component is missing: its story, a place on the Components page, and the site update.
  2. 2The design review comment lists the component under For a designer, and the missing pieces under Needs changes.
  3. 3One designer is asked to look, alternating between Kapil and Mathieu and never the PR's author. Code owners also requests both.
  4. 4The merge doesn't wait for the designer's approval or the site update.
Needs changes until completeDesigner flaggedMerge not blocked

The files

What an agent reads before writing UI, in full: the rules and the component index. Copy or download either.

Skills

The skills in .agents/skills that apply this system. Preview, copy or download one, or export them all as a script that writes them into another repo.

Brief an agent

Paste this at the top of a task for an agent working on the dashboard. It points at everything above. Every page has a brief of its own for its kind of work, under Brief an agent at the top of the page.

agent-brief.md
Before building UI in packages/fern-dashboard:1. Read packages/fern-dashboard/DESIGN.md and COMPONENTS.md.2. Compose from @/components/ui and import icons from @/components/icons.3. Use semantic tokens for color and the documented text styles for type.4. Give every new component a story with its loading, empty and error states.5. Run pnpm --filter=@fern-dashboard/ui check:design-system before opening the PR.

Keep going

Components
Shared components, from single controls to whole features.
Accessibility
Fern supports accessibility standards out of the box.