How to Teach AI Your Design System
If you have tried asking AI to create a UI from a Figma file, you have probably seen what happens when you give it too little context.
The result might look good at first, but the spacing is slightly wrong, the colours do not match your product, components behave differently from your existing ones, and suddenly your carefully designed interface has the same generic look as thousands of other AI-generated products.
The problem is usually not the AI tool. It is the lack of context you gave it.
During our recent UX Tree webinar, Kevin Zamora Saenz showed how we use a simple Markdown file to give AI the information it needs before asking it to create or change a design. The file acts as a kind of project guide. It tells the AI what the product is, who it is for, how the interface should look and behave, what rules it needs to follow, and what it should avoid.
Once you have this file, you can reuse it across AI tools and projects instead of explaining the same things every time.
Here is how to set one up.
First, understand what the file is doing
A common mistake is to think of this as a prompt.
It is not really a prompt. A prompt tells AI what you want it to do right now. Your Markdown file gives it the background information it needs to make better decisions while it is doing the work.
Think about bringing a new designer onto your team. You would not give them a Figma link and say, “Build this.”
You would probably explain the product, the users, the brand, the design system, the technology, the important constraints and how your team normally works. You would also tell them what not to do.
Your AI needs the same kind of context.
What should be inside the Markdown file?
There is no single perfect structure, but we recommend covering the following areas.
1. Product context
Start by explaining what the product is and what problem it solves.
Include the product name, a short description, the main user groups, the most important user needs and the business goal you are working towards.
For example:
# Product Context
## Product
Metry Health is a digital healthcare service that helps patients manage
appointments, medical documents and follow-up care.
## Primary users
Young adults who are comfortable using digital products but may have
limited knowledge of healthcare processes.
## Main user needs
Users need to understand what happens after an appointment, find their
medical documents and book follow-up appointments without contacting
reception.
## Business goal
Reduce patient drop-off and increase completed follow-up bookings.
## Product goal
Make the next step in the patient's healthcare journey clear and easy
to complete.
This matters because AI can make a technically correct interface that is completely wrong for the product. Giving it the reason behind the interface helps it make better decisions.
2. Your users
Give AI enough information to understand who it is designing for.
You do not need to copy your entire research repository into the file. Focus on the information that should influence design decisions.
Include things such as:
- Primary user groups
- User goals
- Common frustrations
- Important behaviours
- Accessibility needs
- Technical confidence
- Important user constraints
You can also include a small number of key insights from research.
For example:
## User behaviour
Users prefer short, step-by-step instructions rather than long emails
or PDF documents.
Users want to see the current status of their healthcare journey,
similar to tracking a delivery.
Users often do not understand medical terminology.
Avoid assuming that users understand internal healthcare processes.
This gives AI something much more useful than simply saying, “Design this for young adults.”
3. Your design principles
This is where you start teaching AI how your team thinks about design.
If your organisation has existing design principles, put them here. If it does not, write down the rules that your designers already follow.
For example:
# Design Principles
1. Make the next action obvious.
2. Prefer simple language over internal terminology.
3. Keep important information visible without requiring users to search.
4. Use progressive disclosure when information is complex.
5. Do not add interactions unless they solve a real user problem.
6. Design for accessibility from the beginning.
7. Reuse existing components before creating new ones.
These principles are important because they give AI a way to make decisions when you have not explicitly told it what to do.
4. Add your design system
This is one of the most important parts of the file.
You do not need to copy your entire design system into Markdown. Instead, include the information AI needs to understand and reproduce the system correctly.
At a minimum, I would include:
Colour tokens: primary, secondary, background, surface, text, border, success, warning and error colours.
Typography: font family, font sizes, weights, line heights and the hierarchy used for headings, body text and labels.
Spacing: your spacing scale and the rules for using it.
Layout: grid, container widths, breakpoints, padding and responsive behaviour.
Components: the main components available and when they should be used.
States: hover, focus, active, disabled, loading, error and success states.
Borders and elevation: border radius, border styles, shadows and other visual treatments.
Icons: which icon library is used and how icons should be sized and positioned.
Accessibility: contrast requirements, focus states, minimum touch targets and any other important accessibility rules.
A simplified example might look like this:
# Design System
## Colours
Primary: #0057B8
Primary hover: #004494
Background: #FFFFFF
Surface: #F7F8FA
Text primary: #1A1A1A
Text secondary: #5F6368
Border: #DADCE0
Success: #188038
Warning: #F9AB00
Error: #D93025
Do not invent additional brand colours unless explicitly requested.
## Typography
Font: Inter
Heading 1: 32px / 40px / 700
Heading 2: 24px / 32px / 700
Heading 3: 20px / 28px / 600
Body: 16px / 24px / 400
Small: 14px / 20px / 400
## Spacing
Use the existing 4px spacing scale.
4, 8, 12, 16, 24, 32, 40, 48px.
Do not introduce arbitrary spacing values unless there is a clear reason.
## Components
Use existing components wherever possible.
Button:
- Primary
- Secondary
- Tertiary
- Destructive
Inputs:
- Default
- Focus
- Error
- Disabled
Cards:
- Default
- Interactive
Do not create a new component if an existing component can solve the problem.
The exact values will obviously be different for every product. The important thing is that AI has access to the actual rules your team uses.
How do you get this information from your existing design system?
This is where many designers get stuck because their design system already exists in Figma, but the information is not written down in a way AI can easily use.
You do not need to manually type everything.
Start by looking at the foundations of your design system. In Figma, this usually means your variables, colour styles, typography styles, spacing values, grids and component properties.
Export or copy the information you already have, then ask an AI tool to help you organise it into a Markdown file.
For example, you could give it your existing design tokens and ask:
“Turn these design tokens into a structured Markdown design system. Group them into colour, typography, spacing, layout, components and accessibility. Do not invent any values. If information is missing, mark it as unknown rather than making an assumption.”
That last part is important.
Tell AI not to invent information.
If your design system does not define something, you want the AI to ask you rather than quietly making up a new rule.
You can then review the generated Markdown file against your actual Figma library and correct anything that is wrong.
The goal is not to create a perfect technical document on the first attempt. The goal is to create a reliable source of context that you can improve over time.
5. Explain your component rules
Listing your components is useful, but telling AI how they should be used is even more useful.
For example:
## Button rules
Use a primary button for the main action on a page.
Use a secondary button for supporting actions.
Avoid placing two primary buttons next to each other.
Button labels should describe the action.
Avoid generic labels such as "Submit" when a more specific action
can be used, such as "Book appointment".
Do not create new button styles.
This is the difference between giving AI a component library and actually teaching it how your design system works.
6. Add your guardrails
This is the section I would not skip.
AI is very good at filling gaps. If you do not tell it what it should not do, it will make its own decisions.
Your guardrails might include:
# Guardrails
- Do not invent new brand colours.
- Do not use gradients unless explicitly requested.
- Do not create new components when an existing component can be reused.
- Do not change the navigation structure without asking first.
- Do not remove accessibility features.
- Do not use placeholder copy when real content is available.
- Do not use generic AI-generated illustrations unless requested.
- Do not change established interaction patterns without explaining why.
- Do not make assumptions about user behaviour when the product research
provides a different answer.
- Do not introduce new libraries without asking.
- Do not change the technology stack.
- If a requirement is unclear, ask a question before making a significant
decision.
These rules can save a huge amount of time.
During our webinar, Kevin described the AI almost like a junior member of the team. You want it to ask questions when it does not have enough information rather than confidently making decisions that you then have to undo.
7. Tell it what technology you are using
If the Markdown file is also going to be used for prototyping or front-end development, give AI some technical context.
For example:
# Technical Context
Framework: React
Language: TypeScript
Build tool: Vite
Styling: Tailwind CSS
Repository: GitHub
Use the existing project structure.
Do not introduce a new framework.
Use existing dependencies where possible.
If a technical requirement is unclear, ask before making a major
architectural decision.
This becomes particularly useful when you move from design into code because the AI knows what environment it is working in.
8. Tell AI how you want it to work
You can also define the working process.
For example:
# Working Method
Before making significant changes:
1. Understand the existing product and design system.
2. Review the relevant files.
3. Identify anything that is unclear.
4. Ask questions before making assumptions.
5. Explain significant design or technical decisions.
6. Reuse existing components wherever possible.
7. Test the result before considering the task complete.
This sounds simple, but it gives the AI a much better way of approaching the work.
9. Give it permission to say “I don’t know”
This is one of the most useful rules you can add.
AI often tries to be helpful by making a decision even when it does not have enough information.
Tell it explicitly:
# Uncertainty
Do not guess when important information is missing.
If there are multiple reasonable options, explain them and ask which
direction to take.
If the design system does not define something, do not invent a new
design token or component without asking.
If a requirement conflicts with an existing rule, flag the conflict
before proceeding.
This can make your relationship with the AI much more productive.
10. Keep the file as a living document
Your Markdown file should not be something you create once and forget about.
Every time you make an important product or design decision, ask whether that decision should become part of the shared context.
Over time, the file becomes a useful reference for your AI tools, your designers and your developers.
It can also expose weaknesses in your own design system. If you cannot explain how something works in a few clear sentences, there is a good chance your team has never properly agreed on the rule.
That is one of the unexpected benefits of doing this exercise.
A simple structure to start with
You do not need a 200-page document. Start with something your team can actually maintain.
A good first version could look like this:
project/
│
├── CLAUDE.md
│
├── design-system.md
│
├── src/
│
└── README.md
Your CLAUDE.md can contain the project instructions, product context, working method and guardrails, while design-system.md contains the more detailed visual and component information.
For a smaller project, you can also keep everything in one file.
The important thing is not the file name. The important thing is that the AI has reliable context before you ask it to create anything.
The real skill is not better prompting
It is tempting to think that getting better results from AI is mainly about learning the perfect prompt.
In our experience, the bigger improvement comes from giving the AI better information.
If you give it a Figma screenshot and say, “Build this,” you are asking it to make a lot of assumptions.
If you give it the product context, user needs, design principles, design system, technical setup and clear guardrails, you are giving it a much better chance of producing something that actually belongs to your product.
That is also a useful way to think about the designer’s role when working with AI. You are not simply telling a tool what to make. You are giving it the context it needs to make better decisions, reviewing what it produces and stepping in when its decisions are wrong.
And that is where your design judgement still matters.
AI can generate the work. Your job is to make sure it is the right work.
If you want to learn how to take this further, our UX AI Engineering course takes you through the full process of designing, building and deploying a product with AI. You work on a real product over six weeks rather than simply learning individual tools, and each cohort is limited to five people so there is plenty of hands-on support.