Specification Overview¶
DSS defines 9 canonical layers for complete design system specification. Each layer serves a specific purpose and can be defined in separate JSON/YAML files or combined.
Layer Summary¶
| Layer | File(s) | Purpose |
|---|---|---|
| Meta | meta.json |
System name, version, maintainers |
| Principles | principles.json |
Design philosophy and guidelines |
| Foundations | foundations/*.json |
Design tokens (colors, typography, spacing) |
| Components | components/*.json |
UI elements with variants, states, props |
| Patterns | patterns/*.json |
Multi-component solutions |
| Templates | templates/*.json |
Page-level layouts |
| Content | content.json |
Voice & tone guidelines |
| Accessibility | accessibility.json |
WCAG compliance requirements |
| Governance | governance.json |
Versioning and deprecation policies |
Directory Structure¶
A complete design system spec typically follows this structure:
my-design-system/
├── meta.json # Required: name, version
├── principles.json # Design philosophy
├── accessibility.json # WCAG requirements
├── governance.json # Policies
├── content.json # Voice & tone
├── foundations/
│ ├── colors.json # Color tokens
│ ├── typography.json # Font definitions
│ ├── spacing.json # Spacing scale
│ └── border-radius.json # Border radius values
├── components/
│ ├── button.json # Button component spec
│ ├── card.json # Card component spec
│ └── input.json # Input component spec
├── patterns/
│ └── form.json # Form pattern spec
└── templates/
└── dashboard.json # Dashboard template
Minimal Example¶
The minimum required spec is just meta.json:
Loading Behavior¶
The DSS loader:
- Looks for
meta.jsonin the specified directory - Loads
principles.json,accessibility.json, etc. if present - Scans
foundations/,components/,patterns/,templates/subdirectories - Merges all files into a single
DesignSystemobject - Validates the combined spec
File Formats¶
DSS supports both JSON and YAML:
LLM Context¶
Any component, pattern, or template can include an llm field for AI code generation optimization:
{
"llm": {
"intent": "What this element is for",
"allowedContexts": ["where-to-use-it"],
"forbiddenContexts": ["where-not-to-use-it"],
"antiPatterns": ["common mistakes to avoid"],
"exampleUsage": ["<Component>Example</Component>"]
}
}
See Components for full LLM context documentation.