{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "ADR Template Variables",
  "description": "Schema for Architecture Decision Record template variables",
  "type": "object",
  "required": ["number", "title", "status", "deciders", "context", "decision", "positiveConsequences"],
  "properties": {
    "number": {
      "type": "integer",
      "minimum": 1,
      "description": "ADR number for ordering and reference"
    },
    "title": {
      "type": "string",
      "minLength": 5,
      "maxLength": 100,
      "description": "Short title describing the decision"
    },
    "status": {
      "type": "string",
      "enum": ["Proposed", "Accepted", "Deprecated", "Superseded"],
      "description": "Current status of the decision"
    },
    "deciders": {
      "type": "string",
      "minLength": 1,
      "description": "Names of people involved in the decision"
    },
    "context": {
      "type": "string",
      "minLength": 20,
      "description": "Context and background that led to this decision"
    },
    "decision": {
      "type": "string",
      "minLength": 20,
      "description": "The decision being made"
    },
    "positiveConsequences": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string" },
      "description": "Positive outcomes of the decision"
    },
    "negativeConsequences": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Negative outcomes or trade-offs"
    },
    "alternatives": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["name", "description"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Alternative option name"
          },
          "description": {
            "type": "string",
            "description": "Description of the alternative"
          },
          "pros": {
            "type": "string",
            "description": "Advantages of this alternative"
          },
          "cons": {
            "type": "string",
            "description": "Disadvantages of this alternative"
          },
          "whyNot": {
            "type": "string",
            "description": "Why this alternative was not chosen"
          }
        }
      },
      "description": "Alternative options considered"
    },
    "relatedADRs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["number", "title"],
        "properties": {
          "number": { "type": "integer" },
          "title": { "type": "string" }
        }
      },
      "description": "Related ADR references"
    },
    "references": {
      "type": "array",
      "items": { "type": "string" },
      "description": "External references and links"
    },
    "supersededBy": {
      "type": "integer",
      "description": "ADR number that supersedes this one"
    }
  }
}
