DESIGN.md vs Cursor Rules
DESIGN.md is a portable, schema-validated visual design system specification; Cursor Rules (.cursor/rules/*.mdc) are Cursor’s IDE-specific mechanism for injecting instructions by file glob. Keep visual tokens and design rationale in DESIGN.md, and use a thin .mdc rule to control when Cursor loads it.
Side-by-side comparison
| Dimension | DESIGN.md | Cursor Rules (.cursor/rules/*.mdc) |
|---|---|---|
| Primary scope | Visual design system: colors, typography, spacing, radii, motion, component recipes, and visual Do’s & Don’ts | Cursor-specific behavioral rules: coding conventions, framework patterns, path-scoped context routing |
| Tool portability | Tool-agnostic (works in Claude Code, Cursor, Codex, Windsurf, Copilot, v0, Google Stitch, and standalone chat) | Cursor IDE only (.cursor/rules/*.mdc or legacy .cursorrules) |
| Structure | Hybrid: YAML frontmatter tokens (colors, typography, rounded, spacing, motion, components) + ordered Markdown sections | YAML frontmatter (description, globs, alwaysApply) + free-form Markdown prose |
| Machine validation | Linted with npx designmdpro lint (schema checks, {token} alias resolution, WCAG contrast checks) and diffed with npx designmdpro diff | No token schema, alias resolution, or contrast linting |
| Activation control | Referenced by agent config, @DESIGN.md, MCP, or pasted directly | Native glob matching (src/components/**/*.tsx), agent-requested, or alwaysApply: true |
| Code export | Compiles directly to Tailwind v4 @theme, CSS variables, and shadcn/ui themes | Prose only — cannot be compiled into stylesheets |
What DESIGN.md owns
DESIGN.md separates deterministic visual tokens from human design judgment in a single file at the repository root:
- Exact token tables in YAML frontmatter: hex colors, dark-mode overrides, composite typography scales, spacing steps, corner radii, motion curves, and component definitions.
- Automated validation:
npx designmdpro lint DESIGN.mdcatches broken{token}references and low-contrast foreground/background pairs before an agent writes UI code. - Cross-agent and off-repo portability: the same file drives Claude Code, Cursor, Windsurf, v0, and Google Stitch, and exports straight to CSS via the Tailwind v4 Theme Generator.
What Cursor Rules own
Cursor’s .cursor/rules/*.mdc files solve context delivery and Cursor-specific workflow constraints:
- Glob-scoped activation: load frontend rules only when editing
src/components/**/*.tsxorsrc/app/**/*.css, keeping backend and database sessions lean. - Engineering conventions: enforce framework choices, error-handling patterns, or test commands inside Cursor Composer and Agent modes.
- Zero-friction auto-attachment: unlike a standalone Markdown file that a developer must
@-mention every session, an.mdcrule attaches automatically when matching files are open.
How they work together
Do not duplicate your palette and typography inside .cursor/rules/. Keep DESIGN.md as the single source of truth at the repo root and add a thin .cursor/rules/design-system.mdc pointer:
---
description: Project visual design system (DESIGN.md) for UI components and stylesheets
globs:
- "src/components/**/*.tsx"
- "src/app/**/*.tsx"
- "src/app/**/*.css"
alwaysApply: false
---
Read `DESIGN.md` at the repository root before creating or modifying UI components.
Use its YAML tokens for colors, typography, spacing, and border radii, and follow its Do's and Don'ts.You can generate this wiring automatically with npx designmdpro init --ide cursor, or follow the step-by-step Cursor DESIGN.md Setup guide.
When to use which
- Use Cursor Rules alone for non-visual repository conventions (TypeScript idioms, API error shapes, commit rules) in a Cursor-only team.
- Use
DESIGN.md+ a thin.mdcwrapper for any project with a UI: you get Cursor’s glob-based auto-loading without locking your design system into one editor or losing token linting and CSS exports.
Common mistakes
- Pasting hex codes and spacing rules directly into
.cursorrulesor.mdcprose: tokens drift from CSS,npx designmdpro lintcannot check contrast, and teammates on Claude Code or Copilot never see them. - Setting
alwaysApply: trueon a large design system rule in a full-stack monorepo: injecting 300 lines of visual tokens into API, migration, or CLI sessions wastes context window and dilutes engineering instructions. - Keeping both
.cursorrulesand.cursor/rules/*.mdcwith conflicting visual guidance: Cursor loads legacy.cursorrulesalongside.mdcrules; remove legacy copies and keep one canonicalDESIGN.md.
Frequently Asked Questions
Does DESIGN.md replace Cursor Rules?
No. DESIGN.md defines the visual design system (tokens, components, and visual constraints), while Cursor Rules (.cursor/rules/*.mdc) control when and how Cursor attaches instructions to specific file globs. Most teams keep DESIGN.md at the repo root and reference it from a short .mdc rule.
Can I embed a full DESIGN.md inside a .mdc file?
Yes, for small frontend-only repositories where everyone uses Cursor. DesignMD Pro’s Cursor export produces a self-contained .mdc file, or you can keep DESIGN.md at the repository root so CLI linting, diffing, and other AI coding agents share the same source file.
Why not put color tokens in .cursorrules instead of DESIGN.md?
Cursor’s .cursorrules file is deprecated in favor of .cursor/rules/*.mdc, is Cursor-only, and has no token schema or validation. Storing tokens in DESIGN.md lets you validate {token} references and WCAG contrast with npx designmdpro lint, export Tailwind or CSS variables, and share the same spec with Claude Code, Codex, and v0.
How do I keep Cursor from loading design tokens during backend work?
Set alwaysApply: false in .cursor/rules/design-system.mdc and restrict globs to frontend paths such as src/components/**/*.tsx and src/app/**/*.css. Cursor will only pull in DESIGN.md when you are editing matching UI files.
How does this compare to AGENTS.md and CLAUDE.md?
AGENTS.md and CLAUDE.md govern repository-wide engineering rules (build commands, architecture invariants, testing), whereas Cursor Rules handle Cursor-specific glob routing and DESIGN.md owns visual tokens and UI rationale. See DESIGN.md vs AGENTS.md vs CLAUDE.md for the full three-file breakdown.
Next steps
- Cursor DESIGN.md Setup — configure
.cursor/rules/design-system.mdcand the DesignMD Pro MCP server. - Design Tokens for Cursor — practical workflow for Composer and Agent modes.
- DESIGN.md vs AGENTS.md vs CLAUDE.md — how repository instruction files split responsibilities.
- DESIGN.md Validator — validate your
DESIGN.mdtokens and contrast before wiring them into Cursor.