DESIGN.md Pro
Skip to article

How to Use DESIGN.md with Cursor and Claude Code

Give Cursor or Claude Code an explicit design reference, build one screen against it and check that a follow-up page uses the same components.

Necati Ozmen3 min read

Start with a repo you can already run locally. Pick an existing screen and one small change, such as adding a notification preference to Settings. That gives you a baseline and an easy way to catch accidental changes.

Give the agent a file and a target

Choose a reference from the DESIGN.md catalog and save the file at a known path such as docs/DESIGN.md. In Cursor’s project chat or a Claude Code session opened in the repo, name that path explicitly.

Try this prompt: “Read docs/DESIGN.md and the existing Settings screen. Add an email notification preference using the existing field and button components. Show which typography and spacing rules you applied. Preserve the existing save behavior.”

Give the session a way to resolve conflicting examples

A real repo often contains an approved settings panel and a much older form with different padding. An agent that searches for the nearest checkbox may copy the older example. Add the approved component path to the task after checking it exists. Ask the agent to list the files it expects to change before it edits anything.

For a notification preference, a useful second message is: “Use the account preferences row as the layout reference. Keep our current settings persistence. Add the new option to the same save flow and show how I can verify it survives a reload.” This keeps the design and the behavior reviewable together.

Debug a rule the agent seems to ignore

First ask it to point to the line in the design file that applies. If it cannot find one, make the rule explicit. If it can, inspect the rendered control. A parent layout, a component variant or a local style override may explain the difference. Correcting the shared component can fix several screens. A change to the project-wide spacing scale to rescue one row may disturb all of them.

Keep a screenshot of the accepted screen with the repo. For onboarding another contributor, pair it with the short introduction to Web Design MD and the exact file path used in the successful session.

Check the rendered result

Run the app and inspect the screen at a narrow width. Toggle the preference, use the keyboard to reach Save, and compare the field label with adjacent settings. Ask for a targeted correction if the new row introduces a second button style or a different label weight.

For the next task, open a fresh conversation and name the same file. Ask for another preference with longer helper text. If both implementations need the same custom CSS, move it into a shared component and reference that component in the file. This makes the next session easier to review.