Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Agent Skills guide

Skill recipe: your design system

A worked skill that teaches coding agents your tokens, components and do and don't rules, with detail in reference files so it loads only when needed.

By Intermediate · Updated 20 November 20265 min read
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark
On this page

A design system skill teaches coding agents your tokens, components and usage rules, and loads only when the agent touches UI code. Keep SKILL.md to the rules and a short pre-flight check, and put the component catalogue and token tables in reference files the agent reads when it needs them. The example targets React.

Coding agents build interfaces that look like everyone else’s because that is what they were trained on. Your design system is the fix, if the agent knows it. Pasting the whole system into AGENTS.md costs thousands of tokens on every request, including the ones about database migrations. A skill loads it only when the agent touches UI. This recipe builds one for a React codebase with design tokens and a component library; adapt the details to yours.

What goes in

Agents need three things from a design system, in this order of importance:

  1. Which components exist and when to use each. The biggest source of drift is an agent writing a new button because it did not know Button existed.
  2. Tokens, with roles. Not just --color-blue-600: #2459d6, but “primary actions use --color-action”. Roles survive redesigns; raw values do not.
  3. Rules the code cannot enforce. One primary button per view, sentence case for labels, no colour as the only signal.

What stays out: the history of the system, Figma workflows, anything a linter already catches.

The folder

.agents/skills/acme-ui/
├── SKILL.md
└── references/
    ├── components.md
    ├── tokens.md
    └── content-rules.md

SKILL.md stays short and tells the agent which reference to read for which job. This is progressive disclosure: the agent pays for the component catalogue only when it is choosing components.

SKILL.md

---
name: acme-ui
description: >-
  Applies the Acme design system when building or changing UI in this repo:
  which components to use, design tokens, spacing, and content rules. Use for
  any work in src/components or src/app that adds or edits markup, styles or
  user-facing text. Not for back-end, API or database changes.
metadata:
  owner: design-systems
  version: "3.2"
---

# Acme UI

Build with the existing system. Never add a new component, colour, font size
or shadow without saying why the existing ones do not work.

## Before you write UI

1. Read references/components.md and pick components from it. Import from
   `@acme/ui`, never from a file path inside the package.
2. For any colour, spacing, radius or type size, read references/tokens.md
   and use the token, not a raw value.
3. For labels, errors, empty states and buttons, follow
   references/content-rules.md.

## Rules

- One primary button per view. Secondary actions use `variant="secondary"`.
- Spacing comes from the 4px scale (`space-1` to `space-12`). No arbitrary
  values such as `mt-[13px]`.
- Never use colour as the only way to show state; pair it with text or an icon.
- Forms use `<Field>` so labels, hints and errors are wired for screen readers.

## Check your work

Run `pnpm lint:styles` (it rejects raw colour values) and list any rule you
broke on purpose, with the reason.

The description names the folders where UI lives. That makes triggering reliable in a repository where “component” could also mean a back-end module, and the “Not for…” sentence keeps it out of API work.

references/components.md

Write one entry per component, short and decision-focused:

## Button
Use for actions. Variants: primary (one per view), secondary, danger (destructive,
always with a confirmation), ghost (toolbars only).
Do not use for navigation; use Link.

## Dialog
Use for decisions that block the current task. Has a title, body and at most
two actions. For non-blocking messages use Toast.

Generate the list from your component library’s docs if you can, then edit it down. An agent does not need prop tables; it can read the TypeScript types. It needs to know when to use what.

references/tokens.md

Group tokens by role and say what each role is for:

| Token | Use for |
|---|---|
| --color-action | Primary buttons and links |
| --color-action-hover | Hover state of the above |
| --color-danger | Destructive actions and error text |
| --color-surface | Page background |
| --color-surface-raised | Cards, dialogs, menus |
| --color-text | Body text |
| --color-text-muted | Secondary text, never below 4.5:1 contrast on surface |

If your tokens are in a JSON or CSS file, a small script in the build can regenerate this table so it never drifts. The skill then reads a generated file rather than a hand-written one.

Testing it

Try five prompts in a fresh session without naming the skill: “add a delete button to the user table”, “build a settings page with a form”, “the empty state on /projects looks bare”, “make the card shadows softer”, and one back-end task. Check that the skill loads for the first four and not the fifth, that the output imports from @acme/ui, and that no raw hex values appear. Keep the prompts with the skill and rerun them when you change it.

Variations

  • No component library yet: start with tokens and content rules only. Anthropic’s brand guidelines is a 73-line example of a skill built around colours and type.
  • shadcn/ui: install the shadcn skill for the library mechanics and keep your skill to your own variants and rules.
  • Component API reviews: pair with React composition patterns so new components follow the same structure.
  • No design system at all: frontend design at least gets the agent to choose a deliberate direction.

To share the skill across repositories, package it as a plugin; see a private plugin marketplace for your team. A short SKILL.md that sends the agent to reference files is a small version of the router in Agent Skill design patterns, and if this is your first skill, what Agent Skills are and how to create a Claude skill cover the basics this recipe skips.

Back to top