Manage the local design library at ~/.claude/design-library — register extracted brands, update index.json, list installed designs, apply a stored brand to a target project via apply_design.py. Trigger on 'register this brand'; 'list installed designs'; 'apply Linear style to my project'; 'show me what is in the design library'; 'install the extracted brand into this repo'; 'update the design index'; 'which brands are in my library'; 'apply the Stripe extraction to my Next.js app'; 'register the extraction in the library'; 'pull a design from the library'. Do NOT trigger for: 'package manager', 'library science', npm/pip/uv library questions, book libraries, general dependency management, or 'library' in the sense of a code library unrelated to extracted design systems.
~/.claude/design-library/index.json at the end of an extractionapply_design.py) — tokens copied, tailwind config merged, variables wiredThe design library lives at ~/.claude/design-library/. It is a local-only registry of extracted brand design systems. Two Python scripts manage it:
scripts/update_library_index.py — maintains the master index and brand registrationscripts/apply_design.py — installs brand artefacts into a target project directory~/.claude/design-library/
index.json # Master registry of all brands
brands/
<slug>/
metadata.json # Brand metadata (name, source_url, scores, categories)
DESIGN.md # Rendered brand document
design-tokens.css # CSS custom properties
design-tokens.json # Raw token data
screenshot-desktop.png # Desktop screenshot
patterns.json # Pattern signal output
voice-analysis.json # Voice analysis output
assets/ # SVG logos, favicons, icons
The index.json file at ~/.claude/design-library/index.json has this structure:
{
"version": "0.1.0",
"updated_at": "2026-04-10T00:00:00Z",
"brands": [
{
"slug": "westpac",
"name": "Westpac",
"source_url": "https://www.westpac.com.au",
"extracted_at": "2026-04-10",
"extractor_version": "0.1.0",
"overall_score": 0.95,
"confidence": "HIGH",
"categories": ["banking", "finance"],
"synthetic": false,
"path": "/Users/mehran/.claude/design-library/brands/westpac"
}
]
}
Each brand record contains:
| Field | Type | Description |
|---|---|---|
| slug | string | URL-safe identifier, derived from brand name or domain |
| name | string | Human-readable brand name |
| source_url | string | Original URL the design was extracted from |
| extracted_at | string | ISO date of extraction |
| extractor_version | string | Version of design-extractor that produced this extraction |
| overall_score | float or null | Aggregate quality score (0.0-1.0) from validation pipeline |
| confidence | string | HIGH / MEDIUM / LOW / UNKNOWN |
| categories | string[] | Industry or style category tags |
| synthetic | boolean | True for generated/synthetic design systems (e.g., Nimbus) |
| path | string | Absolute path to the brand directory on disk |
python scripts/update_library_index.py --list
The script prints one line per brand:
westpac https://www.westpac.com.au score=0.95 HIGH
woolworths-com-au https://www.woolworths.com.au score=0.88 HIGH
nimbus https://nimbus.example.com score=0.95 HIGH
The script prints (library is empty). Run an extraction first using the design-extraction skill.
The brand directory at ~/.claude/design-library/brands/<slug>/ must contain a metadata.json file. This file is produced by the extraction pipeline and contains:
{
"name": "Westpac",
"source_url": "https://www.westpac.com.au",
"extracted_at": "2026-04-10",
"extractor_version": "0.1.0",
"overall_score": 0.95,
"confidence": "HIGH",
"categories": ["banking", "finance"],
"synthetic": false
}
python scripts/update_library_index.py \
--add westpac \
--metadata ~/.claude/design-library/brands/westpac/metadata.json
The script prints:
registered westpac in /Users/mehran/.claude/design-library/index.json
If the brand slug already exists in the index, the old entry is replaced (upsert behaviour). Brands are sorted alphabetically by slug in the index.
python scripts/update_library_index.py --list
Verify the new brand appears with correct score and confidence.
python scripts/update_library_index.py --remove westpac
The script prints:
removed westpac from /Users/mehran/.claude/design-library/index.json
If the slug was not in the index, the script prints a warning and exits with success: