{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ramimac.me/swatches/schema.json",
  "title": "Swatch",
  "description": "Minimal design system specification for agent consumption (~150 tokens)",
  "type": "object",
  "required": ["name", "description", "colors", "typography", "spacing", "principles"],
  "properties": {
    "name": {
      "type": "string",
      "description": "Evocative name capturing the aesthetic"
    },
    "description": {
      "type": "string",
      "description": "One-line description of the visual style"
    },
    "tone": {
      "type": "array",
      "items": { "type": "string" },
      "maxItems": 4,
      "description": "3-4 adjectives describing the mood"
    },
    "colors": {
      "type": "object",
      "required": ["primary", "background", "text"],
      "properties": {
        "primary": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "background": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "text": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "accent": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "muted": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "border": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "success": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "warning": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "error": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" }
      },
      "additionalProperties": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" }
    },
    "typography": {
      "type": "object",
      "required": ["fonts"],
      "properties": {
        "fonts": {
          "type": "object",
          "properties": {
            "display": { "type": "string" },
            "body": { "type": "string" },
            "mono": { "type": "string" }
          }
        },
        "scale": {
          "type": "array",
          "items": { "type": "integer" },
          "description": "Font sizes in px, smallest to largest"
        }
      }
    },
    "spacing": {
      "type": "object",
      "properties": {
        "radius": {
          "type": "array",
          "items": { "type": "integer" },
          "description": "Border radius values in px"
        },
        "shadow": {
          "type": "object",
          "properties": {
            "sm": { "type": "string" },
            "md": { "type": "string" },
            "lg": { "type": "string" }
          }
        },
        "grid": {
          "type": "integer",
          "description": "Base grid unit in px (e.g., 4 or 8)"
        }
      }
    },
    "iconography": {
      "type": "object",
      "description": "Icon style specs (optional)",
      "properties": {
        "style": { "enum": ["outlined", "filled", "duotone", "glyph"] },
        "strokeWidth": { "type": "number" },
        "cornerStyle": { "enum": ["rounded", "sharp", "mixed"] }
      }
    },
    "principles": {
      "type": "array",
      "items": { "type": "string" },
      "minItems": 3,
      "maxItems": 5,
      "description": "Core design rules, one sentence each"
    },
    "use": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Suggested use cases"
    }
  }
}
