{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "profiles", "issueTracker", "triageLabels", "domainDocs", "capabilities"],
  "properties": {
    "schemaVersion": { "const": 2 },
    "profiles": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
    "issueTracker": { "type": "string", "minLength": 1 },
    "triageLabels": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
    "domainDocs": {
      "type": "object",
      "additionalProperties": false,
      "required": ["context", "adrDirectory"],
      "properties": {
        "context": { "type": "string", "minLength": 1 },
        "adrDirectory": { "type": "string", "minLength": 1 }
      }
    },
    "capabilities": { "type": "object", "additionalProperties": { "$ref": "#/definitions/selection" } },
    "detected": {
      "type": "object",
      "additionalProperties": false,
      "required": ["signals", "profiles", "skills", "capabilities", "fileCount"],
      "properties": {
        "signals": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
        "profiles": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
        "skills": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
        "capabilities": { "type": "object", "additionalProperties": { "$ref": "#/definitions/selection" } },
        "fileCount": { "type": "integer", "minimum": 0 }
      }
    }
  },
  "definitions": {
    "selection": {
      "type": "object",
      "additionalProperties": false,
      "required": ["mode"],
      "properties": {
        "mode": { "enum": ["off", "registered", "project", "auto", "always"] },
        "provider": { "type": "string" },
        "options": { "type": "object" }
      }
    }
  }
}
