

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456# Extract DESIGN.md from HTML78> **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.9>10> **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] -->`.11>12> **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.1314## Quick Start1516```bash17# First run — extract from HTML prototype18node extract-design/scripts/extract.js --source ./prototype.html1920# From a published URL21node extract-design/scripts/extract.js --source https://my-prototype.example.com2223# With a custom name24node extract-design/scripts/extract.js --source ./proto.html --name "My Design System"2526# Update — re-extract from new HTML, diff against existing27node extract-design/scripts/extract.js --source ./proto-v2.html2829# Lint-only — validate existing DESIGN.md without re-extraction30node extract-design/scripts/extract.js --lint-only31```3233## Flow34351. **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`.362. **Collect styles** — `page.evaluate()` collects computed styles from every element. Returns raw JSON to Node.js. Browser = sensor; Node = brain.373. **Classify tokens** — modular pipeline: colors (Material 3 roles), typography (scale detection), spacing (tolerance GCD), rounded (clustering), components (visual signature + pseudo-state variants).384. **Generate prose** — AI heuristics produce all 8 DESIGN.md sections. Overview and Do's/Don'ts flagged with agent notes.395. **Write + validate** — serialize to `specs/tech-architecture/DESIGN_LATEST.md`, run `npx @google/design.md lint`, report to terminal.406. **Handoff** — writes `handoff.next_skill: grill-me` to `specs/state.yaml` with uncertain decisions context.4142## Inputs4344| Parameter | Required | Description |45|-----------|----------|-------------|46| `--source <file\|url>` | First run: yes. Update: optional | HTML prototype path or URL |47| `--name <string>` | No | Design system name (defaults to `<title>` or directory name) |48| `--lint-only` | No | Validate existing DESIGN.md without re-extraction |4950## Output5152- `specs/tech-architecture/DESIGN_LATEST.md` — replaces `DESIGN_PLAN_LATEST.md` as the canonical design artifact53- Terminal summary: token counts, component count, lint result, uncertain decisions54- Structured JSON log to stderr: extraction events, timing, counts55- `specs/state.yaml` → `handoff.next_skill: grill-me` with context5657## Error Tiers5859| Tier | Condition | Response |60|------|-----------|----------|61| Fatal | No Chrome, page load timeout after retries | Exit non-zero, suggest fixes |62| Degraded | Zero colors, zero typography, SPA shell | Write DESIGN.md with degradation warning |63| Warned | Lint errors, uncertain decisions | Write DESIGN.md, flag in terminal, hand off to grill-me |6465## Dependencies6667- **Puppeteer** (Chrome binary) — wrapped behind `BrowserExtractor` interface for testability68- **`@google/design.md`** (soft, via `npx`) — wrapped behind `DesignValidator` interface. Warns and skips if offline.6970## verify7172```bash73node extract-design/tests/test-extraction.js74```7576See [REFERENCE.md](REFERENCE.md) for extraction algorithms and heuristics.7778---7980# Extract Design — Reference8182## Extraction Algorithms8384### Color Classification851. Collect unique computed `background-color`, `color`, `border-color` from every DOM element.862. Count frequency and context (text vs. bg vs. border vs. button).873. Classify using Material 3 roles: surface = largest-area bg, on-surface = most-used text, tertiary = highest-saturation on CTAs, error = reddish.884. Surface container levels: luminance-ordered. Hard-cap at 3 unless data supports 5.895. Low-confidence → `<!-- AGENT NOTE -->` in Colors prose.9091### Typography Classification921. Collect unique (fontFamily, fontSize, fontWeight, lineHeight, letterSpacing) tuples.932. Cluster by fontSize (±2px) → type scale.943. Detect heading hierarchy from HTML tag + computed size.954. Name levels: display-lg, headline-lg/md/sm, title-lg, body-lg/md/sm, label-lg/md/sm.965. Parse `<link>` and `@font-face`; warn if computed font differs from declared.9798### Spacing Classification991. Collect unique padding, margin, gap values. Filter: ignore values < 3 occurrences.1002. Compute tolerance-based GCD (0.5px tolerance).1013. Declare base unit. Detect half-step if gcd/2 values present ≥3 times.1024. Map: unit×1 → sm, ×2 → md, ×4 → lg, ×8 → xl.103104### Rounded Classification1051. Collect unique border-radius values. Cluster (1px tolerance).1062. Name: none (0), sm (smallest), md (median), lg (large), xl (largest), full (9999px).107108### Component Detection109- Button: w<300px, h<64px, bg+radius set, short text. cursor:pointer is bonus.110- Card: bg+radius+padding set, larger area.111- Input: `<input>` or `<textarea>` tag.112- Pseudo-state variants: force :hover, :active, :focus for high-confidence components.113114### Prose Generation115Generates all 8 DESIGN.md sections. Overview and Do's/Don'ts flagged with `<!-- AGENT NOTE: Generated from visual analysis. Grill-me should validate. -->`.116117## Material 3 Token Conventions118Colors: primary, on-primary, secondary, tertiary, error, surface, on-surface, surface-container-*, outline, background, on-background.119Typography: display-lg/md/sm, headline-lg/md/sm, title-lg/md/sm, body-lg/md/sm, label-lg/md/sm.120Rounded: none, xs, sm, md, lg, xl, full.121122## CI Compatibility123Chrome flags: `--headless=new --no-sandbox --disable-gpu --disable-dbus --use-gl=angle --use-angle=swiftshader`124125## Defensive Code126Retry with backoff (3 attempts, 1s/2s/4s), Timeout (30s page load, 10s pseudo-state), Graceful degradation (Tier 2 on empty extraction).127128## Known Risks129- DESIGN.md spec is alpha. Skill pins to current spec.130- Puppeteer is heavy (~300MB Chrome). Document requirement clearly.131- Prose quality depends on AI heuristics. grill-me is the validation gate.132
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?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.cursor/rules/simple-english.mdc · 139 | Cursor rules | styletypesgitdatabase+6 | 47/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/assess-impact.mdc · 139 | Cursor rules | testtesting-strategydeployment | 66/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/audit-plan.mdc · 139 | Cursor rules | buildteststylegit | 74/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/build-epic.mdc · 139 | Cursor rules | buildgit | 58/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/change-request.mdc · 139 | Cursor rules | no sections | 48/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/commit-message.mdc · 139 | Cursor rules | lint-formatstyletypesgit+3 | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/compose-workflow.mdc · 139 | Cursor rules | styledo-notagent-behaviour | 65/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/context7-mcp.mdc · 139 | Cursor rules | style | 54/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/deepen-architecture.mdc · 139 | Cursor rules | testtesting-strategydo-not | 57/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/define-language.mdc · 139 | Cursor rules | lint-formatdo-not | 65/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/define-success.mdc · 139 | Cursor rules | no sections | 4/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/delegate-task.mdc · 139 | Cursor rules | git | 62/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/deploy.mdc · 139 | Cursor rules | setupbuildtestdeployment | 77/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/verify-work.md · 139 | Windsurf rules | buildtestlint-formatagent-behaviour | 74/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/develop-tdd.mdc · 139 | Cursor rules | teststylearchtesting-strategy+5 | 85/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/diagnose-root.mdc · 139 | Cursor rules | no sections | 39/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/diagnose-stall.mdc · 139 | Cursor rules | no sections | 44/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/dispatch-agents.mdc · 139 | Cursor rules | git | 54/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/edit-document.mdc · 139 | Cursor rules | no sections | 39/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/elaborate-spec.mdc · 139 | Cursor rules | test | 58/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| bybren-llc/safe-agentic-workflow.cursor/rules/10-backend-python.mdc · 399 | Cursor rules | testlint-formatstylegit+4 | 97/100 | today |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/danielvm-git-bigpowers-cursor-rules-extract-design)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.