{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "stages"],
  "properties": {
    "schemaVersion": { "const": 1 },
    "stages": {
      "type": "object",
      "minProperties": 1,
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "required": ["description", "routes"],
        "properties": {
          "description": { "type": "string", "minLength": 1 },
          "routes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["skill", "source"],
              "properties": {
                "skill": { "type": "string", "minLength": 1 },
                "source": { "type": "string", "minLength": 1 },
                "aliases": { "type": "array", "items": { "type": "string" } },
                "triggers": { "type": "array", "items": { "type": "string" } },
                "requiresMissing": { "type": "string" }
              }
            }
          }
        }
      }
    }
  }
}
