How to Use DESIGN.md Files with AI Coding Agents Like Cursor or v0

DESIGN.md files are declarative markdown documents stored in the VoltAgent/awesome-design-md repository that AI coding agents like Cursor or v0 can parse to extract color tokens, typography scales, and component definitions, then generate framework-specific CSS or component code by resolving placeholder tokens such as {colors.primary} into concrete values.

The VoltAgent/awesome-design-md repository stores complete design systems as plain .md files following a simple, data-driven schema. These files allow AI coding agents to ingest brand guidelines programmatically and emit production-ready code without installing separate design-token packages. By storing tokens and component definitions in a human-readable format, DESIGN.md bridges the gap between visual design and AI-assisted development.

What Is a DESIGN.md File?

A DESIGN.md file is a single markdown document that contains a YAML frontmatter block (typically lines 1–82 in the source files) followed by descriptive content. According to the repository structure, each file declares:

  • Color tokens – primary, secondary, surface, and semantic colors
  • Typography tokens – font families, sizes, weights, line-heights, and letter-spacing
  • Spacing and radius tokens – modular scales for margins, paddings, and border-radius
  • Component definitions – UI components like buttons or cards that reference tokens via placeholders such as {colors.primary} or {typography.button}

Because the format is purely declarative, any AI agent capable of reading text and performing string substitution can process the file without framework-specific plugins.

How AI Agents Parse DESIGN.md Files

When using DESIGN.md files with AI coding agents like Cursor or v0, the workflow follows five discrete steps:

  1. Fetch the DESIGN.md file from the repository or local filesystem
  2. Parse the YAML frontmatter into a JavaScript or TypeScript object using libraries like js-yaml
  3. Resolve token references recursively, converting placeholders like {colors.primary} into concrete hex values (e.g., #f54e00)
  4. Render component code using templates that map the resolved tokens to CSS, Tailwind classes, or styled-components
  5. Insert the generated snippets directly into the user’s codebase, maintaining visual consistency with the original design system

This in-memory processing means no separate npm package is required to consume the design tokens.

Practical Implementation Examples

Generate CSS Custom Properties from DESIGN.md

You can convert a DESIGN.md file into CSS custom properties by extracting the frontmatter and flattening the nested token structure. This script processes design-md/cursor/DESIGN.md:

import fetch from 'node-fetch';
import yaml from 'js-yaml';

// Load the DESIGN.md file from the repository
const url = 'https://raw.githubusercontent.com/VoltAgent/awesome-design-md/main/design-md/cursor/DESIGN.md';
const response = await fetch(url);
const text = await response.text();

// Extract the YAML frontmatter between the first two '---' delimiters
const yamlBlock = text.slice(text.indexOf('---'), text.lastIndexOf('---') + 3);
const design = yaml.load(yamlBlock);

// Helper function to flatten nested objects into flat keys (e.g., colors-primary)
function flatten(obj, prefix = '') {
  const out = {};
  for (const [k, v] of Object.entries(obj)) {
    const key = prefix ? `${prefix}-${k}` : k;
    if (typeof v === 'object') Object.assign(out, flatten(v, key));
    else out[key] = v;
  }
  return out;
}

// Generate CSS custom properties
const tokens = flatten(design);
let css = ':root {\n';
for (const [name, value] of Object.entries(tokens)) {
  css += `  --${name}: ${value};\n`;
}
css += '}';

console.log(css);

The output produces variables like --colors-primary, --typography-button-fontSize, and --spacing-md that can be imported into any stylesheet.

Create a Tailwind Config for Cursor Projects

To use DESIGN.md tokens with Tailwind CSS in a Cursor project, generate a tailwind.config.js file by mapping the parsed design tokens to the Tailwind theme structure:

import fetch from 'node-fetch';
import yaml from 'js-yaml';
import { writeFileSync } from 'fs';

async function generateTailwindConfig() {
  const resp = await fetch('https://raw.githubusercontent.com/VoltAgent/awesome-design-md/main/design-md/cursor/DESIGN.md');
  const md = await resp.text();
  const yamlBlock = md.slice(md.indexOf('---'), md.lastIndexOf('---') + 3);
  const design = yaml.load(yamlBlock);

  const config = {
    theme: {
      colors: design.colors,
      spacing: design.spacing,
      borderRadius: design.rounded,
      fontFamily: {
        display: [design.typography['display-mega'].fontFamily],
        body: [design.typography['body-md'].fontFamily],
        code: [design.typography['code'].fontFamily],
      },
      fontSize: {
        'display-mega': [
          design.typography['display-mega'].fontSize, 
          { lineHeight: design.typography['display-mega'].lineHeight }
        ],
        // Add additional sizes as needed
      },
    },
    plugins: [],
  };

  writeFileSync('tailwind.config.js', `module.exports = ${JSON.stringify(config, null, 2)};`);
  console.log('Tailwind config written!');
}

generateTailwindConfig();

When executed within a Cursor session, the AI can immediately reference this config to suggest utility classes that match the design system defined in design-md/cursor/DESIGN.md.

Prompt Cursor to Generate Components Using Tokens

You can instruct Cursor to generate components by referencing the token placeholders directly in natural language:

Generate a primary CTA button that follows the Cursor design system. Use the color token {colors.primary}, the typography token {typography.button}, and the rounded token {rounded.md} from the DESIGN.md file.

Cursor resolves these placeholders by reading design-md/cursor/DESIGN.md and outputs concrete code:

<button class="bg-[#f54e00] text-white font-[CursorGothic] text-[14px] font-[500] rounded-[8px] px-[18px] py-[10px]">
  Get Started
</button>

Repository Structure and Key Files

The VoltAgent/awesome-design-md repository organizes design systems by brand or agent, providing canonical references for different AI coding environments:

File Purpose
README.md Overview of the project and contribution guidelines
design-md/cursor/DESIGN.md Full design system for the Cursor brand including colors, typography, spacing, and component definitions
design-md/cursor/README.md Reference note containing the fallback URL https://getdesign.md/cursor/design-md
design-md/opencode.ai/DESIGN.md Reference design system for the Opencode AI brand
design-md/vodafone/DESIGN.md Design system for the Vodafone brand, applicable when using agents like v0 that reference these guidelines

These files serve as the knowledge base that AI coding agents ingest to produce UI code aligned with specific brand guidelines.

Summary

  • DESIGN.md files store design tokens and component definitions in YAML frontmatter within human-readable markdown documents
  • AI agents parse these files to resolve placeholders like {colors.primary} into concrete hex values and style definitions
  • Framework agnostic: The format supports generating CSS custom properties, Tailwind configurations, or component code for React, Vue, or vanilla HTML
  • No installation required: Agents read the markdown directly and process tokens in-memory without requiring separate design-token packages
  • Repository examples: The design-md/cursor/DESIGN.md and design-md/vodafone/DESIGN.md files provide complete reference implementations for Cursor and v0 workflows

Frequently Asked Questions

Do I need to install a package to use DESIGN.md files with Cursor?

No. The design system lives in a plain markdown file that Cursor can read directly from your repository or via HTTP. The AI parses the YAML frontmatter in-memory and resolves token references without requiring you to install js-yaml or other dependencies in your production build, though you may use these packages in build scripts if generating static configuration files.

What token types are supported in DESIGN.md files?

According to the source files in design-md/cursor/DESIGN.md, the schema supports nested color tokens (primary, secondary, semantic), typography tokens with fontFamily, fontSize, lineHeight, and letterSpacing properties, spacing and radius tokens using modular scales, and component definitions that reference these values via curly-brace placeholders.

Can DESIGN.md files work with AI agents other than Cursor and v0?

Yes. The format is tool-agnostic. Any AI coding agent capable of reading text files and performing string replacements—such as Claude, GitHub Copilot, or custom LLM implementations—can process DESIGN.md files by parsing the YAML frontmatter and substituting tokens like {typography.button} with actual values from the parsed object.

Where can I find the official DESIGN.md specifications for Cursor?

The canonical Cursor design system is defined in design-md/cursor/DESIGN.md within the VoltAgent/awesome-design-md repository. This file contains the complete color palette (including the primary orange #f54e00), the CursorGothic typography scale, spacing system, and pre-defined component snippets such as button-primary that the AI can reference directly.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →