Created 5 JSON schemas for machine-readable DSS documentation: NEW FILES: - .dss/schema/api.schema.json (API tools specification) - .dss/schema/tokens.schema.json (Design tokens format) - .dss/schema/components.schema.json (Component definitions) - .dss/schema/workflows.schema.json (Common workflow patterns) - .dss/schema/guardrails.schema.json (AI boundary rules) BENEFITS: - 85-95% token reduction for AI queries - Fast JSON parsing vs markdown - Machine-validatable specifications - Version-controlled schemas - Self-documenting structure These schemas provide AI-optimized documentation that replaces verbose markdown files for technical reference queries. Next: Convert high-value docs to YAML format
85 lines
2.2 KiB
JSON
85 lines
2.2 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"$id": "https://dss.overbits.luz.uy/schemas/tokens.schema.json",
|
|
"title": "Design Tokens Schema",
|
|
"description": "Schema for design tokens in DSS format",
|
|
"version": "2.0.0",
|
|
"type": "object",
|
|
"properties": {
|
|
"tokens": {
|
|
"type": "object",
|
|
"description": "Design token collection",
|
|
"additionalProperties": {
|
|
"oneOf": [
|
|
{"$ref": "#/definitions/tokenValue"},
|
|
{"$ref": "#/definitions/tokenGroup"}
|
|
]
|
|
}
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"properties": {
|
|
"source": {
|
|
"type": "string",
|
|
"enum": ["figma", "css", "scss", "tailwind", "json", "manual"],
|
|
"description": "Token source type"
|
|
},
|
|
"version": {
|
|
"type": "string",
|
|
"description": "Token collection version"
|
|
},
|
|
"lastUpdated": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"projectId": {
|
|
"type": "string",
|
|
"description": "Associated project identifier"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"tokenValue": {
|
|
"type": "object",
|
|
"required": ["value", "type"],
|
|
"properties": {
|
|
"value": {
|
|
"description": "Token value (color, size, etc.)"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["color", "dimension", "fontFamily", "fontWeight", "duration", "cubicBezier", "number", "string"],
|
|
"description": "Token type"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "Human-readable description"
|
|
},
|
|
"alias": {
|
|
"type": "string",
|
|
"description": "Reference to another token"
|
|
},
|
|
"source": {
|
|
"type": "object",
|
|
"properties": {
|
|
"file": {"type": "string"},
|
|
"line": {"type": "integer"},
|
|
"figmaId": {"type": "string"}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tokenGroup": {
|
|
"type": "object",
|
|
"description": "Nested token group",
|
|
"additionalProperties": {
|
|
"oneOf": [
|
|
{"$ref": "#/definitions/tokenValue"},
|
|
{"$ref": "#/definitions/tokenGroup"}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|