cursorrules

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/jasonhnd/design-md-generator/cursorrules
Clone the repo
git clone --depth 1 https://github.com/jasonhnd/design-md-generator

Made for: Cursor.

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. Scan, not verified.
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 $0.00587 $0.00587
Opus 5 $0.00293 $0.00293
Sonnet 5 $0.00117 $0.00117
Haiku 4.5 $0.00059 $0.00059

Measured 2d ago against content hash 01e47c0b5bc3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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. 2d 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 (10 stars, last pushed 4mo ago), licensed MIT. It adds 587 tokens to every session, about $0.0029 per session on Opus 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.