agentleFS
marc-aurele-besnermarc-aurele-besner/skillable/skills/extract-design-system/SKILL.md

extract-design-system

Skill1 starsChanged 3 months agoMITView on GitHub

Read a project's design language from source, tokens, light/dark themes, typography, spacing, layout shell, breakpoints, component idioms, icons, motion, and copy tone, and publish it once as a living design-system artifact (a browsable token and component gallery in every theme), plus a short drift report of hard-coded values that bypass the tokens. Other skills such as wireframe-feature can then reuse the published system instead of re-extracting it. Use whenever the user wants to document, extract, audit, or visualize their app's design system, build a style guide or component gallery from the codebase, or prepare a reusable design reference for wireframes, decks, or landing pages. Also triggers on /extract-design-system with an optional focus.

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use multi-stage-dockerfile, find-animation-opportunities and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GitHubSkill

    multi-stage-dockerfile

    Create optimized multi-stage Dockerfiles for any language or framework

    Also in 3 projects that use this

  • MicrosoftSkill

    find-animation-opportunities

    Search a codebase or UI for places that don't animate but should, and reject everything that shouldn't. Read-only; it proposes motion with exact values, it does not implement it. Use when the user asks "what could be animated here?" or wants to "make this feel more alive". For fixing existing animations, use improve-animations or review-animations instead.

    Also in 5 projects that use this

  • currents-devSkill

    playwright-best-practices

    Use when writing Playwright tests, fixing flaky tests, debugging failures, implementing Page Object Model, configuring CI/CD, optimizing performance, mocking APIs, handling authentication or OAuth, testing accessibility (axe-core), file uploads/downloads, date/time mocking, WebSockets, geolocation, permissions, multi-tab/popup flows, mobile/responsive layouts, touch gestures, GraphQL, error handling, offline mode, multi-user collaboration, third-party services (payments, email verification), console error monitoring, global setup/teardown, test annotations (skip, fixme, slow), test tags (@smoke, @fast, @critical, filtering with --grep), project dependencies, security testing (XSS, CSRF, auth), performance budgets (Web Vitals, Lighthouse), iframes, component testing, canvas/WebGL, service workers/PWA, test coverage, i18n/localization, Electron apps, or browser extension testing. Covers E2E, component, API, visual, accessibility, security, Electron, and extension testing.

    Also in 3 projects that use this

  • MicrosoftSkill

    improve-animations

    Survey a codebase's animation and motion code as a senior motion advisor, then produce a prioritized audit and self-contained implementation plans for other agents (or cheaper models) to execute. Read-only on source code — it plans improvements, it does not apply them. Use when the user asks to "improve the animations", "audit the motion", "make this app feel better", or wants a roadmap of animation fixes rather than a review of a single diff.

    Also in 5 projects that use this

  • xfstudioSkill

    tailwind-design-system

    Build scalable design systems with Tailwind CSS, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.

    Also in 3 projects that use this

  • OpenAISkill

    image-to-code

    Implement a selected image, screenshot, mockup, or Image Gen reference as a faithful, responsive frontend.

    Also in 4 projects that use this

  • +4 more from microsoft

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before a run of wireframe-feature, so every wireframe starts from the same reference

    line 27
  2. Distinctive:

    Not for designing a *new* visual identity (use frontend-design) or changing the project's styles.

    line 29
  3. Distinctive:

    Do not run a questionnaire.

    line 38
  4. Distinctive:

    Read the sources of truth, not compiled CSS.

    line 42
  5. Distinctive:

    When the agent can run subagents (e.g.

    line 44
  6. Distinctive:

    If the project has only one theme, document only that one.

    line 62
  7. Distinctive:

    Search for values that bypass the system and count them per file:

    line 66
  8. Very specific:

    Otherwise: write design-system-<project>.html outside the tracked tree (a scratch/temp directory) and open it locally.

    line 93

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Extract Design System

Goal: turn the design language that is scattered across a codebase into one page anyone can open, every token with its value per theme, every component idiom rendered live, and the rules that make the app look like itself. Extract once, reuse everywhere: wireframes, decks, landing pages, and onboarding all read from the same published system.

When to use

  • "Document / extract / visualize our design system"
  • "Build a style guide or component gallery from the code"
  • "Which colors and spacing do we actually use? Where do we bypass the tokens?"
  • Before a run of wireframe-feature, so every wireframe starts from the same reference
  • /extract-design-system [focus=tokens|components|all]
  • Not for designing a new visual identity (use frontend-design) or changing the project's styles.

Inputs

InputDefaultNotes
Focusalltokens = foundations only; components = foundations + gallery; all adds layout shell, patterns, and drift report.
Projectcurrent repoMonorepo: ask which app if several have their own UI, or pick the one with the most UI code and say so.

Do not run a questionnaire. Note assumptions in the report.

1. Inventory in parallel

Read the sources of truth, not compiled CSS. references/design-extraction.md lists where to look per stack.

When the agent can run subagents (e.g. Claude Code's Agent tool), split the reading into parallel read-only passes and merge the results, each returns a structured note, not file dumps:

  1. Foundations, color tokens per theme and the theme-switching mechanism, typography (families, sources, scale, weights, line heights), spacing scale, radii, shadows, borders, z-layers, breakpoints, motion (durations, easings).
  2. Components, the UI kit directory (components/ui, packages/ui…): each component's variants, sizes, and states; the icon set; empty, loading, error, and toast idioms.
  3. Shell and patterns, root layout, navigation (real labels and order), page header, content width, responsive behavior per breakpoint, forms, tables vs. cards, dialogs and drawers.
  4. Voice, copy tone from real UI strings (buttons, empty states, errors): sentence vs. title case, person, terminology for core entities.

Without subagents, do the same passes one after another.

2. Normalize

Build one model of the system, keeping the project's own names:

  • Tokens as name → value per theme, grouped (color / type / space / radius / shadow / motion / breakpoint). Resolve aliases (--primary: var(--blue-600)) but show the chain.
  • Semantic vs. primitive tokens: mark which ones components actually reference.
  • Components as name → variants × sizes × states, with the source path of each.
  • A short rules list stated as do/don't, derived from the code ("Primary buttons are always full-width on mobile", "Destructive actions confirm in a dialog, never inline").

If the project has only one theme, document only that one. If it has no real token layer (raw hex in components), say so and present the de-facto palette sorted by usage count.

3. Detect drift

Search for values that bypass the system and count them per file:

# Hard-coded colors in components and styles (adjust globs per stack)
rg -n -g '!node_modules' -g '!*.svg' -g '!**/tokens*' -e '#[0-9a-fA-F]{3,8}\b' -e 'rgba?\(' -e 'hsla?\(' src app components packages 2>/dev/null
# Arbitrary Tailwind values
rg -n -g '!node_modules' -e '\[(#|[0-9]+px)' src app components 2>/dev/null

Report the top offenders (file, count, nearest token) and near-duplicate tokens (two grays within a few ΔE, spacing values off the scale). Do not fix them in this skill, list them so the user can decide.

4. Build the design-system page

One self-contained HTML page (no build step, no network calls except fonts and pinned CDN libraries):

  • Tokens on :root with the project's names, second theme under the project's own mechanism (.dark, [data-theme="dark"]…) and prefers-color-scheme by default, plus a visible theme toggle.
  • Foundations: color swatches (name, value per theme, contrast ratio against its usual background, and a pass/fail flag at WCAG AA), type scale specimens, spacing and radius rulers, shadow tiles, motion demos, breakpoint table.
  • Components: each component rendered live in every variant, size, and state (hover/focus/disabled/loading/error), with its source path and usage notes. Recreate them in plain HTML/CSS with the extracted tokens; they must look like the real ones.
  • Shell and patterns: the layout shell at mobile and desktop widths, form, table/list, dialog, empty/loading/error patterns, with the real nav labels.
  • Voice: tone rules and before/after copy examples.
  • Drift: the findings from step 3.
  • A sticky in-page nav and a search box that filters tokens and components.
  • Responsive: no horizontal scroll at 375 px.

5. Publish and record

  • Artifact-capable agent (e.g. Claude Code with an artifact tool): if the agent offers a Design System artifact type, create the system from that type and fill it with the extracted foundations and components; otherwise publish the page from step 4 as an artifact titled <Project> Design System. Republish to the same URL on later runs so links stay stable.
  • Otherwise: write design-system-<project>.html outside the tracked tree (a scratch/temp directory) and open it locally.
  • Record the location so other skills find it: offer to add one line to the project's agent instructions file (CLAUDE.md, AGENTS.md, or .cursor/rules), e.g. Design system: <url> (generated by extract-design-system on <date>). Only write it when the user agrees, and commit it only if they ask.

6. Report

**<Project> design system** · themes: <list> · <N> tokens · <M> components · <link>

**Foundations:** <one line each: palette, type, spacing, radius, motion, breakpoints>
**Theme mechanism:** <e.g. next-themes, class="dark" on <html>>
**Drift:** <K> hard-coded values in <F> files, top 3: <file (count) → nearest token>
**Contrast:** <pairs failing WCAG AA, or "all pass">
**Assumptions:** <bullets>
**Reuse:** wireframe-feature reads this system when it is recorded in <file>.

7. Refresh

On a later run, diff against the published version: list added, removed, and changed tokens and components, then republish in place. Never create a second artifact for the same project unless asked.

Quality bar before reporting

  • Every token shown with the project's own name and its value in every theme
  • Theme toggle switches every surface; no hard-coded colors in the page itself
  • Components rendered live in all their variants and states, each with a source path
  • Drift findings cite files and counts; nothing in the project was modified
  • No secrets, internal URLs, or real user data in the page

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.