Brand Extractor
Extracts core visual brand identity, design tokens, and structured design systems from live websites and web sources, translating real-world interfaces into a formal Google Labs DESIGN.md Alpha specification and brand_dna.json.
When to Use This Skill
- Extracting the design system and brand identity of an existing website or web app.
- Capturing high-fidelity full-page and viewport screenshots for multimodal visual analysis.
- Extracting computed CSS styles and
:rootCSS custom properties (--color-*,--spacing-*,--radius-*, typography) as ground truth tokens. - Synthesizing a machine-readable
DESIGN.mdspecification adhering strictly to the Google Labs Design Alpha spec. - Preparing brand context and design tokens for downstream image generation (via
brand-image-generator).
Progressive Disclosure & Reference Architecture
DESIGN.mdAlpha Specification: Readreferences/DESIGN_MD_SPEC.mdfor normative token schemas, typed token groups, aliasing syntax, and required##Markdown sections.- Brand DNA Schema: Read
references/BRAND_DNA_SCHEMA.mdfor the structured JSON schema ofbrand_dna.json. - Extraction Script: Run
scripts/extract_brand_dna.pyto capture screenshots and extract computed CSS variables. - Validation Script: Run
scripts/validate_design_md.pyto enforce strict conformance of generatedDESIGN.mdfiles. - Templates:
assets/design_md.template— Conformance template forDESIGN.md.assets/brand_dna.template.json— Schema template forbrand_dna.json.
Procedural Workflow
Step 1: Execute Automated Web Extraction
Run scripts/extract_brand_dna.py against the target URL:
scripts/extract_brand_dna.py --url https://example.com --output ./brand-outputThe script performs the following operations:
- Launches headless Chrome (
1920x1080viewport), prepares the page by dismissing cookie banners/modals, and scrolls to trigger lazy loading. - Captures
source_screenshot_1_viewport.pngandsource_screenshot_1_full.png. - Injects DOM extraction JavaScript to record computed styles (
fontFamily,fontSize,fontWeight,lineHeight,color,backgroundColoronh1,h2,p,body) and:rootCSS custom properties intoextracted_css_tokens.json. - Discovers candidate internal links (About, Pricing, Product) and captures secondary page screenshots (
source_screenshot_2_*.png).
Fallback: If headless Chrome is unavailable, the script falls back to HTTP fetching and CSS extraction via BeautifulSoup.
Step 2: Synthesize Brand DNA (brand_dna.json)
Analyze the captured visual screenshots alongside extracted_css_tokens.json:
- Colors: Map extracted hex values and dominant visual cues to primary, background, surface, text, and accent roles.
- Fonts: Identify headline and body typefaces and classify typography family (e.g. Neo-Grotesque Sans-serif, Humanist Sans, Serif).
- Tone: Select 3-5 evocative tone keywords (e.g.,
["minimalist", "kinetic", "austere"]). - Summary: Draft a concise, authoritative paragraph defining the brand's aesthetic positioning.
Save to ./brand-output/brand_dna.json conforming to references/BRAND_DNA_SCHEMA.md.
Step 3: Synthesize DESIGN.md (Alpha Spec)
Generate DESIGN.md adhering strictly to the Google Labs Design Alpha specification:
-
YAML Frontmatter (Delimited by
---):version: 1.0colors: Semantic hex map containing at minimumprimary,background,surface, andtext.typography: Font family, weights, and scale for headlines and body.spacing: Scale tokens (e.g.,sm: 4px,md: 8px,lg: 16px).rounded: Corner radius tokens (e.g.,sm: 4px,md: 8px,full: 9999px).components: Core component token definitions.
-
Standardized Markdown Sections (Strict
##headings):## Overview: Visual identity summary.## Colors: Palette roles and usage rules.## Typography: Type scale, hierarchy, and font fallbacks.## Layout: Grid, container widths, and whitespace strategy.## Elevation & Depth: Shadow diffusion, surface layers, and borders.## Shapes: Border radii and geometric treatment.## Components: Key UI component patterns.## Do's and Don'ts: Explicit design dos and don'ts.
Step 4: Validate DESIGN.md
Always validate the generated DESIGN.md file using the bundled validator:
scripts/validate_design_md.py ./brand-output/DESIGN.mdEnsure 0 errors before proceeding.
Step 5: Downstream Image Generation Hand-off
Once DESIGN.md and brand_dna.json are validated, transition to the brand-image-generator skill (plugins/brand-identity/skills/brand-image-generator) to produce brand-aligned visual assets, marketing graphics, or UI mockups.