{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gixo.ai/schemas/gixo-brief-v1.schema.json",
  "title": "Gixo Content Brief",
  "description": "A deterministic, portable content-planning handoff produced by Gixo Quill.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema", "format", "version", "workingHeadline", "contentType", "search",
    "audience", "keyQuestion", "angle", "wordBudget", "estimatedReadingMinutes",
    "tone", "voice", "sections", "sources", "internalLinks", "assets",
    "callToAction", "review", "channels", "successMetric", "acceptanceCriteria"
  ],
  "properties": {
    "$schema": { "const": "https://gixo.ai/schemas/gixo-brief-v1.schema.json" },
    "format": { "const": "gixo-brief" },
    "version": { "const": "1.0.0" },
    "workingHeadline": { "type": "string", "maxLength": 500 },
    "contentType": { "type": "string", "maxLength": 100 },
    "search": { "$ref": "#/$defs/search" },
    "audience": { "$ref": "#/$defs/audience" },
    "keyQuestion": { "type": "string", "maxLength": 2000 },
    "angle": { "type": "string", "maxLength": 2000 },
    "wordBudget": { "type": "integer", "minimum": 300, "maximum": 20000 },
    "estimatedReadingMinutes": { "type": "integer", "minimum": 1, "maximum": 89 },
    "tone": { "type": "string", "maxLength": 1000 },
    "voice": { "type": "string", "maxLength": 1000 },
    "sections": {
      "type": "array", "minItems": 2, "maxItems": 42,
      "items": { "$ref": "#/$defs/section" }
    },
    "sources": { "$ref": "#/$defs/stringList" },
    "internalLinks": {
      "type": "array", "maxItems": 40,
      "items": { "$ref": "#/$defs/internalLink" }
    },
    "assets": { "$ref": "#/$defs/stringList" },
    "callToAction": { "$ref": "#/$defs/callToAction" },
    "review": { "$ref": "#/$defs/review" },
    "channels": { "$ref": "#/$defs/stringList" },
    "successMetric": { "type": "string", "maxLength": 2000 },
    "acceptanceCriteria": {
      "type": "array", "maxItems": 60,
      "items": { "type": "string", "maxLength": 2000 }
    }
  },
  "$defs": {
    "stringList": {
      "type": "array", "maxItems": 40,
      "items": { "type": "string", "maxLength": 4000 }
    },
    "search": {
      "type": "object", "additionalProperties": false,
      "required": ["primaryKeyword", "secondaryKeywords", "intent"],
      "properties": {
        "primaryKeyword": { "type": "string", "maxLength": 500 },
        "secondaryKeywords": { "$ref": "#/$defs/stringList" },
        "intent": { "type": "string", "maxLength": 1000 }
      }
    },
    "audience": {
      "type": "object", "additionalProperties": false,
      "required": ["description", "jobTitle"],
      "properties": {
        "description": { "type": "string", "maxLength": 2000 },
        "jobTitle": { "type": "string", "maxLength": 500 }
      }
    },
    "section": {
      "type": "object", "additionalProperties": false,
      "required": ["position", "heading", "wordBudget", "required"],
      "properties": {
        "position": { "type": "integer", "minimum": 1, "maximum": 42 },
        "heading": { "type": "string", "minLength": 1, "maxLength": 1000 },
        "wordBudget": { "type": "integer", "minimum": 0, "maximum": 20000 },
        "required": { "type": "boolean" }
      }
    },
    "internalLink": {
      "type": "object", "additionalProperties": false,
      "required": ["url", "anchorText"],
      "properties": {
        "url": { "type": "string", "maxLength": 4000 },
        "anchorText": { "type": "string", "maxLength": 1000 }
      }
    },
    "callToAction": {
      "type": "object", "additionalProperties": false,
      "required": ["text", "url"],
      "properties": {
        "text": { "type": "string", "maxLength": 2000 },
        "url": { "type": "string", "maxLength": 4000 }
      }
    },
    "review": {
      "type": "object", "additionalProperties": false,
      "required": ["reviewer", "deadline"],
      "properties": {
        "reviewer": { "type": "string", "maxLength": 1000 },
        "deadline": { "type": "string", "maxLength": 100 }
      }
    }
  }
}
