A comprehensive CLI-based auditing tool that evaluates the health, structure, and completeness of code-based design systems. It provides deep insights into component quality, token usage, documentation completeness, and overall system maturity with actionable recommendations for improvement.
- π Comprehensive Analysis: Audits 6 critical aspects of design systems
- π Interactive Dashboard: Real-time visualization with Chart.js
- π€ AI-Powered Insights: Optional Claude API integration for intelligent recommendations
- π Smart Scoring: Weighted category grades (A-F) with detailed metrics
- π― Actionable Recommendations: Priority-sorted with effort/impact analysis
- π Token Coverage Analysis: Advanced detection of hardcoded values vs. design tokens
- βΏ Accessibility Focus: WCAG compliance checking and recommendations
- π Multiple Output Formats: Markdown reports, JSON data, and HTML dashboard
# Clone the repository
git clone https://github.com/[yourusername]/dsaudit.git
cd dsaudit
# Install dependencies
npm install
# Build the tool
npm run build
# Link globally for CLI usage
npm link# After linking, navigate to your design system project
cd /path/to/your/design-system
# Run the audit
dsaudit init# From the dsaudit directory
node /path/to/dsaudit/dist/cli.js initdsaudit initThis command:
- Scans your current directory for design system files
- Prompts for configuration options
- Runs the audit
- Generates reports in
./auditdirectory - Opens an interactive dashboard (if enabled)
dsaudit rundsaudit config --show # View current configuration
dsaudit config --reset # Reset to defaults- Component structure and organization
- Type safety and prop validation
- Test coverage
- Accessibility compliance
- Storybook documentation
- Token architecture (global, semantic, component-level)
- Smart Coverage Analysis: Calculates actual token usage vs. hardcoded values
- Format consistency across CSS, JSON, and JS tokens
- Token redundancy detection
- Multi-theme/multi-mode support detection
- Essential docs (README, CONTRIBUTING, CHANGELOG, API)
- Component-level documentation
- Storybook stories
- Governance guidelines (versioning, contribution process)
- Build system configuration (Vite, Webpack, esbuild)
- Testing infrastructure (Jest, Vitest, Playwright)
- CI/CD setup
- Developer experience (linting, formatting, git hooks)
- Code splitting and dynamic imports
- Bundle size analysis
- Image optimization
- Build performance
- ARIA compliance and labeling
- Keyboard navigation
- Focus management
- Screen reader support
- Color contrast
The tool creates a .dsaudit.json configuration file. Copy .dsaudit.example.json to get started:
cp .dsaudit.example.json .dsaudit.jsonConfiguration options:
{
"projectPath": "./",
"outputPath": "./audit",
"modules": {
"components": true,
"tokens": true,
"documentation": true,
"tooling": true,
"performance": true,
"accessibility": true
},
"ai": {
"enabled": false,
"apiKey": "your-api-key"
},
"dashboard": {
"enabled": true,
"port": 4321,
"autoOpen": true
}
}audit/report.md- Comprehensive markdown reportaudit/results.json- Detailed JSON dataaudit/dashboard- Interactive HTML dashboard
- Real-time audit progress
- Interactive charts (radar, bar, pie, etc.)
- Drill-down into specific findings
- Export capabilities
- Recommendation tracking
- Node.js >= 18.0.0
- npm or yarn
- TypeScript 5.0+
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build the project
npm run build
# Run tests
npm test
# Lint and type-check
npm run lint
npm run typecheckdsaudit/
βββ src/
β βββ cli/ # CLI commands and entry points
β βββ core/ # Core audit engine and scoring
β βββ modules/ # Individual audit modules
β βββ dashboard/ # Web dashboard UI
β βββ utils/ # Shared utilities
βββ dist/ # Compiled output
βββ example-design-system/ # Example for testing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Additional audit modules
- Framework-specific analyzers (React, Vue, Angular, etc.)
- Enhanced token detection algorithms
- Accessibility testing improvements
- Dashboard UI enhancements
- QUICKSTART.md - Quick start guide for immediate setup
- CLAUDE.md - Claude AI integration details
- example-design-system/ - Example project structure
- Token coverage calculation is optimized for CSS-in-JS and CSS Modules
- AI insights require a Claude API key
- Dashboard requires modern browser with ES6 support
MIT License - see LICENSE file for details
- Built with TypeScript and Node.js
- Dashboard powered by Chart.js
- AI insights powered by Claude (Anthropic)
Note: This tool is in active development. Contributions and feedback are welcome!