extract-design

extract-design is a cursor rule for Cursor from danielvm-git/bigpowers. It costs 66 tokens per session (1,635 once invoked), scanned A, original, MIT.

A tool that extracts a DESIGN.md file from an HTML prototype, including visual design tokens and written guidance. It uses a browser to inspect how the page actually renders before validating the result.

In plain words
What is it for?
Use it to document colors, spacing, typography, and component patterns from a local HTML file or published prototype.
Why use it?
It turns a prototype into a reusable design reference without relying only on the source markup, which may not show the final styles.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node extract-design/scripts/extract.js --source ./prototype.html.

Good fit Use it to document colors, spacing, typography, and component patterns from a local HTML file or published prototype.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/danielvm-git/bigpowers
agentmods
npx agentmods add rules/danielvm-git/bigpowers/extract-design

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 extract-design

README.md
[![agentmods](https://agentmods.dev/badge/rules/danielvm-git/bigpowers/extract-design/github.svg)](https://agentmods.dev/rules/danielvm-git/bigpowers/extract-design)
Your own site
<a href="https://agentmods.dev/rules/danielvm-git/bigpowers/extract-design"><img src="https://agentmods.dev/badge/rules/danielvm-git/bigpowers/extract-design/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 extract-design

Your own site · 80×15
<a href="https://agentmods.dev/rules/danielvm-git/bigpowers/extract-design"><img src="https://agentmods.dev/badge/rules/danielvm-git/bigpowers/extract-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,635 The whole file, excluding the scripts and references it only reads on demand.
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.00066 $0.01635
Opus 5.5 $0.00026 $0.00654
Sonnet 5.5 $0.00013 $0.00327
Haiku 4.5 $0.00007 $0.00163

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

Security

Grade A, and why

extract-design 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.

.cursor/rules/extract-design.mdc · 132 lines

How it starts

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

Extract DESIGN.md from HTML

HARD GATE — Do NOT write DESIGN.md without Puppeteer dual-pass extraction. Tokens from static HTML (Cheerio, regex, string scanning) are invalid — they miss cascade, custom properties, and Tailwind resolution.

HARD GATE — Do NOT claim certainty where evidence is thin. Low-confidence color roles, component classifications, and prose assertions MUST be flagged with <!-- AGENT NOTE: uncertain — validate during grill-me. Evidence: [what was observed] -->.

HARD GATE — Do NOT ship DESIGN.md without running npx @google/design.md lint. Unvalidated output is unverified output. If lint is unavailable (offline), flag prominently in terminal and in DESIGN.md prose.

Quick Start

# First run — extract from HTML prototype
node extract-design/scripts/extract.js --source ./prototype.html

# From a published URL
node extract-design/scripts/extract.js --source https://my-prototype.example.com

# With a custom name
node extract-design/scripts/extract.js --source ./proto.html --name "My Design System"

# Update — re-extract from new HTML, diff against existing
node extract-design/scripts/extract.js --source ./proto-v2.html

# Lint-only — validate existing DESIGN.md without re-extraction
node extract-design/scripts/extract.js --lint-only

Flow

  1. Launch Puppeteer — dual-pass (light + dark) with retry + timeout. CI flags: --headless=new --no-sandbox --disable-gpu --disable-dbus --use-gl=angle --use-angle=swiftshader.
  2. Collect styles — page.evaluate() collects computed styles from every element. Returns raw JSON to Node.js. Browser = sensor; Node = brain.
  3. Classify tokens — modular pipeline: colors (Material 3 roles), typography (scale detection), spacing (tolerance GCD), rounded (clustering), components (visual signature + pseudo-state variants).
  4. Generate prose — AI heuristics produce all 8 DESIGN.md sections. Overview and Do's/Don'ts flagged with agent notes.
  5. Write + validate — serialize to specs/tech-architecture/DESIGN_LATEST.md, run npx @google/design.md lint, report to terminal.
  6. Handoff — writes handoff.next_skill: grill-me to specs/state.yaml with uncertain decisions context.

Read the full file on GitHub · 132 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 · 132 lines · 66 tokens per session scan A 4af1ee31a702

Subscribe to this mod's changes

extract-design is a cursor rule published in the GitHub repository danielvm-git/bigpowers (297 stars, last pushed 4d ago), licensed MIT. It adds 66 tokens to every session and 1,635 once invoked, about $0.0003 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-09-03.

Related

extract-design compared with cursor rules from other repositories

extract-design next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
extract-designdanielvm-git/bigpowersCursor rule2974d agoMITA66Cursor
ui-ux-prokok-o/koko-contextos-agentsCursor rule22mo agoMITA0Cursor
brutalist-designkok-o/koko-contextos-agentsCursor rule22mo agoMITA14Cursor
minimalist-designkok-o/koko-contextos-agentsCursor rule22mo agoMITA15Cursor
redesign-auditkok-o/koko-contextos-agentsCursor rule22mo agoMITA21Cursor
soft-designkok-o/koko-contextos-agentsCursor rule22mo agoMITA20Cursor
web-accessibilitykok-o/koko-contextos-agentsCursor rule22mo agoMITA0Cursor