All skills
google-labs-code avatar

/extract-design-md

@681a283 official

Extract a comprehensive design system (DESIGN.md) directly from frontend source code — React, Vue, Svelte, Angular, plain HTML/CSS, or any web framework. Analyzes component files, stylesheets, Tailwind configs, theme definitions, and design tokens to produce a rich, Stitch-compatible design system document. Use this skill whenever the user wants to reverse-engineer a design system from an existing codebase, audit the visual language of a project, extract design tokens from source files, or understand the styling patterns in a frontend repo — even if they just say "what does this app look like?" or "pull out the design from this code."

  • 7 files
  • 39.7 KB
  • Updated 5 months ago
  • GitHub

Use this Skill: https://skilld.dev/gh/google-labs-code/stitch-skills/extract-design-md

This session only. Nothing lands on disk.

referencessvelte.md

≈679 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Svelte / SvelteKit Extraction Patterns

Svelte co-locates styles even more tightly than Vue. Every .svelte file has a <style> block that is scoped by default. Design systems in Svelte projects typically live in global CSS, CSS custom properties, or a shared theme store.

File Discovery Order

  1. src/app.css / src/app.postcss — Global styles and CSS custom properties. The most important file.

  2. svelte.config.js — May reference CSS preprocessors, Tailwind, or UnoCSS configuration.

  3. tailwind.config.js (if Tailwind/UnoCSS) — Same extraction as React.

  4. src/lib/theme.ts / src/lib/tokens.ts — Shared design tokens exported as JS objects.

  5. src/routes/+layout.svelte — Root layout. Shows global font loading, background, and structural patterns.

  6. Component <style> blocks — Scoped styles revealing component patterns.

Svelte Component Style Patterns

<script>
  export let variant = 'primary'
</script>

<button class="btn btn-{variant}">
  <slot />
</button>

<style>
  .btn {
    border-radius: 8px;
    padding: 0.875rem 2rem;
    font-weight: 500;
    transition: all 250ms ease-in-out;
  }

  .btn-primary {
    background-color: var(--color-primary);
    color: white;
  }

  .btn-primary:hover {
    filter: brightness(0.9);
  }
</style>

Extraction points:

  • Component props (like variant) reveal the intended variant system
  • var(--*) references → trace to app.css
  • Transition values reveal the interaction design philosophy

SvelteKit Layout Patterns

  • +layout.svelte at route root — Global header, footer, font loading
  • +layout.ts/js — May load theme data or tokens
  • $lib/ directory — Reusable components and shared utilities

CSS Custom Properties Strategy

Svelte projects heavily use CSS custom properties for theming:

/* app.css */
:root {
  --color-primary: #294056;
  --color-bg: #FCFAFA;
  --color-surface: #F5F5F5;
  --color-text: #2C2C2C;
  --color-text-muted: #6B6B6B;

  --font-heading: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-full: 9999px;

  --shadow-hover: 0 2px 8px rgba(0,0,0,0.06);
  --spacing-section: 5rem;
}

These variable names are highly intentional. Use them as the foundation of your design system extraction.

Skeleton UI / DaisyUI / Flowbite-Svelte

If component libraries are used:

  • Skeleton UI: Theme defined in tailwind.config.js using Skeleton's design token system. Look for custom theme config object.
  • DaisyUI: Theme in tailwind.config.js → daisyui.themes array.
  • Flowbite-Svelte: Standard Tailwind theming.

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at 681a283. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Steadyupdated 5 months ago
What it can do
Runs commands Reads files Edits files
All 5 allowed tools
stitch*:*BashReadWriteweb_fetch

README badge

README badge for google-labs-code/stitch-skills/extract-design-md

Analyzes frontend source code (React, Vue, Svelte, Angular, plain CSS) to extract a comprehensive design system document (DESIGN.md) that captures colors, typography, spacing, and component patterns without building or rendering the app. Use this when you need to audit styling, document visual language, or understand design tokens directly from source files.

Generated from the current SKILL.md.

Does this skill work without building or running the app?
Yes. It reads source files directly — stylesheets, component files, theme configs, Tailwind setups — so you don't need dependencies installed or the app running.
What frameworks does this skill support?
React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Angular, and plain CSS/SASS/Less. It also handles CSS-in-JS libraries like styled-components and Emotion, plus Tailwind and design token files.
What does the output look like?
A DESIGN.md file placed at `.stitch/DESIGN.md` with YAML frontmatter and sections covering visual theme, color palette, typography, component styles, layout principles, and Stitch generation notes.
Can this extract colors, fonts, and spacing from Tailwind config?
Yes. The skill reads tailwind.config.js/ts to extract custom colors, fonts, and spacing scales, along with scanning component files and stylesheets.
Is this skill different from the design-md skill?
Yes. The design-md skill analyzes rendered HTML. This skill works from source code only, making it faster and useful when the app can't be built or run.

Generated from the current SKILL.md. These answers refresh after source changes.