Logo vun Extract Design System

Extract Design System

Communautéit
nathanonn
extract-design-system

Extract a website's FULL design system — tokens AND a curated component catalog (anatomy, variants, hover/focus states, section patterns) — into a bundle a coding agent consumes to build new pages that are native to the source brand. Superset of extract-design-md: use THIS skill when the goal is to build/generate pages that match the source site's components ("clone the design system", "extract components from <url>", "make new pages that look like <site>", "same buttons/cards/sections as <site>"); use extract-design-md when only a DESIGN.md token spec is wanted. Outputs .design_systems/<domain>-YYYYMMDD/ with DESIGN.md + component catalog + reference snippets + section patterns + DTCG tokens + an emitted eval harness. Fixes the "same skin, different skeletons" failure of token-only extraction.

Iwwersiicht

Editeurnathanonn
Repositoryagent-skills
Skill-Nummextract-design-system
Stären
23
Forks
4
Matgeliwwert Fichieren
11
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 11 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum nathanonn op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Extract Design System an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/nathanonn/agent-skills/tree/main/plugins/extract-design-system/skills/extract-design-system
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nathanonn/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/plugins/extract-design-system/skills/extract-design-system .claude/skills/extract-design-system
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Extract Design System an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Extract Design System automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Extract Design System net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Extract a full design system bundle

Given a live URL, run the 9-stage pipeline and emit a bundle under .design_systems/<domain>-YYYYMMDD/ (host dots→hyphens). The output bundle layout and the AGENTS.md consumption template are specified in references/output-bundle-spec.md.

URL ─▶ 1 DISCOVER ─▶ 2 TOKENS ─▶ 3 COMPONENT SWEEP ─▶ 4 CLUSTER + CURATE
    ─▶ 5 DISTILL ─▶ 6 STATES ─▶ 7 SECTIONS ─▶ 8 SYNTHESIZE ─▶ 9 VALIDATE

Prerequisites

This skill drives three external tools — make sure each is available before running:

  • playwright-cli on PATH — the in-browser extraction, component sweep, and screenshots run through it. Install once with npm install -g @playwright/cli@latest then playwright-cli install --skills (needs Node.js 18+). Check: which playwright-cli.
  • A reachable Firecrawl instance — used for page discovery (firecrawl map) and optional copy scraping. The hosted API or a self-hosted / local instance both work; if Firecrawl is unreachable the skill falls back to playwright link discovery (thinner page coverage). Confirm your instance responds before a run.
  • npx (Node.js) — pulls the official @google/design.md linter on demand for the quality gate. If it's unavailable the skill writes the files anyway and notes "lint skipped".

If your agent sandboxes network or filesystem access, allow the outbound calls this skill makes (headless browsing, Firecrawl, npx) before running.

file:// URLs are blocked by playwright-cli — serve local HTML with python3 -m http.server <port> and kill the server by PID afterwards (a pkill -f pattern can match your own shell).

Let SKILL = this skill's directory. Session name: S=dsys. Compose→run→slice pattern for every in-page script:

bash
playwright-cli -s=$S run-code "$(cat script.js)" | bash "$SKILL/scripts/slice-result.sh" > out.json

Two scripts are templates with a __-placeholder substituted per page (distill.js → COMPONENTS, eval-selftest.js → FIXTURES). Compose with tpl.replace('<placeholder>', JSON), then node --check the result. The placeholder literal must appear exactly once in each template, in code — never add it to a comment (this bug has now happened twice).

Flags

FlagDefaultEffect
<url>requiredEntry-point URL
--pages <n>5Max pages to sample
--theme <auto|light|dark|both>autoTheme handling (as in extract-design-md)
--no-screenshotsONSkip feel/section screenshots; prose leans on tokens+copy
--out <dir>.design_systems/<domain>-YYYYMMDD/Output folder
--max-components <n>12Atom cap after curation (sections capped at 8 separately)
--components-onlyoffReuse a prior same-domain bundle's tokens+DESIGN prose (needs raw/tokens/*.json + lint-passing DESIGN.md); rerun stages 3–9 only. On a fresh domain: minimal auto-prose with honest lint warnings
--single-fileoffAdditionally emit design-system.full.md (flatten: DESIGN → AGENTS → COMPONENTS → snippets → checklists)

Conflict guard (standing rule): if the output folder exists, ask (overwrite / dated sibling / abort). Never silently resolve.

Stage 1 — Discover

firecrawl map "<url>" → bucket into slots (home always; pricing/product for cards+ toggles+tables; auth/contact for inputs; blog for prose; brand/about). Component coverage weights the choice: prefer pages exposing form controls, repeated cards, tables. Confirm the picked list with the user before crawling. Firecrawl down → try starting it, else playwright link discovery.

Stage 2 — Tokens

scripts/extract-tokens.js (verbatim from extract-design-md — dual-theme detection and toggling rules are in that skill's references/edge-cases.md). Run on the homepage per theme; finalize the token table before stage 5 so distillation can re-tokenize. Sanity-check varsTotal; thin vars → relax using varsExtra.

Stage 3 — Component sweep (per sampled page)

Scroll the page first to trigger lazy content (step ~900px, then back to top), then run scripts/extract-components.js. It merges two channels (semantic tags/roles/class-regex

  • structural fingerprints), scores component-ness (fake-interactive and sub-10px-font penalties keep DOM-built demo UIs out), detects the styling regime (tailwind density / hashed classes / library fingerprints), and returns top-N candidates per kind with 17-dim style vectors. Save one candidates-<slug>.json per page.

Stage 4 — Cluster + curate

bash
node "$SKILL/scripts/cluster.js" candidates-home.json candidates-pricing.json > clusters.json

Deterministic: greedy-leader clustering (cosine ≥0.95), per-property-mode representative, catalog gate (≥2 instances site-wide OR semantic/landmark role). Then Claude curates: name components/variants (class-name hints beat inference: btn--secondary → secondary; transparent → ghost; most-common → primary), merge duplicates, drop noise, trim to --max-components, flag low-confidence picks. Output a curated list per page: [{ name, sel, expectText }] (expectText = the element's leading text, for brittle-selector re-resolution).

Stage 5+6 — Distill + states (per page)

Compose scripts/distill.js with the page's curated array (each entry may add budget: <n>; default 12 descendants). Returns per component: simplified HTML with data-src-class verbatim recipes, default-diffed CSS, CDP authored rules, forced hover/focus diffs on 13 tracked props, transition. Components that error return {name, error} — rerun or drop, never crash. Save distilled-<slug>.json.

Stage 7 — Sections (per page)

Scroll first, then run scripts/extract-sections.js → pattern + confidence + skeleton + atomEvidence per section. Curate: needsSmart (<0.5) entries you label yourself from heading/atomEvidence/screenshot (may be custom:<name>); override misclassifications; pick ONE representative per pattern (≤8 total, ranked confidence × instances); log every skip with a reason (goes to raw/skipped.json). Distill each representative via the stage-5 template with budget: 40. Screenshot each section crop (page.locator(sel).scrollIntoViewIfNeeded() then .screenshot()) into screenshots/sections/.

Stage 8 — Synthesize the bundle

Layout (see references/output-bundle-spec.md for the full spec — read it before writing):

<out>/
├── DESIGN.md                    # ≤300 lines; extract-design-md prose + `## Component Catalog` table
├── AGENTS.md                    # consumption protocol (6 imperative steps; template in `references/output-bundle-spec.md`)
├── components/COMPONENTS.md     # ~15-line contracts: anatomy, variants×states, usage, screenshots
├── components/*.html + gallery.html
├── tokens/design-tokens.json    # DTCG export
├── eval/fixtures.json + checklists.md
├── screenshots/<page>.png + sections/ + states/
└── raw/                         # tokens/ candidates/ sections/ distill-log.json skipped.json map.json

Mechanical parts:

bash
node "$SKILL/scripts/build-snippets.js" --tokens tokens.json --out <out>/components \
  --source <url> distilled-home.json distilled-pricing.json distilled-sections-*.json
node "$SKILL/scripts/export-dtcg.js" tokens.json <out>/tokens/design-tokens.json --source <url> --theme light
node "$SKILL/scripts/build-fixtures.js" --tokens tokens.json --components <out>/components \
  --out <out>/eval/fixtures.json --source <url> --theme light \
  home:distilled-home.json pricing:distilled-pricing.json home:distilled-sections-home.json ...

Claude-authored parts: DESIGN.md (dual-theme rules as in extract-design-md; add the Component Catalog table + a section-rhythm paragraph in Layout), COMPONENTS.md (anatomy from the snippet HTML, variants×states from fixtures/states data, composition+skeleton lines for sections, low-confidence flags visible), AGENTS.md, eval/checklists.md (per-component judge rubrics; axis scores recorded separately, never averaged). Contract accuracy (consumers follow these lines literally): every Composition claim must be verifiable in the reference snippet's markup (elements seen elsewhere → marked optional); content-dependent elements (billing toggles, testimonials) marked conditional — omit, don't invent; prose type-size claims must match the measured reference, not a plausible generalization. State screenshot crops: serve <out>/components locally, screenshot the .is-hover/ .is-focus copies into screenshots/states/.

Stage 9 — Validate (all four gates before reporting)

  1. Lint: npx -y @google/design.md lint <out>/DESIGN.md — fix structural errors; flag value warnings, never silently delete captured tokens.
  2. Gallery: render gallery.html headless via the local server; 0 console errors required; screenshot and eyeball against the source screenshots.
  3. Eval self-test: compose scripts/eval-selftest.js with fixtures.json; run on every sampled page of the LIVE source. Every check must pass — a failure means the fixture (or extraction) is wrong: fix or drop, never ship a fixture the source itself fails. Archive results to raw/.
  4. Completeness: every high-count candidate kind is a catalog entry or a reasoned entry in raw/skipped.json.

Final report

Tight and honest: pages sampled, regime detected, atoms + sections found (counts), curation skips, lint result verbatim, self-test pass counts, fallback paths taken, known gaps (e.g. un-captured selected-state indicators). Never imply fidelity a gate didn't verify.

Ask-first rule (standing)

<95% confident on an ambiguous mapping (which variant is "primary", whether a repeated block is a real pattern, same-day output conflicts) → ask with a recommendation. Sub-agents run sequentially, never in parallel, and must carry the Firecrawl + sandbox rules above.

Bundled files

  • scripts/extract-tokens.js — stage-2 token extractor (copy of extract-design-md's; keep in sync)
  • scripts/extract-components.js — stage-3 sweep (two channels, scoring, regime detection)
  • scripts/cluster.js — stage-4 deterministic clustering + catalog gate (node CLI)
  • scripts/distill.js — stage-5/6 template (COMPONENTS placeholder; per-entry budget)
  • scripts/extract-sections.js — stage-7 classifier (self-contained run-code)
  • scripts/build-snippets.js — stage-8 snippet/gallery emitter (node CLI)
  • scripts/export-dtcg.js — stage-8 DTCG export (node CLI)
  • scripts/build-fixtures.js — stage-8 fixtures generator (node CLI; evidence-only assertions)
  • scripts/eval-selftest.js — stage-9 self-test template (FIXTURES placeholder; CIEDE2000, CDP states)
  • scripts/slice-result.sh — strips playwright-cli's markdown wrapper to clean JSON
  • references/output-bundle-spec.md — the output bundle layout + AGENTS.md consumption template. Read before Stage 8.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Extract Design System?

Extract a website's FULL design system — tokens AND a curated component catalog (anatomy, variants, hover/focus states, section patterns) — into a bundle a coding agent consumes to build new pages that are native to the source brand. Superset of extract-design-md: use THIS skill when the goal is to build/generate pages that match the source site's components ("clone the design system", "extract components from <url>", "make new pages that look like <site>", "same buttons/cards/sections as <site>"); use extract-design-md when only a DESIGN.md token spec is wanted. Outputs .design_systems/<do...

Firwat Extract Design System op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Extract Design System besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Extract Design System an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/nathanonn/agent-skills/tree/main/plugins/extract-design-system/skills/extract-design-system an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Extract Design System benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Extract Design System benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Extract Design System domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Extract Design System gratis?

Jo. De Skill gëtt vum nathanonn ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇