agentsclimarketplace

Design system extraction

Skill maiconlara/design-system-extraction

Extract design tokens (colors, typography, spacing, border radius, shadows, component states, motion) from any public website by reading its real CSS. WCAG-validates every contrast pair and outputs an implementation guide for coding agents. Agent skill for Claude Code, Cursor and claude.ai, plus a standalone contrast CLI.

Install
npx -y skills add maiconlara/design-system-extraction

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 12 days oldThe repository was created 12 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Extracts the complete design system of an existing site (color tokens, type scale, spacing, breakpoints, radius, components, states, motion) by running scripts in the Chrome console, validates every contrast pair against WCAG, and turns it into an implementation guide ready for a coding-agent session. Use whenever the user mentions copying, cloning, replicating, taking inspiration from or matching a site visual language, asks what fonts or colors a page uses, talks about reverse-engineering a UI or a design system, or simply pastes a URL as a design reference. Works the same for prompts in Portuguese, como extrair o design system, copiar o estilo desse site, que fontes e cores esse site usa, quero um site parecido com X, engenharia reversa de UI. Do not wait for the words extract or extracao, they almost never appear.

SKILL.md

8.0 KB, as published. Nobody here has run it

Design system extraction

Reconstructs the tokens, type scale, layout system and component patterns of a site you did not build, using its real CSS instead of squinting at a screenshot and guessing.

The deliverable is an implementation document, not a list of colors.

What this method does not do

It does not copy the site. What gets extracted are measurements and composition patterns. So images, proprietary icons, copy and product names stay out. If the result could be mistaken for the original by someone on their team, it went too far.

Tell the user this once, up front, without lecturing. Most already know, and whoever does not needs to hear it before investing time.

Before you start

You need browser access. Either through a connected Chrome extension, or by asking the user to run the scripts in DevTools and paste the output back. If neither is available, say so: with screenshots alone you can estimate typography and spacing by eye, but the values will be approximate and you must say that clearly.

If the environment has restricted network access, test before promising. A curl that comes back 403 from the proxy means you depend entirely on the browser.

Pick the pages. Two or three, and different from each other:

  1. The home, which usually has the widest variety of components
  2. An inner content page, which shows the system in ordinary use
  3. If one exists, a page with a form, which reveals input and error states

Extracting from the home alone is the most common mistake. It is a showcase and often has one-off components that do not represent the system.


Phase 1: setup

Paste scripts/setup.js into the page console, whole, once per page. It registers a global namespace x holding every extractor.

Every function takes a pagination argument. If the output comes back truncated, call it again with the next number: x.tokens(0), x.tokens(1), x.tokens(2).

If you are running through browser automation, output is usually truncated around a thousand characters. Do not try to work around it with console.log, use the pagination. If you are walking the user through DevTools, wrap the call in copy(...) to send the result to the clipboard instead of fighting the console.


Phase 2: extraction

Run in this order. The order matters: the first step determines how you read all the rest.

CallWhat it returns
x.stack()Framework, libraries, and how many stylesheets are blocked
x.tokens()Declared custom properties. What the system says it is
x.type()Type scale, responsive overrides, loaded families
x.layout()Container, grids, gaps, section padding, breakpoints
x.shape()Radius, shadow, gradient, border, uppercase
x.colors()Computed color audit. What the system is
x.comp()Class definitions for button, card, chip, input
x.states()Hover, focus, active, disabled
x.motion()Transitions, animations, and whether reduced-motion is respected
x.map()Section map with height and scroll position
x.heads()Heading hierarchy, reveals the content architecture

After x.stack(), read references/by-stack.md and follow only the section matching the result. Webflow, Tailwind, CSS-in-JS, WordPress and hand-rolled sites need different strategies, and following the wrong one wastes a lot of time.

If x.stack() reports blocked sheets, your token extraction is incomplete. Record that and tell the user instead of delivering false confidence.


Phase 3: visual capture

x.map() returns the coordinates of every section. Scroll to each one and capture:

x.go(4050)     // instant scroll, never smooth

Wait two seconds after each scroll before shooting. Intersection Observer entrance animations need that time, and without it you capture the section at opacity: 0.

Capture the top, two or three mid points, and the footer. If you can, also capture a hover state and the mobile version.


Phase 4: interpretation

Read references/interpretation.md in full before writing the document. It covers the three lines of reasoning that separate a useful extraction from a list of values.

A summary of the three, so you know what you are looking for:

Absence is signal. An empty result for shadow or gradient is not a script failure, it is the most valuable finding it delivers. Record every absence explicitly and turn it into an anti-pattern in the final document.

The diff between declared and measured. Compare x.tokens() against x.colors(). They almost never match, and the gap is token drift. Always build from the declared side, which is the intent, never from the measured side, which includes their mistakes.

Contrast. Run scripts/contrast.py:

python contrast.py "#fdaccd" "#ffffff"     # one pair
python contrast.py --ramp "#fdaccd"        # 10-step ramp with suggested usage
python contrast.py --audit tokens.json     # ink x bg matrix with a failure report

Production systems violate contrast far more often than people assume. When you find a violation in the original, tell the user and do not reproduce it. The fix is almost never abandoning the color, it is adding a step. Details in references/interpretation.md.


Phase 5: the document

Follow assets/output-template.md. Thirteen sections, ordered for consumption by a coding agent, not for linear human reading.

Two sections carry the result and are exactly the ones that get skipped:

Anti-patterns, derived from the absences. Phrased negatively and verifiably: "if X shows up in the result, it is wrong". This keeps the agent from reintroducing defaults the source system rejected on purpose, which is the most common failure mode.

Acceptance checklist, with objectively answerable items. "Layout looks good" does not work. "No horizontal scroll at 375, 768, 992 and 1440px" does. Without it the agent declares success on its own.


Behavior notes

Ask for the brand colors early. If the user will use their own palette instead of the extracted site's, isolate the color block at the top of the document and flag it for replacement. Swapping later becomes a one-block edit.

Do not copy the naming. Step structure yes, names no. The original's names carry another team's history.

Say what is extracted and what is proposed. On a site with no system, much of the result is your own reconstruction. That distinction matters when someone questions a decision later.

One question that saves time. Up front, clarify whether the user wants the system or the look. This method solves the system. The look also requires understanding the composition decisions, and for that screenshots and human reading are worth more than any script.


Files

FileWhen to read
scripts/setup.jsAlways. Paste into the console before anything else
scripts/contrast.pyIn phase 4, to validate the color tokens
references/by-stack.mdRight after x.stack(). Read only the detected stack's section
references/interpretation.mdBefore writing the document. Read it in full
assets/output-template.mdWhen assembling the final document

Gives 0 of the 12 instructions most design systems skills give

Counted across 528 of the 534 authors here whose files we hold, read 2026-08-06

  • create a custom theme if neededin 54 of 528, across 10 files
  • read the corresponding theme filein 54 of 528, across 10 files
  • ask which theme to applyin 53 of 528, across 9 files
  • show the theme showcasein 53 of 528, across 9 files
  • maintain visual identity across all slidesin 50 of 528, across 6 files
  • apply the specified colors and fontsin 47 of 528, across 3 files
  • get explicit confirmationin 45 of 528, across 1 file
  • Generate a design system before codingin 19 of 528, across 6 files
  • Maintain at least 4.5:1 color contrast ratioin 19 of 528, across 8 files
  • Describe component shapes, colors, shadows, and interaction statesin 18 of 528, across 4 files
  • Check Python installation and install if missingin 17 of 528, across 4 files
  • Default to html-tailwind if stack is unspecifiedin 17 of 528, across 4 files

Said here and by no other author read

  • read declared tokens instead of measured values
  • warn user about not copying proprietary assets
  • select home inner and form pages
  • paginate console output if truncated
  • extract stack tokens and components
  • record missing styles as anti-patterns

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.