{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/design-system-contracts.schema.json",
  "title": "Design System Contracts",
  "type": "object",
  "required": ["description", "objective", "design_system_contracts"],
  "properties": {
    "description": { "type": "string", "minLength": 1 },
    "objective": { "type": "string", "minLength": 1 },
    "design_system_contracts": {
      "type": "object",
      "required": ["objective", "why", "principles", "tokens", "componentRules", "designExamples", "layoutRules", "responsiveRules", "accessibilityRules", "antiPatterns", "qaGates", "stressTests", "objectiveAlignment"],
      "properties": {
        "objective": { "type": "string", "minLength": 1 },
        "why": { "type": "string", "minLength": 1 },
        "principles": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "object", "required": ["id", "rule", "why"] }
        },
        "tokens": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "object", "required": ["id", "category", "value", "why"] }
        },
        "componentRules": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "object", "required": ["component", "rule", "why"] }
        },
        "designExamples": {
          "type": "array",
          "minItems": 5,
          "items": {
            "type": "object",
            "required": ["id", "title", "fixtureRoute", "component", "objective", "goodExample", "badExample", "requiredStates", "responsiveRequirement", "accessibilityRequirement", "agentCheck", "qaGates"]
          }
        },
        "layoutRules": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "responsiveRules": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "accessibilityRules": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "antiPatterns": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "qaGates": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "stressTests": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "objectiveAlignment": { "type": "string", "minLength": 1 }
      }
    }
  }
}
