Getting Started
Measure how much of your codebase actually uses your design system. Find unused components, duplicates, and adoption gaps.
Why This Exists
Adoption is the #1 challenge in design systems. Teams build component libraries but can't prove they're being used. Satisfaction can drop from 68% to 31% within a year while "adoption" metrics look healthy.
ds-coverage gives you real numbers: which components are imported, how often, and what's being reimplemented locally instead.
Installation
# Run directly (no install) npx ds-coverage src/ --ds @acme/ui # Or install globally npm i -g ds-coverage
Usage
# Basic scan ds-coverage src/ --ds @acme/ui # Multiple packages ds-coverage . --ds @acme/ui,@acme/icons # With component inventory (finds unused) ds-coverage src/ --ds @acme/ui --inventory components.json # Markdown report ds-coverage src/ --ds @acme/ui --format markdown --out coverage.md # CI threshold (fail below 70%) ds-coverage src/ --ds @acme/ui --inventory components.json --min 70
CLI Options
What It Measures
How many DS components appear in import statements across the codebase
Total number of DS import occurrences — measures adoption depth
Local components imported from relative paths — potential DS candidates
Local components with the same name as DS components — likely reimplementations
DS components never imported anywhere — deprecation candidates (requires --inventory)
Healthy Codebase
A team that actively uses their design system:
Low Adoption
A codebase where teams bypass the design system:
Inventory File
To detect unused components, provide a JSON file listing all exports from your DS package:
Array format
["Button", "Card", "Modal", "Tooltip", "Badge", "Input", "Select"]
Object format
{
"components": ["Button", "Card", "Modal", "Tooltip", "Badge"]
}You can also point to the index file of your DS package — ds-coverage will parse its exports.
CI Integration
# GitHub Actions - name: Check DS adoption run: npx ds-coverage src/ --ds @acme/ui --inventory components.json --min 60 # Generate PR report - name: DS Coverage Report run: npx ds-coverage src/ --ds @acme/ui --format markdown --out coverage.md
--min exits with code 1 when coverage is below the threshold.
Pipeline
ds-coverage is the adoption layer in the design system workflow: