/product-skills:design-system-leadfrom product-skills
Generates design tokens from a brand color with WCAG contrast checks, scaffolds component specs, and audits design system adoption from per-product CSV data.
Ships in product-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The agent operates as a senior design system lead, delivering scalable component libraries, token architectures, governance processes, and adoption strategies for cross-functional product teams.
Before generating the design system, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
| Level | Characteristics | Focus |
|---|---|---|
| 1: Emerging | Ad-hoc styles, no standards | Establish foundations |
| 2: Defined | Documented guidelines | Component library |
| 3: Managed | Shared component library | Adoption, governance |
| 4: Optimized | Automated, measured | Continuous improvement |
Three-tier token system (primitive -> semantic -> component):
{
"color": {
"primitive": {
"blue": {
"50": {"value": "#eff6ff"},
"500": {"value": "#3b82f6"},
"600": {"value": "#2563eb"},
"900": {"value": "#1e3a8a"}
}
},
"semantic": {
"primary": {"value": "{color.primitive.blue.600}"},
"primary-hover": {"value": "{color.primitive.blue.700}"},
"background": {"value": "{color.primitive.gray.50}"},
"text": {"value": "{color.primitive.gray.900}"}
},
"component": {
"button-primary-bg": {"value": "{color.semantic.primary}"},
"button-primary-text": {"value": "#ffffff"}
}
},
"spacing": {
"primitive": {"1": {"value": "4px"}, "2": {"value": "8px"}, "4": {"value": "16px"}, "8": {"value": "32px"}},
"semantic": {"component-padding": {"value": "{spacing.primitive.4}"}, "section-gap": {"value": "{spacing.primitive.8}"}}
},
"typography": {
"fontFamily": {"sans": {"value": "Inter, system-ui, sans-serif"}, "mono": {"value": "JetBrains Mono, monospace"}},
"fontSize": {"sm": {"value": "14px"}, "base": {"value": "16px"}, "lg": {"value": "18px"}, "xl": {"value": "20px"}}
}
}
// style-dictionary.config.js
module.exports = {
source: ['tokens/**/*.json'],
platforms: {
css: {
transformGroup: 'css',
buildPath: 'dist/css/',
files: [{ destination: 'variables.css', format: 'css/variables' }]
},
scss: {
transformGroup: 'scss',
buildPath: 'dist/scss/',
files: [{ destination: '_variables.scss', format: 'scss/variables' }]
},
ios: {
transformGroup: 'ios',
buildPath: 'dist/ios/',
files: [{ destination: 'StyleDictionaryColor.swift', format: 'ios-swift/class.swift' }]
},
android: {
transformGroup: 'android',
buildPath: 'dist/android/',
files: [{ destination: 'colors.xml', format: 'android/colors' }]
}
}
};
design-system/
+-- foundations/ (colors, typography, spacing, elevation, motion, grid)
+-- components/
| +-- primitives/ (Button, Input, Icon)
| +-- composites/ (Card, Modal, Dropdown)
| +-- patterns/ (Forms, Navigation, Tables)
+-- layouts/ (page templates, content layouts)
+-- documentation/ (getting-started, design guidelines, code guidelines)
+-- assets/ (icons, illustrations, logos)
## Variants
- Primary: main action
- Secondary: supporting action
- Tertiary: low-emphasis action
- Destructive: dangerous/irreversible action
## Sizes
- Small: 32px height, 8px/12px padding
- Medium: 40px height (default), 10px/16px padding
- Large: 48px height, 12px/24px padding
## States
Default -> Hover -> Active -> Focus -> Disabled -> Loading
## Props
| Prop | Type | Default | Description |
|-----------|-------------|-----------|------------------|
| variant | string | 'primary' | Visual style |
| size | string | 'medium' | Button size |
| disabled | boolean | false | Disabled state |
| loading | boolean | false | Loading state |
| leftIcon | ReactNode | - | Leading icon |
| onClick | function | - | Click handler |
## Accessibility
- Minimum touch target: 44x44px
- Visible focus ring on keyboard navigation
- aria-label required for icon-only buttons
- aria-busy="true" when loading
import { cva, type VariantProps } from 'class-variance-authority';
const buttonVariants = cva(
'inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50',
{
variants: {
variant: {
primary: 'bg-primary text-primary-foreground hover:bg-primary/90',
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
},
size: {
sm: 'h-8 px-3 text-sm',
md: 'h-10 px-4 text-sm',
lg: 'h-12 px-6 text-base',
},
},
defaultVariants: { variant: 'primary', size: 'md' },
}
);
1. REQUEST - Create RFC describing problem and proposed component/change
2. REVIEW - Design review + engineering review + accessibility review
3. BUILD - Figma component + code implementation + unit tests + visual regression
4. DOCUMENT - API docs + usage guidelines + Storybook stories
5. RELEASE - SemVer bump + changelog + announcement
| Change Type | Version Bump | Examples |
|---|---|---|
| Breaking | MAJOR | Component API change, token rename |
| New feature | MINOR | New component, new variant, new token |
| Bug fix | PATCH | Style fix, docs update, perf improvement |
Illustrative layout only (the numbers are an example, not data from any real product; run adoption_analyzer.py on your own CSV):
Design System Health
Adoption: 82% (12/15 products)
Component Usage: 78% (45 components)
Token Compliance: 95%
Overrides: 23 (down from 38)
Efficiency
Avg time to build new feature: 3.2 days (was 5.1)
Custom components created this quarter: 4 (was 12)
All three tools use only the Python standard library, take their input from arguments or a file, and share one exit-code contract.
| Code | Meaning |
|---|---|
| 0 | Done / clean |
| 1 | Findings to act on (adoption gaps; a brand color that fails WCAG AA with white text) |
| 2 | Unusable input (one-line BLOCKED: ... message on stderr, no traceback) |
Generates a three-tier token set (primitive, semantic, component) from a brand color. The brand color is exactly step 500 of the scale. The semantic primary is the lightest step from 500 up that gives at least 4.5:1 against white (WCAG 2.x AA, normal text); when 500 itself fails, the tool says so, names the step it used, and exits 1. CSS/SCSS output has every {reference} resolved to a literal value.
| Flag | Description |
|---|---|
--color, -c | Required. Brand color, #rgb or #rrggbb |
--format, -f | text (summary, default), json, css, scss |
--tiers, -t | all (default), primitive, semantic, component |
--output, -o | Directory to write tokens.css / tokens.scss into |
--json | Alias for --format json |
python3 scripts/token_gen.py --color "#FFD60A"
python3 scripts/token_gen.py --color "#0066CC" --format css --output dist/
python3 scripts/token_gen.py --color "#8B4513" --tiers primitive --format json
Real output for a light brand color (exit 1):
CONTRAST (white text on fill, WCAG 2.x AA needs 4.5:1)
blue.500 #ffd60a: 1.41:1 FAIL
blue.800 #796400: 5.78:1 PASS
Findings
- [brand-contrast] --color #ffd60a: white text on #ffd609 (blue.500) = 1.41:1 (need >= 4.5:1 (WCAG 2.x AA, normal text))
fix: primary is mapped to blue.800 (#796400, 5.78:1) instead of blue.500; use a darker brand color if blue.500 must be the button fill
FIX 1 issue
Generates a component spec scaffold: anatomy, variants, sizes, states, props table, proposed token mapping, accessibility requirements, usage guidelines, file layout and test checklist. Variants and sizes come from your arguments (category defaults otherwise). The token names it lists are proposals; define them in your token set.
| Flag | Description |
|---|---|
--name, -n | Required. PascalCase component name |
--category, -c | Required. primitive, composite or pattern |
--variants, -v | Comma-separated variant names |
--sizes, -s | Comma-separated size names |
--format, -f | text (default) or json (--json alias) |
python3 scripts/component_scaffold.py --name Button --category primitive
python3 scripts/component_scaffold.py --name DataTable --category pattern --variants "default,compact,striped"
python3 scripts/component_scaffold.py --name Modal --category composite --format json
Reads a per-product CSV and reports component coverage, token compliance, override rate and a health score. Every finding quotes the CSV line, states the threshold and gives a concrete fix (for example how many components to migrate). The targets (80% coverage, 90% token compliance, 85 a11y, at most 10 overrides) and the 30/30/20/20 health-score weights are internal heuristics from this skill's success criteria, not industry benchmarks. Rows that cannot be parsed are reported with their line number and skipped; a missing column or an empty file exits 2.
CSV columns: product, total_components, ds_components, total_tokens, ds_tokens, custom_overrides, a11y_score and optional last_audit.
| Flag | Description |
|---|---|
input / --input | CSV file, or - for stdin |
--threshold, -t | Health score below this is flagged (default 75) |
--format, -f | text (default) or json (--json alias) |
--demo | Run on built-in example rows, labelled DEMO DATA |
python3 scripts/adoption_analyzer.py assets/flawed_adoption.csv
python3 scripts/adoption_analyzer.py adoption.csv --threshold 80 --format json
Real output (exit 1):
Product Coverage Tokens A11y Health
Marketing Site 66.7% 70.0% 78 56.6 *
- [component-coverage] line 3 (Marketing Site): ds_components=30 of total_components=45 (66.7%) (need >= 80% (internal target))
fix: migrate at least 6 of the 15 custom components to reach 80%
Samples live in assets/ (sample_adoption.csv exits 0, flawed_adoption.csv exits 1, malformed_adoption.csv exits 2); assets/contract.json lists every run.
| Problem | Cause | Solution |
|---|---|---|
| Token overrides in production | Teams bypassing design system | Run adoption_analyzer monthly; add lint rules for hardcoded values |
| Inconsistent component behavior across products | Version drift | Enforce SemVer; automate DS dependency updates in CI |
| Low adoption in older products | Migration cost perceived as too high | Prioritize high-traffic pages; create migration guides per product |
| Token naming conflicts | No naming convention enforced | Adopt CTI (Category-Type-Item) naming; document in governance |
| Component API breaking changes | Insufficient versioning discipline | Use codemods for migration; deprecation period of 2 minor versions |
| Designers and developers out of sync | Figma/code token drift | Use Tokens Studio plugin; sync on every release |
| Contribution bottleneck | RFC review queue backed up | Set SLA for reviews (48h); rotate reviewers weekly |
| Criterion | Target | How to Measure |
|---|---|---|
| Component coverage | >80% across all products | adoption_analyzer component coverage metric |
| Token compliance | >90% (no hardcoded values) | adoption_analyzer token compliance metric |
| Custom overrides | Trending downward quarter-over-quarter | Track total overrides in adoption report |
| Time to build new feature | 30%+ reduction vs pre-DS baseline | Compare sprint velocity before/after DS adoption |
| Accessibility score | >85% across all products | adoption_analyzer a11y score |
| Contribution rate | 2+ external contributions per quarter | Track merged RFCs from non-core-team members |
| Design-dev handoff time | <1 day for standard components | Measure time from design approval to code PR |
In scope:
Out of scope:
| Tool / Platform | Integration Method | Use Case |
|---|---|---|
| Figma / Tokens Studio | Import token_gen JSON output | Sync design tokens between design and code |
| Style Dictionary | Use token_gen JSON as source | Build multi-platform tokens (iOS, Android, web) |
| Storybook | component_scaffold output as stories template | Auto-generate component documentation |
| Chromatic / Percy | Pair with component_scaffold test checklist | Visual regression testing pipeline |
| CI/CD | adoption_analyzer --format json in pipeline (exit 1 fails the job) | Automated adoption health checks on PRs |
| Tailwind / CSS-in-JS | token_gen CSS/JSON export | Theme configuration from design tokens |
assets/contract.json (opens in a new tab)assets/flawed_adoption.csv (opens in a new tab)assets/malformed_adoption.csv (opens in a new tab)assets/sample_adoption.csv (opens in a new tab)scripts/adoption_analyzer.py (opens in a new tab)scripts/component_scaffold.py (opens in a new tab)scripts/token_gen.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub borghei/claude-skills --plugin product-skills15 skills in this plugin
/ab-test-setupCheck an A/B hypothesis, size the test, and analyse results from a CSV with data-quality checks (sample ratio mismatch, small counts, multiple variants). Use when planning an experiment, calculating sample size or duration, reading experiment results, or when someone says "let's test that."
/agile-product-ownerAgile product ownership for backlog management and sprint execution. Use when you have an epic to turn into INVEST-checked user stories with acceptance criteria, oversized stories to split, a sprint to load to capacity, or a backlog to prioritize.
/apple-hig-expertApple Human Interface Guidelines expert across iOS, iPadOS, macOS, watchOS, tvOS, and visionOS. Use when designing or reviewing an Apple-platform app, auditing for HIG compliance, picking native components, or validating accessibility. Use when you have a screen inventory (JSON of true/false flags per screen) to audit, or a UX goal to map to a native pattern.
/design-directionTurns a product brief into a design-system spec: style direction, contrast-checked palette, type pairing, tokens, UX rules and chart choices. Use when starting a new product's UI, picking a palette or fonts, or auditing a token file.
/product-analyticsProduct analytics checks for metric trees, event taxonomies and retention cohorts. Use when reviewing a North Star and its input metrics, auditing an event inventory for naming, PII and gaps, or reading cohort retention tables for curve shape and trend. Reads your JSON, exits 0/1/2.
/product-designerTurns user research into design decisions: journey maps with gap checks, SUS and task scoring, design critique and flow critique. Use when mapping a journey, scoring a usability test, or critiquing a flow before it ships.
Other plugins' skills for the same job