{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://workspai.dev/schemas/workspace-intelligence/workspace-skills-index.v1.json",
  "title": "Workspai Workspace Skills Index",
  "type": "object",
  "required": ["schemaVersion", "generatedAt", "inputsHash", "skills"],
  "properties": {
    "schemaVersion": { "const": "workspace-skills-index.v1" },
    "generatedAt": { "type": "string", "format": "date-time" },
    "inputsHash": { "type": "string", "minLength": 8 },
    "skills": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["skillId", "path", "schemaVersion", "title"],
        "properties": {
          "skillId": { "type": "string" },
          "path": { "type": "string" },
          "schemaVersion": { "type": "string" },
          "title": { "type": "string" }
        },
        "additionalProperties": false
      }
    },
    "selection": {
      "type": "object",
      "required": ["generatedCount", "suppressedCount", "decisions"],
      "properties": {
        "generatedCount": { "type": "integer", "minimum": 0 },
        "suppressedCount": { "type": "integer", "minimum": 0 },
        "decisions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "skillId",
              "title",
              "status",
              "confidence",
              "reasons",
              "signals",
              "scopedProjects"
            ],
            "properties": {
              "skillId": { "type": "string", "minLength": 1 },
              "title": { "type": "string" },
              "status": { "enum": ["generated", "suppressed"] },
              "confidence": { "enum": ["high", "medium"] },
              "reasons": { "type": "array", "items": { "type": "string" } },
              "signals": { "type": "array", "items": { "type": "string" } },
              "scopedProjects": { "type": "array", "items": { "type": "string" } }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
