Agent skill

Extract Design System

by espennilsen in espennilsen/pi

Reverse-engineer a design system from a live website (public URL or localhost).

MITAuto-check passedFrontend & Design

Install Extract Design System

skills CLI
$ npx skills add espennilsen/pi --skill extract-design-system -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install espennilsen/pi extract-design-system --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/espennilsen/pi.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/extract-design-system .claude/skills/extract-design-system && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
extract-design-system
GitHub stars
122
Token cost
~2k tokens
SKILL.md length
592 words
Files
2 (incl. scripts)
Skills in repo
36
Repo updated
First seen
Licence
MIT

At a glance

Reverse-engineer a design system from a live website (public URL or localhost).

  • Works in 6 steps: Run the Extraction Script → CSS Source Analysis (supplementary) → Organize Raw Data into Tokens → …
  • Tasks that involve Design systems
  • SKILL.md covers Prerequisites, Quick Start, Output Structure and Workflow, plus 1 more section
  • Runs JavaScript scripts from its folder; calls node and npx

What it does

Extract Design System is an agent skill from espennilsen/pi. Reverse-engineer a design system from a live website (public URL or localhost). Extracts colors, typography, spacing, shadows, radii, breakpoints, and component patterns using a headed Playwright browser. Captures screenshots of pages, components, and interactive states at real device resolutions. Produces structured design tokens and optionally seeds a Penpot project. Triggers — use this skill when: - User says "extract design system from [url]" - User asks to "reverse-engineer the styles from [site]" - User…

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts.

It sits in Frontend & Design, covering Design systems, Design tokens and Typography. It works with Playwright. The licence is MIT.

When your agent uses it

  • Tasks that involve Design systems
  • Tasks that involve Design tokens
  • Tasks that involve Typography

Example prompts

  • “extract design system from [url]”
  • “reverse-engineer the styles from [site]”
  • “build a design system based on [website]”
  • “/extract-design-system”

Requirements

  • Node.js

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Run the Extraction Script
  2. CSS Source Analysis (supplementary)
  3. Organize Raw Data into Tokens
  4. Compile Token File
  5. Seed Penpot (optional)
  6. Generate Tailwind Config (optional)

What it can do on your machine

Read from SKILL.md and the folder at commit 79d019b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node
    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Extract Design System loads about 2k tokens when it runs. Until then it costs about 205 tokens; SKILL.md has 592 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~205
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from espennilsen/pi at commit 79d019b, republished under its MIT licence (© espennilsen). 592 words, ~1,991 tokens.

Download SKILL.mdSave it as .claude/skills/extract-design-system/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
extract-design-system
description
Reverse-engineer a design system from a live website (public URL or localhost). Extracts colors, typography, spacing, shadows, radii, breakpoints, and component patterns using a headed Playwright browser. Captures screenshots of pages, components, and interactive states at real device resolutions. Produces structured design tokens and optionally seeds a Penpot project. **Triggers — use this skill when:** - User says "extract design system from [url]" - User asks to "reverse-engineer the styles from [site]" - User says "build a design system based on [website]" - User asks to "pull the design tokens from [url]" - User says "analyze the design of [site]" - User asks to "import styles from [website] into Penpot" - User points at a URL and asks about its colors, fonts, spacing, or components

Extract Design System from Website

Reverse-engineer a complete design system from a live website using two passes:

  1. CSS source analysis — fetch and parse stylesheets for declared values
  2. Headed Playwright extraction — visually browse the site, interact with elements, extract computed styles, and capture screenshots at real device resolutions

Prerequisites

  • Playwright installed (npx playwright install chromium if not set up)
  • web_fetch tool for fetching raw HTML/CSS source

Quick Start

Run the extraction script against the target URL:

bash
node scripts/extract.mjs <url> [outDir] [subpage1,subpage2,...]

Examples:

bash
node scripts/extract.mjs https://example.com
node scripts/extract.mjs https://example.com ./my-tokens "/about,/pricing,/docs"
node scripts/extract.mjs http://localhost:3000 extracted "/dashboard,/settings"

The script opens a visible browser (headless: false) so you can watch the extraction. It uses real device profiles for accurate screenshots:

BreakpointDeviceViewportDPRReal image size
MobileiPhone 15393×6593x1179×1977
TabletiPad Pro 11834×11942x1668×2388
Desktop—1440×9002x2880×1800
Wide—1920×10802x3840×2160

Mobile and tablet use Playwright's built-in device descriptors (correct UA, isMobile, hasTouch) so sites serving different layouts render correctly.

Output Structure

{outDir}/
├── screenshots/
│   ├── pages/               — full-page at 4 breakpoints × each page
│   │   ├── home-mobile.png
│   │   ├── home-desktop.png
│   │   ├── home-dark-mode.png
│   │   └── ...
│   └── components/          — isolated component + hover/focus states
│       ├── nav.png
│       ├── button-primary.png
│       ├── button-primary-hover.png
│       ├── button-primary-focus.png
│       ├── nav-mobile-open.png
│       └── ...
└── raw/
    ├── colors.json          — CSS custom properties + computed colors
    ├── colors-dark.json     — dark mode variables (if detected)
    ├── typography.json      — font families, type styles, @font-face
    ├── spacing.json         — spacing, radii, shadows, borders, max-widths
    └── components.json      — component manifest + responsive layout data

Workflow

Step 1: Run the Extraction Script
bash
node scripts/extract.mjs "TARGET_URL" "extracted-design-system" "/about,/pricing"

The script automatically:

  • Extracts CSS custom properties and computed colors from 800 sampled elements
  • Captures typography from all semantic elements (h1-h6, p, a, button, etc.)
  • Measures spacing, radii, shadows, and borders
  • Screenshots every page at 4 breakpoints with real device contexts
  • Isolates and screenshots 17 common component types
  • Captures hover and focus states on interactive elements
  • Tests mobile nav by clicking hamburger-like buttons at iPhone viewport
  • Detects dark mode via prefers-color-scheme emulation and toggle sniffing
Step 2: CSS Source Analysis (supplementary)

The script captures computed values. This step catches declared values from CSS source that may not be active on the current page:

bash
# Fetch stylesheets identified in the HTML
web_fetch <stylesheet-url>

# Look for things the computed pass might miss:
# - Media query breakpoints
# - Keyframe animations
# - CSS custom property definitions with fallbacks
# - Commented-out or unused styles that reveal design intent
Step 3: Organize Raw Data into Tokens

Review raw/colors.json, raw/typography.json, raw/spacing.json and the screenshots. Then organize into a structured token file.

Colors → Palette

Group extracted colors into categories:

CategoryWhat to look for
PrimaryBrand color, CTA buttons, most prominent accent
SecondarySupporting accent, secondary buttons
NeutralBackgrounds, text, borders — the gray scale
SuccessGreen tones (confirmations, checkmarks)
WarningYellow/amber tones (alerts)
ErrorRed tones (errors, delete actions)
InfoBlue tones (informational messages)

Deduplicate near-identical colors (ΔE < 3 in OKLCH space). A site with 47 slightly different grays probably intended 5-8.

Show full SKILL.md (242 more words)Show less
Typography → Scale

Map extracted font sizes to a named scale:

NameSize range
caption≤12px
small13-14px
body (base)15-16px
large17-18px
h6-h118-48px
display48px+
Spacing → Grid

Snap raw pixel values to the nearest standard grid:

4px grid: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96
8px grid: 8, 16, 24, 32, 40, 48, 56, 64, 80, 96

Pick whichever grid the extracted values align to with the least rounding.

Components → Inventory

For each component in the screenshots, document:

  • Visual appearance (size, colors, spacing)
  • Variants observed (different sizes, states)
  • Interactive behavior (from hover/focus screenshots)
  • Closest shadcn-svelte equivalent
Step 4: Compile Token File

Write the organized data to tokens.json:

json
{
  "$schema": "extracted-design-tokens",
  "source": "https://example.com",
  "extracted": "2026-03-09",
  "framework_detected": "tailwind|bootstrap|custom|none",
  "dark_mode": true,
  "colors": {
    "light": {
      "primary": { "50": "#...", "500": "#...", "900": "#..." },
      "neutral": { "50": "#...", "950": "#..." }
    },
    "dark": { }
  },
  "typography": {
    "fontFamilies": { "sans": "...", "mono": "..." },
    "scale": { "h1": { "size": "36px", "weight": 700, "lineHeight": 1.2 } }
  },
  "spacing": { "grid": "4px", "scale": [0, 4, 8, 12, 16, 24, 32, 48, 64, 96] },
  "radii": { "sm": "4px", "md": "8px", "lg": "12px" },
  "shadows": { "sm": "...", "md": "...", "lg": "..." },
  "components": { "buttons": { "variants": ["primary", "secondary"] } }
}
Step 5: Seed Penpot (optional)

If requested, create a Penpot project from the tokens using pi-penpot:

  1. Create project named after the source site
  2. Create a "Design System" page with color swatches, type samples, spacing ruler
  3. Create pages for each major screen, importing screenshots as references
  4. Build components matching the extracted inventory
Step 6: Generate Tailwind Config (optional)

Map tokens to a Tailwind config with CSS custom properties for runtime theming.

Tips

  • Pass 3-5 subpages for broader component coverage
  • CSS custom properties are gold — sites using them have self-documented tokens
  • Watch the browser — headed mode reveals cookie banners, auth walls, and popups that block extraction
  • Interactive states matter — hover/focus screenshots catch design intent static captures miss
  • Don't over-extract — focus on intentional design decisions, not every computed value
  • Remove slowMo in the script for faster extraction once verified
  • Check for dark mode — the script detects it automatically via both prefers-color-scheme and toggle buttons

© espennilsen, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in skills/extract-design-system of espennilsen/pi.

  • SKILL.md
  • scripts/extract.mjs

Open the folder on GitHubat commit 79d019b

Compare with similar skills

Extract Design System next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Extract Design System compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Extract Design System this skillespennilsen/pi122—~2kAutomated safety check: PassMIT
Using Ouds Web Version Major MinorOrange-OpenSource/Orange-Boosted-Bootstrap222—~4.2kAutomated safety check: PassMIT
Design Systemjezweb/claude-skills1.1k—~2.2kAutomated safety check: NotesMIT
Website Design Systemmacalbert/envilder138—~839Automated safety check: PassMIT
SkilluiCraftOS-dev/CraftBot392—~1.2kAutomated safety check: PassMIT
Frontend Visual QAdaymade/claude-code-skills1.4k—~8.1kAutomated safety check: PassMIT

Similar skills

  • Using Ouds Web Version Major Minor

    Orange-OpenSource/Orange-Boosted-Bootstrap

    Provides comprehensive knowledge of the OUDS Web library (Orange Unified Design System for Web), a Bootstrap-based CSS/JS framework for building Orange-branded web interfaces.

    222 GitHub stars~4.2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Design System

    jezweb/claude-skills

    Extract a complete design system from an existing website or screenshot into a DESIGN.md file.

    1.1k GitHub stars~2.2k tokensUpdated 3 days ago
    Frontend & DesignAuto-check: notes
  • Website Design System

    macalbert/envilder

    Envilder website design system: themes, CSS variables, breakpoints, spacing, typography, and component patterns.

    138 GitHub stars~839 tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Skillui

    CraftOS-dev/CraftBot

    Reverse-engineer any website's, repo's, or local project's design system into a Claude-ready skill via the SkillUI CLI.

    392 GitHub stars~1.2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Frontend Visual QA

    daymade/claude-code-skills

    Audits already-rendered UI and Markdown/Obsidian image layout — web app, deck/slide, dashboard, design-system, or Electron/native app — via real-browser/native-app journeys and a Playwright sweep.

    1.4k GitHub stars~8.1k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Design System

    Ohh-889/skyroc

    Token architecture, component specifications, and slide generation.

    795 GitHub starsUsed in 11 repos~1.7k tokens
    Frontend & DesignAuto-check passed

More from espennilsen/pi

All 36 skills in this repo
  • GitHub

    espennilsen/pi

    Interact with GitHub repos, PRs, issues, CI, and notifications via the pi-github extension commands and gh CLI.

    122 GitHub stars~1k tokensUpdated 17 days ago
    Auto-check passed
  • Skill Creator

    espennilsen/pi

    Create, review, and improve skills for Pi agents. An agent skill from espennilsen/pi.

    122 GitHub stars~2.1k tokensUpdated 17 days ago
    Auto-check passed
  • Dry Code Review

    espennilsen/pi

    Perform a comprehensive DRY (Don't Repeat Yourself) code review on a codebase.

    122 GitHub stars~1.7k tokensUpdated 17 days ago
    Auto-check passed
  • PDF Reader

    espennilsen/pi

    Read and extract content from PDF files — text, tables, metadata, and images.

    122 GitHub stars~1.6k tokensUpdated 17 days ago
    Auto-check passed
  • Google Workspace

    espennilsen/pi

    Manage Google Workspace via the gws CLI — Drive, Gmail, Sheets, Docs, Slides, People, Chat, Meet, Forms, and cross-service workflows.

    122 GitHub stars~3.4k tokensUpdated 17 days ago
    Auto-check passed
  • Herdr Operations

    espennilsen/pi

    A skill your agent uses when inspecting or operating Herdr sessions, workspaces, tabs, panes, agents, terminal output, agent messaging, or waits.

    122 GitHub stars~525 tokensUpdated 17 days ago
    Auto-check passed

Works with

Questions about Extract Design System

What does Extract Design System do?

Reverse-engineer a design system from a live website (public URL or localhost). Extract Design System is an agent skill from espennilsen/pi. Reverse-engineer a design system from a live website (public URL or localhost).

When should I use Extract Design System?

Extract Design System fits situations like: tasks that involve Design systems; tasks that involve Design tokens; tasks that involve Typography.

How do I install Extract Design System in Claude Code?

Run `npx skills add espennilsen/pi --skill extract-design-system -a claude-code`. Or copy the skill folder (skills/extract-design-system in espennilsen/pi) into .claude/skills/extract-design-system in your project. Claude Code loads it when a task matches its description.

How do I install Extract Design System in Codex?

Run `npx skills add espennilsen/pi --skill extract-design-system -a codex`. Or copy the skill folder (skills/extract-design-system in espennilsen/pi) into .agents/skills/extract-design-system in your project. Codex loads it when a task matches its description.

Can I use Extract Design System in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add espennilsen/pi --skill extract-design-system -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/extract-design-system, .gemini/skills/extract-design-system, .github/skills/extract-design-system and .opencode/skills/extract-design-system in your project.

What does Extract Design System need to run?

Going by SKILL.md and its folder, Extract Design System needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node and npx). Our summary lists: Node.js.

Does Extract Design System access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Extract Design System safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Extract Design System use?

Extract Design System is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Extract Design System use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Extract Design System?

Skills that share tags, products or a category with Extract Design System: Using Ouds Web Version Major Minor (Orange-OpenSource/Orange-Boosted-Bootstrap, 222 stars), Design System (jezweb/claude-skills, 1.1k stars), Website Design System (macalbert/envilder, 138 stars) and Skillui (CraftOS-dev/CraftBot, 392 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Extract Design System?

espennilsen (a GitHub user) maintains it in espennilsen/pi, which has 122 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on September 21, 2026.

Source: espennilsen/pi on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.