Back/Engineering/Cursor
AdvancedEngineering

How to Connect a Design System to an AI Code Editor for High-Fidelity Prototypes

Overcome generic AI-generated designs by building a custom prototyping environment. This workflow connects your company's design system to an AI code editor, ensuring all prototypes are on-brand and high-fidelity.

How to Connect a Design System to an AI Code Editor for High-Fidelity Prototypes

03:50 to 10:30: Owen Williams puts Stripe design-system guidance, components, and custom rules into an AI editor so generated prototypes match the product.

Before you start

What you need

  • The design-system package, documentation, and example screens
  • A repository where the components can run
  • Written rules for component choice, layout, copy, and prohibited patterns

What you’ll make

A prototyping workspace that consistently produces screens with the real design-system components, tokens, and interaction patterns.

Tools used

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

6 steps

Step01

Set Up the Application Foundation

Create a new React application to serve as the basic structure for your prototypes. This should include the main product elements like dashboard chrome, navigation, and routing, providing a consistent shell for the AI to build within.

Example prompt
Create a new React application to serve as the basic structure for your prototypes. This should include the main product elements like dashboard chrome, navigation, and routing, providing a consistent shell for the AI to build within.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for set up the application foundation.
Step02

Integrate Your Design System

Incorporate your company's internal design system components, such as Stripe's 'Sail', into the React application. This step gives the AI direct access to the correct, on-brand UI elements for building prototypes.

Example prompt
Incorporate your company's internal design system components, such as Stripe's 'Sail', into the React application. This step gives the AI direct access to the correct, on-brand UI elements for building prototypes.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for integrate your design system.
Step03

Create a Component Server

Set up a local or internal server that acts as an API for your design system. This allows the AI code editor to programmatically query for available components and their correct usage, preventing it from hallucinating designs.

Example prompt
Set up a local or internal server that acts as an API for your design system. This allows the AI code editor to programmatically query for available components and their correct usage, preventing it from hallucinating designs.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for create a component server.
Step04

Write Custom Rules for the AI

Develop a set of custom rules and instructions for your AI code editor, such as Cursor. These rules should guide the AI on how and when to use your design system components, what to do if the component server is unavailable, and what common mistakes to avoid.

Example prompt
Example Rule: 'If a user pastes a Figma link, you should check the component server before writing any code.' This prevents the AI from hallucinating a design.
Step05

Automate the Development Environment

Integrate the entire setup with your company's internal development infrastructure, like 'dev boxes'. The goal is to let any team member spin up a fully configured prototyping environment from a single internal URL, removing all local setup friction.

Example prompt
Integrate the entire setup with your company's internal development infrastructure, like 'dev boxes'. The goal is to let any team member spin up a fully configured prototyping environment from a single internal URL, removing all local setup friction.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for automate the development environment.
Step06

Generate Prototypes with the AI

Connect your AI code editor to the configured environment and begin generating prototypes with natural language prompts. Use this to quickly create variations for different data states, such as showing a dashboard for a new startup versus a large enterprise user.

Example prompt
Create a new dashboard page for a [user type, e.g., new startup] user. Use only components from our internal design system. The page should include [list 2-3 key components or sections, e.g., a welcome banner, a line chart for revenue, and a table of recent transactions]. Populate the components with realistic sample data for this user type.

What good looks like

  • Generated screens import existing components instead of recreating them
  • Colors, type, spacing, and states use design-system tokens
  • The prototype runs in the target environment without mocked component APIs

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

After the steps

Runbook notes

How to recover when the loop fails and where human judgment helps.

Recover

If it goes sideways

The model recreates components with lookalike CSS
Require imports from the approved package and provide one nearby implementation as the pattern.
The prototype is on-brand but structurally unrealistic
Connect it to the real route, data shape, and application shell before evaluating fidelity.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready