# DESIGN.md or a reference library: what should an agent read before it designs?

Both. A DESIGN.md holds the rules an agent must follow, such as tokens and components. A reference library holds examples that show what good looks like.

Published 2026-12-02 by Jeffrey Li · https://supertaster.me/blog/design-md-vs-reference-library

An agent should read both before it designs. A DESIGN.md file holds the decisions that are already made, such as colors, type and components, and the agent must follow them. A reference library holds examples that show what good looks like, and the agent uses them for judgment. A file alone gives correct but generic work. Images alone give work that looks right and breaks your system.

## What is a DESIGN.md file?

A DESIGN.md file is a plain text file in a project that describes its design system for AI agents. It usually sits at the top of the repository, next to the README, and is written in Markdown so both people and models can read it.

A typical DESIGN.md contains:

- Color tokens, with names and values.
- Typefaces, sizes and weights.
- Spacing units and layout rules.
- Which components exist and when to use each.
- Things to avoid.

DESIGN.md is a convention, not a formal standard. Coding agents read instruction files from the repository, and a file with this name has become one common place to put design rules. Other setups put the same content in a tool's own rules file, such as [Cursor rules](/blog/cursor-with-design-references). The name matters less than having the rules written down where the agent will read them.

A short example:

```markdown
## Color
- background: #FAF8F4
- text: #1A1A1A
- accent: #1F4D3A, links and primary buttons only

## Type
- Headings: a serif, weight 500
- Body: a sans, 17px, line height 1.5

## Never
- Gradients, drop shadows, more than one accent color
```

## Is a written design file enough for an AI agent?

A written design file is enough for an agent to stay consistent with an existing system. It is not enough for the agent to design something new that looks good. Rules constrain choices. They do not make them.

Consider what a file can and cannot say. It can say the accent color is dark green. It cannot say how a page should feel when you land on it, how much empty space is right for this product, or what makes one arrangement of the same components better than another. An agent that follows every rule in a file can still produce a layout that is correct and forgettable.

Files have a second weakness. They drift. The product changes, the file is not updated, and the agent follows rules that no longer match the code. A rules file needs an owner and regular upkeep, like any other documentation.

There is also a limit on length. A very long file is followed less evenly than a short one. That pushes you to keep only hard rules in the file, which leaves the softer questions unanswered.

## What do reference images give an agent that text rules cannot?

Reference images give an agent examples of finished decisions. An image shows proportion, rhythm, density and tone all at once, in a way that would take pages to describe and would still be read differently by different readers.

| Question | DESIGN.md | Reference library |
| --- | --- | --- |
| What does it hold? | Rules and tokens | Examples, with notes on why they are good |
| What is it good at? | Consistency, exact values | Judgment, feel, new directions |
| How does the agent use it? | Follows it | Looks at it and draws from it |
| How does it change? | Edited when the system changes | Grows as you save things |
| Where does it live? | In one repository | Across projects |
| How does it fail? | Drifts out of date, or grows too long | Gets copied too literally, or holds too little |

Three things images carry that text does not:

- Relationships. How large the heading is against the body, and how much space surrounds a group.
- Tone. The difference between a page that feels like a magazine and one that feels like a dashboard.
- Range. Several examples of what you like show the agent the edges of your taste, not just its center.

Images have their own failure. Given one screenshot, an agent may reproduce it. Give several, and say what to take from each. A note on each reference does this work in advance. [How to describe a visual style to an AI model](/blog/describe-visual-style-to-ai) covers how to write those lines.

## How do the two work together?

A DESIGN.md and a reference library work together when each holds what it is suited to, and the agent is told to consult both. Put tokens and rules in the file. Put taste and examples in the library.

A workable setup:

1. Write the DESIGN.md first, and keep it short. Include only rules that can be followed or broken.
2. Collect references separately. Include screens, print work and your own past projects. Keep a note with each one saying what is good about it.
3. Add one instruction to the file that points to the library: "Before designing a new screen, look at the references and say which ones you used."
4. When the agent's output misses, decide which side failed. If it broke a rule, fix the file. If it followed every rule and still looks wrong, add a reference that shows what you wanted.
5. Review both on a schedule. Remove rules that no longer hold and references you no longer agree with.

The split also follows how the two change. A design system belongs to one product and changes with releases. Taste belongs to a person or a team and builds over years. Keeping taste inside one repository's file means starting again in the next project.

[Supertaster](/) is a reference library of this kind. It is an archive of what you have saved, each item filed under a theme with a note, which agents you connect over MCP can search before they design. They tell you which references shaped the result. It does not generate or chat itself. A folder of images with a text file of notes is a fine way to start.

For the background to all this, see [How to stop AI coding agents from producing generic UI](/blog/stop-generic-ai-ui) and the [guide to designing with AI from your own references](/guides/ai-design).
