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.

referencesangular.md

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

Angular Extraction Patterns

Angular projects use a structured, convention-heavy approach to styling. Design systems often live in SCSS/CSS files with clear separation between global themes and component-scoped styles.

File Discovery Order

  1. angular.json — Lists global style files under projects.*.architect.build.options.styles. These are the entry-point CSS/SCSS files.

  2. src/styles.scss / src/styles.css — Global stylesheet. CSS custom properties, font imports, and base styles live here.

  3. src/theme.scss / src/theme/ — Explicit theme directory. Custom Material/component palettes.

  4. Tailwind Config (tailwind.config.js or Tailwind v4 @theme {}) — For Tailwind v3, read tailwind.config.js. For Tailwind v4, inspect @theme {} blocks, @custom-variant, and @plugin 'tailwindcss-primeui' in your global CSS/SCSS (e.g. src/styles.css or src/assets/tailwind.css) for CSS custom property tokens (--color-*, --font-*, --text-*, --breakpoint-*).

  5. src/app/app.component.scss — Root component styles, reveals global layout patterns.

  6. Component .scss / .css files — Co-located styles (ViewEncapsulation scoped by default).

  7. External Template .html files (src/app/**/*.component.html) — Essential for Angular 17+ standalone components using Tailwind CSS utility classes (bg-*, text-*, p-*, rounded-*) or structural class bindings ([ngClass], [class.*]). Always inspect .html templates when styling uses utility classes.

Angular Material Theme Extraction

Angular Material is the most common component library. Themes are SCSS-based:

// src/theme.scss
@use '@angular/material' as mat;

$primary-palette: mat.m2-define-palette(mat.$m2-teal-palette, 800);
$accent-palette: mat.m2-define-palette(mat.$m2-blue-grey-palette);
$warn-palette: mat.m2-define-palette(mat.$m2-red-palette);

$theme: mat.m2-define-light-theme((
  color: (
    primary: $primary-palette,
    accent: $accent-palette,
    warn: $warn-palette,
  ),
  typography: mat.m2-define-typography-config(
    $font-family: 'Manrope, sans-serif',
    $headline-1: mat.m2-define-typography-level(3.5rem, 4rem, 600),
    $headline-5: mat.m2-define-typography-level(1.5rem, 2rem, 500),
    $body-1: mat.m2-define-typography-level(1rem, 1.7, 400),
  ),
));

@include mat.all-component-themes($theme);

What to extract:

  • Palette choices → map to functional color roles
  • Typography config → maps directly to the hierarchy section
  • Light vs dark theme → atmosphere

For Angular Material 3 (MDC-based), look for mat.define-theme() using the new token system with --mat-* CSS custom properties.

SCSS Variable Patterns

Many Angular projects use SCSS variables for tokens:

// _variables.scss
$color-primary: #294056;
$color-background: #FCFAFA;
$color-surface: #F5F5F5;
$color-text: #2C2C2C;

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

$radius-button: 8px;
$radius-card: 12px;

$breakpoint-mobile: 768px;
$breakpoint-desktop: 1024px;

$spacing-section: 5rem;
$spacing-component: 2rem;

These are explicit design tokens. Map them directly.

ViewEncapsulation and Scoped Styles

Angular scopes styles by default (similar to Vue's scoped). When scanning component styles:

  • Look for :host selectors — these style the component's root element
  • ::ng-deep (deprecated but still used) — styles that pierce encapsulation
  • Repeated values across components indicate design system conventions

PrimeNG / Nebular / NG-ZORRO

If component libraries are used:

  • PrimeNG (v17/v18/v19+): Look for modern theme configuration in src/app.config.ts (e.g., providePrimeNG({ theme: { preset: Aura, options: { darkModeSelector: '.app-dark' } } })). Check for Tailwind v4 integration via @plugin 'tailwindcss-primeui' in CSS assets. Inspect CSS custom properties defined by PrimeNG tokens (--primary-color, --surface-*).
  • Nebular: nb-theme() in styles.scss with custom theme object.
  • NG-ZORRO (Ant Design for Angular): ng-zorro-antd.less variables or custom theme config in angular.json.

Modern Angular (v17 - v19) Standalone Components & Control Flow

In modern Angular repositories:

  • Standalone Components (@Component({ standalone: true })): Components import their own dependencies directly without NgModules. Inspect templateUrl and styleUrl(s) in component metadata to locate the template and style files.
  • Control Flow (@if, @for, @switch): Notice how conditional layouts and lists are structured in .html templates when analyzing component density and spacing rules.
  • Signals & Zoneless (signal(), input(), computed(), provideZonelessChangeDetection()): Dynamic styling or theme toggling is often driven by signals bound to [class.dark] or custom CSS classes in templates. Notice app.config.ts for app-wide providers.

Responsive Patterns

Check for:

  • @media queries in styles.scss and component styles
  • Angular CDK BreakpointObserver usage in components
  • Tailwind responsive prefixes if Tailwind is configured
  • Angular Flex-Layout directives (fxLayout, fxFlex) in templates

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.