{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ngautopilot.dev/schemas/skill.schema.json",
  "title": "NgAutoPilot Skill Metadata",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "name",
    "description",
    "stack",
    "category",
    "status",
    "version",
    "owner",
    "triggers"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9]+(\\.[a-z0-9]+(-[a-z0-9]+)*)+$"
    },
    "name": {
      "type": "string",
      "minLength": 3
    },
    "description": {
      "type": "string",
      "minLength": 20
    },
    "stack": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 2
      }
    },
    "category": {
      "type": "string",
      "minLength": 2
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "review",
        "stable",
        "deprecated",
        "experimental"
      ]
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "owner": {
      "type": "string",
      "minLength": 2
    },
    "triggers": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 2
      }
    },
    "compatibility": {
      "type": "object",
      "description": "Optional version compatibility metadata used by version-aware skills.",
      "additionalProperties": true
    },
    "variants": {
      "type": "object",
      "description": "Optional implementation variants for different framework or tooling versions.",
      "additionalProperties": true
    },
    "fallbacks": {
      "type": "array",
      "description": "Optional fallback patterns when the preferred implementation is not supported.",
      "items": {
        "type": "string"
      }
    },
    "detects": {
      "type": "object",
      "description": "Optional detection hints for files or signals the agent should inspect.",
      "additionalProperties": true
    }
  }
}
