Agent-first
DSCP documents are structured for both human reading and LLM parsing. Typed HTML comment markers let agents locate the exact section they need without reading the whole file.
Give AI coding agents a precise, machine-readable description of your design system so they generate token-aware code from the first keystroke.
The Design System Context Protocol defines a versioned JSON envelope — DSCPDocument — that captures the constraints of a design system in a form AI coding agents can act on:
The reference generator can render a DSCPDocument as a DESIGN_SYSTEM.md file at the repo root. The file is structured for both human reading and agent parsing using typed HTML comment markers:
<!-- dscp:tokens:color -->
## Tokens: color
| Token | Value | Deprecated |
|-------|-------|------------|
| `#/color/brand/primary` | `#3B82F6` | No |
<!-- /dscp:tokens:color -->
<!-- dscp:violations -->
## Known violations
- **DO NOT use** `color: #3B82F6` → use `#/color/brand/primary` (seen 12 times)
<!-- /dscp:violations -->Agents can locate any section with a simple string search on the marker comment.
import { generateDocument, renderMarkdown } from '@lapidist/dscp';
const doc = generateDocument({
tokenGraph: { tokens, byType },
componentRegistry: { components },
deprecationLedger: { entries },
ruleRegistry: { rules },
violations,
snapshotHash: 'abc123',
});
const markdown = renderMarkdown(doc);
// Write markdown to DESIGN_SYSTEM.md