get_design_systems Architecture

Extract design systems from crawled CSS — grid layout, breakpoints, spacing scale, and CSS custom properties

Overview

Part of the Architecture Toolkit (Phase 4). After CSS is collected during page discovery, DoneDone.Run groups stylesheets by their co-occurrence across pages and uses LLM analysis to extract structural CSS properties: grid system configuration, responsive breakpoints, spacing scales, and CSS custom properties (variables). Pages sharing the same stylesheet set are grouped into one design system.

How It Works

  1. During page discovery, external stylesheets (<link rel='stylesheet'>) and inline <style> blocks are collected and stored for each page.
  2. After shared element deduplication completes, CSS is grouped by stylesheet URL sets — pages sharing the same CSS files form one design system group.
  3. An LLM analyzes the combined CSS for each group to extract grid system rules, responsive breakpoints, spacing scale tokens, and CSS custom properties.
  4. A second LLM pass links per-component styles to shared page elements (headers, footers, navs, sidebars, widgets) discovered in Phase 1.
  5. Results are stored in the database with model provenance and linked to their source stylesheets.

Input Parameters

ParameterTypeRequiredDescription
job_id string required The clone job ID returned by discover_all_pages

What You Get Back

Example Use Case

An agent calls get_design_systems after discovery to learn that airbornesensor.com uses a 12-column grid with 24px gaps, 5 breakpoints (xs: 480px through xl: 1280px), a spacing scale from 4px to 64px, and 23 CSS custom properties. The agent uses this to configure Tailwind or write matching CSS for the cloned site.

Tips

Runs automatically after discover_all_pages completes and shared elements are stable — no manual trigger needed.
Multiple design systems are extracted when different sections of a site use different CSS (e.g. main site vs blog).
CSS custom properties include both names and default values, ready for your variables file.
Combine with get_component_styles for full per-element CSS mapping.
Re-running discovery will re-extract design systems with fresh CSS analysis.

Related Tools