{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/geronimo-iia/agent-foundation/schemas/skills-lock.json",
  "title": "Skills Lock File",
  "description": "Schema for skills.lock.json tracking installed hub skills with version and source information",
  "type": "object",
  "required": ["version", "skills"],
  "properties": {
    "version": {
      "type": "string",
      "description": "Lock file format version",
      "const": "1.0"
    },
    "skills": {
      "type": "object",
      "description": "Map of installed hub skills keyed by hub_id:slug",
      "patternProperties": {
        "^[a-z0-9-]+:[a-z0-9-]+$": {
          "type": "object",
          "required": ["hub_id", "slug", "version", "commit", "installed_path", "installed_at"],
          "properties": {
            "hub_id": {
              "type": "string",
              "description": "Hub source identifier from agent configuration",
              "pattern": "^[a-z0-9-]+$"
            },
            "slug": {
              "type": "string",
              "description": "Skill name within the hub",
              "pattern": "^[a-z0-9-]+$"
            },
            "version": {
              "type": "string",
              "description": "Semantic version (MAJOR.MINOR.PATCH)",
              "pattern": "^\\d+\\.\\d+\\.\\d+$"
            },
            "commit": {
              "type": "string",
              "description": "Git commit hash pinning exact source state",
              "pattern": "^[a-f0-9]{7,40}$"
            },
            "installed_path": {
              "type": "string",
              "description": "Relative path to skill directory from skills root"
            },
            "installed_at": {
              "type": "string",
              "description": "ISO 8601 timestamp of installation",
              "format": "date-time"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
