design-md-generator: Cursor rule for Cursor

.cursorrules

cursorrules is a cursor rule for Cursor from jasonhnd/design-md-generator. It costs 587 tokens per session, scanned A, original, MIT.

A set of coding instructions that extracts a website’s visual rules—such as colors, fonts, spacing, and shadows—and uses them when building an interface or DESIGN.md file.

In plain words
What is it for?
Use it to extract design details from a website, create a DESIGN.md design guide, or build UI that follows an existing DESIGN.md.
Why use it?
It reduces guesswork when recreating a website’s look and helps keep the generated interface consistent with the documented design.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Cursor.

This is jasonhnd/design-md-generator's own configuration. It tells Cursor how to work on design-md-generator itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything design-md-generator configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jasonhnd/design-md-generator. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jasonhnd/design-md-generator/main/.cursorrules
Clone the repo
git clone --depth 1 https://github.com/jasonhnd/design-md-generator

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cursorrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/jasonhnd/design-md-generator/cursorrules/github.svg)](https://agentmods.dev/rules/jasonhnd/design-md-generator/cursorrules)
Your own site
<a href="https://agentmods.dev/rules/jasonhnd/design-md-generator/cursorrules"><img src="https://agentmods.dev/badge/rules/jasonhnd/design-md-generator/cursorrules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cursorrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/jasonhnd/design-md-generator/cursorrules"><img src="https://agentmods.dev/badge/rules/jasonhnd/design-md-generator/cursorrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 587 This file is loaded in full into every session.
When invoked 587 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00587 $0.00587
Opus 5.5 $0.00235 $0.00235
Sonnet 5.5 $0.00117 $0.00117
Haiku 4.5 $0.00059 $0.00059

Measured 2mo ago against content hash 01e47c0b5bc3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cursorrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursorrules · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Design MD Generator — Cursor Rules

You have access to a design system extraction tool. When the user asks you to match a website's visual style, build UI that looks like a specific site, or create a DESIGN.md:

Quick Start

# Extract design tokens from any website
npx design-md-gen https://example.com

# Output appears in output/<domain>/tokens.json

Using an Existing DESIGN.md

If the user has a DESIGN.md file in the project root or provides one:

  1. Read the DESIGN.md file completely before writing any UI code
  2. Use ONLY the colors, fonts, sizes, and shadows specified in the DESIGN.md
  3. Do NOT invent colors or typography not present in the document
  4. Follow the "Agent Prompt Guide" (Section 9) for quick reference values
  5. Match interaction states (hover, focus, active) as documented in Section 4

Generating a New DESIGN.md

If no DESIGN.md exists and the user wants to match a site's style:

  1. Run npx design-md-gen <url> to extract design tokens
  2. Read the generated tokens.json from the output directory
  3. Use the extraction data to write a DESIGN.md following this 9-section format:
      1. Visual Theme & Atmosphere
      1. Color Palette & Roles
      1. Typography Rules
      1. Component Stylings
      1. Layout Principles
      1. Depth & Elevation
      1. Do's and Don'ts
      1. Responsive Behavior
      1. Agent Prompt Guide

Critical Rules

  • ALL numerical values (hex colors, font sizes, weights, shadows) MUST come from the extraction data or DESIGN.md — never hallucinate
  • Use 6-digit lowercase hex format (#ffffff, not #FFF or #FFFFFF)
  • Use numeric font weights (400, 700) not words (regular, bold)
  • When the DESIGN.md specifies a custom font, check if it's available; fall back to the documented fallback stack if not

Verification

After generating UI, verify against the DESIGN.md:

  • Every hex color used should appear in Section 2
  • Every font-size/weight combination should appear in Section 3
  • Shadow values should match Section 6
  • Spacing should follow Section 5's scale

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 68 lines · 587 tokens per session scan A 01e47c0b5bc3

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository jasonhnd/design-md-generator (17 stars, last pushed 6mo ago), licensed MIT. It adds 587 tokens to every session, about $0.0023 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

cursorrules compared with cursor rules from other repositories

cursorrules next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cursorrulesjasonhnd/design-md-generatorCursor rule176mo agoMITA587Cursor
sigil-design-systemKevin-Liu-01/Sigil-UICursor rule1015d agoMITA5,196Cursor
taste-enforcementKevin-Liu-01/Sigil-UICursor rule1015d agoMITA2,171Cursor
frontier-stackKevin-Liu-01/Sigil-UICursor rule1015d agoMITA862Cursor
building-blocksOcean-Industries-Concept-Lab/openbridge-webcomponentsCursor rule106yesterdaynoneA0Cursor
design-animation-rulesKevin-Liu-01/Sigil-UICursor rule1015d agoMITA1,372Cursor
sheleg-designssheleg/sheleg-design-skillCursor rule44d agoMITA40Cursor