{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.dharma-ai.io/skill-manifest/v1",
  "title": "Organization Skill Manifest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "skillId",
    "organizationId",
    "name",
    "version",
    "sourceCommit",
    "contentHash",
    "riskClass",
    "providers",
    "operatingSystems",
    "installTargets",
    "activationMode",
    "permissions",
    "evaluationSuite",
    "rollbackVersion"
  ],
  "properties": {
    "schema": {
      "const": "dharma.skill-manifest/v1"
    },
    "skillId": {
      "type": "string",
      "minLength": 1
    },
    "organizationId": {
      "type": "string",
      "minLength": 1
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
    },
    "sourceCommit": {
      "type": "string",
      "pattern": "^[A-Fa-f0-9]{7,64}$"
    },
    "contentHash": {
      "type": "string",
      "pattern": "^(sha256|blake3):[A-Fa-f0-9]{32,128}$"
    },
    "riskClass": {
      "type": "string",
      "enum": [
        "R0",
        "R1",
        "R2",
        "R3",
        "R4"
      ]
    },
    "providers": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    },
    "operatingSystems": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "windows",
          "wsl",
          "macos",
          "linux"
        ]
      }
    },
    "installTargets": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "activationMode": {
      "type": "string",
      "enum": [
        "next_task",
        "next_session",
        "host_restart",
        "immediate_safe_reload"
      ]
    },
    "permissions": {
      "type": "object"
    },
    "evaluationSuite": {
      "type": "string"
    },
    "rollbackVersion": {
      "type": [
        "string",
        "null"
      ]
    },
    "provenance": {
      "type": "object"
    }
  }
}
