Teaching AI Our Library

Company / Client
ResearchGate
Year
Ongoing
My part
Teach AI agents our system, and improve our docs with the developers
Technology
AI agents, local Figma connection, Markdown files and skills, local repositories

Context

AI agents now help build our product, in Figma and in code. They follow what they are given to the letter, so a vague guideline quickly turns into inconsistent UI. I teach them our design system: principles, foundations and the real components, in Markdown files and skills we extend whenever the work needs it.

Impact

  • Foundations and component knowledge documented as Markdown
  • Prototypes start from our design principles, not from scratch
  • Handoff tuned for accurate agent interpretation

A look inside

The AI applies our system based on the Markdown files and skills we create. This is work in progress: we add new files and skills as the need comes up. A glimpse into some of them.

foundations.md# Foundations## Principles- Accessible by default: every component meets WCAG AA.- Responsive by default.## TokensRaw values are named once as core tokens. Components only use semantic or component tokens.#006DD9 → core-color-blue-500 → sm-color-bg-accent## Typographyheading: core/typography/font-family/2body: core/typography/font-family/1
design-system.md# MediaGalleryA row of images or videos with navigation arrows.## Anatomy1 MediaGallery · 2 Navigation · 3 Group · 4 Item## Do- Keep one aspect ratio per gallery.- Use it for small collections.## Don't- Mix aspect ratios.- Show disabled arrows.## Propsitems · loop

In Figma

Connected to Figma, the agent works from structure, not screenshots. It names the layers after our components and checks our designs for design system consistency: variables and tokens applied, and only components used on the page.

Layers · beforeFrame 214Rectangle 8Group 3TextTextFrame 215Rectangle 9

“Name the layers after our components.”

Layers · afterCardCardHeaderTitleMetaCardFooterButton

“Check this page for design system consistency.”

Consistency check
  • AppliedRaw hex #006DD9 → sm-color-bg-accent
  • AppliedFixed 20px gap → spacing token
  • AppliedDetached frame "Frame 215" → Button component

In development

That work in Figma pays off when we develop with AI. With named layers, tokens and only our components on the page, the agent knows what it is looking at, and with copies of our repositories it builds with the real components.

Figma · checkedCard componentMediaGallery componentButton accentsm-color-bg-accentspacing tokens only

“Build this card with our components.”

PublicationCard.tsx<Card> <CardHeader title={publication.title} /> <MediaGallery items={publication.figures} loop /> <CardFooter> <Button variant="accent">Read</Button> </CardFooter></Card>

Bringing the team along

A trained agent only helps if people know how to work with it. Product designers learn to hand off so agents read their designs correctly, there is documentation on how designers use AI skills, and our foundations and design system skills are shared with designers and developers. Along the way, I keep pushing for tooling that links design and code more thoroughly.

Handoff · ready for agents
  • Layers named after our components
  • Variables and tokens applied
  • Only components used on the page