skills/extract-design-system/SKILL.md
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
npx skillsauth add espennilsen/pi extract-design-systemInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reverse-engineer a complete design system from a live website using two passes:
npx playwright install chromium if not set up)web_fetch tool for fetching raw HTML/CSS sourceRun the extraction script against the target URL:
node scripts/extract.mjs <url> [outDir] [subpage1,subpage2,...]
Examples:
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:
| Breakpoint | Device | Viewport | DPR | Real image size | |------------|--------|----------|-----|-----------------| | Mobile | iPhone 15 | 393×659 | 3x | 1179×1977 | | Tablet | iPad Pro 11 | 834×1194 | 2x | 1668×2388 | | Desktop | — | 1440×900 | 2x | 2880×1800 | | Wide | — | 1920×1080 | 2x | 3840×2160 |
Mobile and tablet use Playwright's built-in device descriptors (correct UA,
isMobile, hasTouch) so sites serving different layouts render correctly.
{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
node scripts/extract.mjs "TARGET_URL" "extracted-design-system" "/about,/pricing"
The script automatically:
prefers-color-scheme emulation and toggle sniffingThe script captures computed values. This step catches declared values from CSS source that may not be active on the current page:
# 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
Review raw/colors.json, raw/typography.json, raw/spacing.json and the
screenshots. Then organize into a structured token file.
Group extracted colors into categories:
| Category | What to look for | |----------|-----------------| | Primary | Brand color, CTA buttons, most prominent accent | | Secondary | Supporting accent, secondary buttons | | Neutral | Backgrounds, text, borders — the gray scale | | Success | Green tones (confirmations, checkmarks) | | Warning | Yellow/amber tones (alerts) | | Error | Red tones (errors, delete actions) | | Info | Blue tones (informational messages) |
Deduplicate near-identical colors (ΔE < 3 in OKLCH space). A site with 47 slightly different grays probably intended 5-8.
Map extracted font sizes to a named scale:
| Name | Size range | |------|-----------| | caption | ≤12px | | small | 13-14px | | body (base) | 15-16px | | large | 17-18px | | h6-h1 | 18-48px | | display | 48px+ |
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.
For each component in the screenshots, document:
Write the organized data to tokens.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"] } }
}
If requested, create a Penpot project from the tokens using pi-penpot:
Map tokens to a Tailwind config with CSS custom properties for runtime theming.
slowMo in the script for faster extraction once verifiedprefers-color-scheme and toggle buttonstools
# pi-a2a Long-Running Tasks Skill ## Overview The pi-a2a extension supports **long-running tasks** that can execute for hours or days without timeouts. This is essential for: - Data processing pipelines - Batch operations - Research and aggregation tasks - External API jobs with unpredictable duration - Any A2A task that exceeds the standard timeout ## When to Use **Use long-running tasks when:** - Task execution time is unpredictable or known to exceed 10 minutes - The remote agent is proc
development
Orchestrate cmux terminal panes — split terminals, run parallel processes, read output from other panes, and use the built-in browser. Use when working inside cmux and you need to run a dev server, watch tests, spawn sub-agents, or preview web pages.
testing
Review UI designs and implementations for accessibility, consistency, usability, and visual quality. Use when asked to review a design, audit accessibility, check UI consistency, compare implementation against mockups, or evaluate a user interface.
tools
Create, review, and improve skills for Pi agents. A skill is a folder with a SKILL.md that teaches an agent specialized workflows, domain knowledge, or tool integrations. Use when asked to create a new skill, improve an existing skill, review a skill for quality, scaffold a skill from a workflow, or convert documentation into a skill. Also triggers on "make a skill for", "build a skill", "skill for [topic]", "teach the agent to", or "package this workflow as a skill".