{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://eugenelim.github.io/agent-ready-repo/docs/spec/catalogue/draft/skill.schema.json",
  "title": "SkillFrontmatter",
  "description": "JSON Schema for SKILL.md frontmatter — the closed key set enforced by agentbundle catalogue lint --deep.",
  "type": "object",
  "additionalProperties": false,
  "required": ["name", "description"],
  "properties": {
    "name": {
      "type": "string",
      "description": "Kebab-case skill identifier (1–64 chars).",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
      "minLength": 1,
      "maxLength": 64
    },
    "description": {
      "type": "string",
      "description": "Trigger surface shown to IDEs — hard cap 1024 chars (Kiro truncates at byte boundary).",
      "maxLength": 1024
    },
    "license": {
      "type": "string"
    },
    "compatibility": {
      "type": "object",
      "description": "Adapter-compatibility constraints declared by the skill. Values are bounded to the show JSON discovery-compatible scalar/list subset.",
      "maxProperties": 256,
      "propertyNames": {
        "maxLength": 1024
      },
      "additionalProperties": {
        "$ref": "#/$defs/compatibilityValue"
      }
    },
    "metadata": {
      "type": "object",
      "description": "Open extension table — any additional frontmatter keys must be nested here."
    },
    "allowed-tools": {
      "type": "array",
      "items": {"type": "string"},
      "description": "Explicit tool allowlist for this skill."
    }
  },
  "$defs": {
    "compatibilityScalar": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 1024
        },
        {
          "type": "boolean"
        },
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      ]
    },
    "compatibilityValue": {
      "oneOf": [
        {
          "$ref": "#/$defs/compatibilityScalar"
        },
        {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/compatibilityScalar"
          }
        }
      ]
    }
  }
}
