RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Windsurf rules/danielvm-git/bigpowers

Windsurf rules

.windsurf/rules/extract-design.md

Extract a Google DESIGN.md file from an HTML prototype (claude.ai/design or any styled page) using Puppeteer, producing machine-readable tokens and AI-generated prose. Use when the user has an HTML prototype and wants a DESIGN.md to anchor their project's visual identity, or when seed-conventions has just scaffolded a new project.

Windsurf rules

Quality

82/100

Scores the file, not the repository.

Length

838 words

25 headings · 2 code blocks

Repository

114

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
danielvm-git/bigpowers/.windsurf/rules/extract-design.mdRawGitHub
1---
2name: extract-design
3model: sonnet
4description: "Extract a Google DESIGN.md file from an HTML prototype (claude.ai/design or any styled page) using Puppeteer, producing machine-readable tokens and AI-generated prose. Use when the user has an HTML prototype and wants a DESIGN.md to anchor their project's visual identity, or when seed-conventions has just scaffolded a new project."
5---
6 
7# Extract DESIGN.md from HTML
8 
9> **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.
10>
11> **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] -->`.
12>
13> **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.
14 
15## Quick Start
16 
17```bash
18# First run — extract from HTML prototype
19node extract-design/scripts/extract.js --source ./prototype.html
20 
21# From a published URL
22node extract-design/scripts/extract.js --source https://my-prototype.example.com
23 
24# With a custom name
25node extract-design/scripts/extract.js --source ./proto.html --name &quot;My Design System&quot;
26 
27# Update — re-extract from new HTML, diff against existing
28node extract-design/scripts/extract.js --source ./proto-v2.html
29 
30# Lint-only — validate existing DESIGN.md without re-extraction
31node extract-design/scripts/extract.js --lint-only
32```
33 
34## Flow
35 
361. **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`.
372. **Collect styles** — `page.evaluate()` collects computed styles from every element. Returns raw JSON to Node.js. Browser = sensor; Node = brain.
383. **Classify tokens** — modular pipeline: colors (Material 3 roles), typography (scale detection), spacing (tolerance GCD), rounded (clustering), components (visual signature + pseudo-state variants).
394. **Generate prose** — AI heuristics produce all 8 DESIGN.md sections. Overview and Do's/Don'ts flagged with agent notes.
405. **Write + validate** — serialize to `specs/tech-architecture/DESIGN_LATEST.md`, run `npx @google/design.md lint`, report to terminal.
416. **Handoff** — writes `handoff.next_skill: grill-me` to `specs/state.yaml` with uncertain decisions context.
42 
43## Inputs
44 
45| Parameter | Required | Description |
46|-----------|----------|-------------|
47| `--source <file\|url>` | First run: yes. Update: optional | HTML prototype path or URL |
48| `--name <string>` | No | Design system name (defaults to `<title>` or directory name) |
49| `--lint-only` | No | Validate existing DESIGN.md without re-extraction |
50 
51## Output
52 
53- `specs/tech-architecture/DESIGN_LATEST.md` — replaces `DESIGN_PLAN_LATEST.md` as the canonical design artifact
54- Terminal summary: token counts, component count, lint result, uncertain decisions
55- Structured JSON log to stderr: extraction events, timing, counts
56- `specs/state.yaml` → `handoff.next_skill: grill-me` with context
57 
58## Error Tiers
59 
60| Tier | Condition | Response |
61|------|-----------|----------|
62| Fatal | No Chrome, page load timeout after retries | Exit non-zero, suggest fixes |
63| Degraded | Zero colors, zero typography, SPA shell | Write DESIGN.md with degradation warning |
64| Warned | Lint errors, uncertain decisions | Write DESIGN.md, flag in terminal, hand off to grill-me |
65 
66## Dependencies
67 
68- **Puppeteer** (Chrome binary) — wrapped behind `BrowserExtractor` interface for testability
69- **`@google/design.md`** (soft, via `npx`) — wrapped behind `DesignValidator` interface. Warns and skips if offline.
70 
71## verify
72 
73```bash
74node extract-design/tests/test-extraction.js
75```
76 
77See [REFERENCE.md](REFERENCE.md) for extraction algorithms and heuristics.
78 
79---
80 
81# Extract Design — Reference
82 
83## Extraction Algorithms
84 
85### Color Classification
861. Collect unique computed `background-color`, `color`, `border-color` from every DOM element.
872. Count frequency and context (text vs. bg vs. border vs. button).
883. Classify using Material 3 roles: surface = largest-area bg, on-surface = most-used text, tertiary = highest-saturation on CTAs, error = reddish.
894. Surface container levels: luminance-ordered. Hard-cap at 3 unless data supports 5.
905. Low-confidence → `<!-- AGENT NOTE -->` in Colors prose.
91 
92### Typography Classification
931. Collect unique (fontFamily, fontSize, fontWeight, lineHeight, letterSpacing) tuples.
942. Cluster by fontSize (±2px) → type scale.
953. Detect heading hierarchy from HTML tag + computed size.
964. Name levels: display-lg, headline-lg/md/sm, title-lg, body-lg/md/sm, label-lg/md/sm.
975. Parse `<link>` and `@font-face`; warn if computed font differs from declared.
98 
99### Spacing Classification
1001. Collect unique padding, margin, gap values. Filter: ignore values < 3 occurrences.
1012. Compute tolerance-based GCD (0.5px tolerance).
1023. Declare base unit. Detect half-step if gcd/2 values present ≥3 times.
1034. Map: unit×1 → sm, ×2 → md, ×4 → lg, ×8 → xl.
104 
105### Rounded Classification
1061. Collect unique border-radius values. Cluster (1px tolerance).
1072. Name: none (0), sm (smallest), md (median), lg (large), xl (largest), full (9999px).
108 
109### Component Detection
110- Button: w<300px, h<64px, bg+radius set, short text. cursor:pointer is bonus.
111- Card: bg+radius+padding set, larger area.
112- Input: `<input>` or `<textarea>` tag.
113- Pseudo-state variants: force :hover, :active, :focus for high-confidence components.
114 
115### Prose Generation
116Generates all 8 DESIGN.md sections. Overview and Do's/Don'ts flagged with `<!-- AGENT NOTE: Generated from visual analysis. Grill-me should validate. -->`.
117 
118## Material 3 Token Conventions
119Colors: primary, on-primary, secondary, tertiary, error, surface, on-surface, surface-container-*, outline, background, on-background.
120Typography: display-lg/md/sm, headline-lg/md/sm, title-lg/md/sm, body-lg/md/sm, label-lg/md/sm.
121Rounded: none, xs, sm, md, lg, xl, full.
122 
123## CI Compatibility
124Chrome flags: `--headless=new --no-sandbox --disable-gpu --disable-dbus --use-gl=angle --use-angle=swiftshader`
125 
126## Defensive Code
127Retry with backoff (3 attempts, 1s/2s/4s), Timeout (30s page load, 10s pseudo-state), Graceful degradation (Tier 2 on empty extraction).
128 
129## Known Risks
130- DESIGN.md spec is alpha. Skill pins to current spec.
131- Puppeteer is heavy (~300MB Chrome). Document requirement clearly.
132- Prose quality depends on AI heuristics. grill-me is the validation gate.
133 

Commands it names

  • node extract-design/scripts/extract.js --source ./prototype.html
  • node extract-design/scripts/extract.js --source https://my-prototype.example.com
  • node extract-design/scripts/extract.js --source ./proto.html --name "My Design System"
  • node extract-design/scripts/extract.js --source ./proto-v2.html
  • node extract-design/scripts/extract.js --lint-only
  • node extract-design/tests/test-extraction.js
  • npx @google/design.md lint
  • npx

Sections

  • Extract DESIGN.md from HTML
  • Quick Start
  • First run — extract from HTML prototype
  • From a published URL
  • With a custom name
  • Update — re-extract from new HTML, diff against existing
  • Lint-only — validate existing DESIGN.md without re-extraction
  • Flow
  • Inputs
  • Output
  • Error Tiers
  • Dependencies
  • verify
  • Extract Design — Reference
  • Extraction Algorithms
  • Color Classification
  • Typography Classification
  • Spacing Classification
  • Rounded Classification
  • Component Detection
  • Prose Generation
  • Material 3 Token Conventions
  • CI Compatibility
  • Defensive Code
  • Known Risks

What it covers

lint-formatcode-styledependenciesui

Stack — with the evidence

node

(0.95)

shell

(0.80)

react

(0.70)

astro

(0.70)

express

(0.70)

vitest

(0.70)

typescript

(0.60)

javascript

(0.60)

python

(0.60)

github-actions

(0.60)

Format

Windsurf rules

Cursor's activation model with a different vocabulary — trigger modes instead of rule types — plus hard character caps, which is the one place a format here will silently drop instructions rather than fail loudly.

What the corpus says about it

Repository

Owner
danielvm-git
Language
—
License
—
Archived
no

All configs in this repo

Also in danielvm-git/bigpowers

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
danielvm-git/bigpowers.cursor/rules/align-grid.mdc · 114Cursor rulesnodeshell+8lint-formatdo-notagent-behaviour65/1003 days ago
danielvm-git/bigpowers.cursor/rules/assess-impact.mdc · 114Cursor rulesshellnode+8testtesting-strategydeployment66/1003 days ago
danielvm-git/bigpowers.cursor/rules/audit-code.mdc · 114Cursor rulesshellnode+8setuptestlint-formatstyle+466/1003 days ago
danielvm-git/bigpowers.cursor/rules/audit-plan.mdc · 114Cursor rulesnodeshell+8buildteststylegit74/1003 days ago
danielvm-git/bigpowers.cursor/rules/build-epic.mdc · 114Cursor rulesshellnode+8buildgit58/1003 days ago
danielvm-git/bigpowers.cursor/rules/change-request.mdc · 114Cursor rulesshellnode+8no sections48/1003 days ago
danielvm-git/bigpowers.cursor/rules/commit-message.mdc · 114Cursor rulesshellnode+8lint-formatstyletypesgit+382/1003 days ago
danielvm-git/bigpowers.cursor/rules/compose-workflow.mdc · 114Cursor rulesshellnode+8styledo-notagent-behaviour65/1003 days ago
danielvm-git/bigpowers.cursor/rules/context7-mcp.mdc · 114Cursor rulesshellnode+8style54/1003 days ago
danielvm-git/bigpowers.cursor/rules/craft-skill.mdc · 114Cursor rulesshellnode+8stylearchgitdo-not69/1003 days ago
danielvm-git/bigpowers.cursor/rules/deepen-architecture.mdc · 114Cursor rulesshellnode+8testtesting-strategydo-not57/1003 days ago
danielvm-git/bigpowers.cursor/rules/define-language.mdc · 114Cursor rulesshellnode+8lint-formatdo-not65/1003 days ago
danielvm-git/bigpowers.cursor/rules/define-success.mdc · 114Cursor rulesshellnode+8no sections4/1003 days ago
danielvm-git/bigpowers.cursor/rules/delegate-task.mdc · 114Cursor rulesshellnode+8git62/1003 days ago
danielvm-git/bigpowers.cursor/rules/deploy.mdc · 114Cursor rulesnodeshell+8setupbuildtestdeployment77/1003 days ago
danielvm-git/bigpowers.cursor/rules/design-interface.mdc · 114Cursor rulesshellnode+8styleagent-behaviour58/1003 days ago
danielvm-git/bigpowers.cursor/rules/develop-tdd.mdc · 114Cursor rulesshellnode+8teststylearchtesting-strategy+585/1003 days ago
danielvm-git/bigpowers.cursor/rules/diagnose-root.mdc · 114Cursor rulesshellnode+8no sections39/1003 days ago
danielvm-git/bigpowers.cursor/rules/diagnose-stall.mdc · 114Cursor rulesshellnode+8no sections44/1003 days ago
danielvm-git/bigpowers.cursor/rules/dispatch-agents.mdc · 114Cursor rulesshellnode+8git54/1003 days ago
Diff against .cursor/rules/align-grid.mdc Diff against .cursor/rules/assess-impact.mdc Diff against .cursor/rules/audit-code.mdc Diff against .cursor/rules/audit-plan.mdc Diff against .cursor/rules/build-epic.mdc Diff against .cursor/rules/change-request.mdc Diff against .cursor/rules/commit-message.mdc Diff against .cursor/rules/compose-workflow.mdc Diff against .cursor/rules/context7-mcp.mdc Diff against .cursor/rules/craft-skill.mdc Diff against .cursor/rules/deepen-architecture.mdc Diff against .cursor/rules/define-language.mdc Diff against .cursor/rules/define-success.mdc Diff against .cursor/rules/delegate-task.mdc Diff against .cursor/rules/deploy.mdc Diff against .cursor/rules/design-interface.mdc Diff against .cursor/rules/develop-tdd.mdc Diff against .cursor/rules/diagnose-root.mdc Diff against .cursor/rules/diagnose-stall.mdc Diff against .cursor/rules/dispatch-agents.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
danielvm-git/bigpowers.windsurf/rules/organize-workspace.md · 114Windsurf rulesshellnode+8buildstylegitdeployment+289/1003 days ago
danielvm-git/bigpowers.windsurf/rules/guard-git.md · 114Windsurf rulesshellnode+8stylearchgitsecurity+289/1003 days ago
danielvm-git/bigpowers.windsurf/rules/quick-fix.md · 114Windsurf rulesshellnode+8teststylegitdeployment+185/1003 days ago
danielvm-git/bigpowers.windsurf/rules/develop-tdd.md · 114Windsurf rulesshellnode+8teststylearchtesting-strategy+585/1003 days ago
danielvm-git/bigpowers.windsurf/rules/session-state.md · 114Windsurf rulesshellnode+8lint-formatstyleagent-behaviour82/1003 days ago
danielvm-git/bigpowers.windsurf/rules/commit-message.md · 114Windsurf rulesshellnode+8lint-formatstyletypesgit+382/1003 days ago
danielvm-git/bigpowers.windsurf/rules/setup-environment.md · 114Windsurf rulesnodeshell+8setupstylesecuritydo-not+181/1003 days ago
danielvm-git/bigpowers.windsurf/rules/wire-ci.md · 114Windsurf rulesnodeshell+8buildtestlint-formatstyle+181/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack