Design System Context Protocol — a versioned specification and type package for communicating design system constraints to generative AI models before code generation.
Part of the Lapidist ecosystem v8 architecture.
DSCP defines a structured DSCPDocument that encodes the complete set of information an
AI agent needs to generate design-system-conformant code: tokens, components, deprecations,
violation patterns, and active lint rules.
The protocol is tool-agnostic. DSR, dtifx, and third-party tools can all produce DSCP documents.
pnpm add @lapidist/dscpimport { generateDocument } from '@lapidist/dscp';
const doc = generateDocument({
tokenGraph: { tokens: myTokenMap, byType: myByTypeMap },
componentRegistry: { components: myComponentMap },
deprecationLedger: { entries: myDeprecationMap },
ruleRegistry: { rules: myRuleMap },
violations: [],
snapshotHash: 'abc123',
});import { generateDocument, renderMarkdown } from '@lapidist/dscp';
const doc = generateDocument(input);
const markdown = renderMarkdown(doc);
// Write to ./DESIGN_SYSTEM.mdimport { isDSCPDocument } from '@lapidist/dscp';
const parsed: unknown = JSON.parse(rawJson);
if (isDSCPDocument(parsed)) {
// parsed is typed as DSCPDocument
}See spec/v1.md for the normative specification.
See schema/v1.json for the JSON Schema.
DSCP depends only on @lapidist/dtif-parser for token types. It must never depend on
@lapidist/dsr or @lapidist/design-lint.
MIT — see LICENSE.