{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/geronimo-iia/agent-foundation/schemas/skills-index.json",
  "title": "Skills Hub Index",
  "description": "Schema for index.json generated by CI for skill hubs",
  "type": "object",
  "required": ["hub_id", "generated_at", "skills"],
  "properties": {
    "hub_id": {
      "type": "string",
      "description": "Unique identifier for this hub"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp when index was generated"
    },
    "skills": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["slug", "name", "description", "version", "git_url", "path", "commit"],
        "properties": {
          "slug": {
            "type": "string",
            "description": "URL-safe identifier, matches directory name",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
          },
          "name": {
            "type": "string",
            "description": "Skill name from SKILL.md frontmatter"
          },
          "description": {
            "type": "string",
            "description": "What the skill does and when to use it",
            "maxLength": 1024
          },
          "version": {
            "type": "string",
            "description": "Semantic version from metadata.version"
          },
          "compatibility": {
            "type": "string",
            "description": "Human-readable environment requirements",
            "maxLength": 500
          },
          "license": {
            "type": "string",
            "description": "License identifier (e.g., MIT, Apache-2.0)"
          },
          "git_url": {
            "type": "string",
            "format": "uri",
            "description": "Git repository URL for cloning"
          },
          "path": {
            "type": "string",
            "description": "Relative path to skill directory in repo"
          },
          "commit": {
            "type": "string",
            "description": "Git commit hash for this version",
            "pattern": "^[a-f0-9]{7,40}$"
          },
          "has_lifecycle": {
            "type": "boolean",
            "description": "Whether skill includes lifecycle.yaml",
            "default": false
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
