{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://swl-ses.dev/schemas/plugin.json",
  "title": "SWL Plugin Manifest",
  "description": "Schema para plugin.json de plugins SWL instalables en _userland/",
  "type": "object",
  "required": ["name", "version", "description"],
  "properties": {
    "name": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]+$",
      "maxLength": 64,
      "description": "Nombre en kebab-case, sin prefijo reservado anthropic/claude/swl"
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$",
      "description": "Version semantica del plugin (SemVer)"
    },
    "description": {
      "type": "string",
      "minLength": 10,
      "maxLength": 500,
      "description": "Descripcion del plugin: que hace y cuando usarlo"
    },
    "author": {
      "type": "string",
      "description": "Nombre o email del autor del plugin"
    },
    "license": {
      "type": "string",
      "description": "Licencia SPDX (ej: MIT, Apache-2.0, proprietary)"
    },
    "agents": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Rutas relativas a archivos de agentes (.md con frontmatter YAML)"
    },
    "skills": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Rutas relativas a directorios de skills (cada uno con SKILL.md)"
    },
    "rules": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Rutas relativas a archivos de reglas (.md)"
    },
    "hooks": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Rutas relativas a archivos de hooks (.js)"
    },
    "dependencies": {
      "type": "object",
      "description": "Dependencias de otros plugins: { nombre: version-semver }",
      "additionalProperties": {
        "type": "string",
        "pattern": "^\\d+\\.\\d+\\.\\d+$"
      }
    }
  },
  "additionalProperties": false
}
