{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aiwg.io/schemas/metalanguage/skill.schema.json",
  "title": "AIWG Skill Definition",
  "description": "Declarative YAML schema for natural language workflow skills",
  "type": "object",
  "required": ["skill"],
  "properties": {
    "skill": {
      "type": "object",
      "required": ["id", "triggers"],
      "properties": {
        "id": { "type": "string", "pattern": "^[a-z0-9-]+$" },
        "name": { "type": "string" },
        "description": { "type": "string" },
        "version": { "type": "string" },
        "triggers": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
        "parameters": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "type": { "type": "string" },
              "required": { "type": "boolean" },
              "default": {},
              "description": { "type": "string" }
            }
          }
        },
        "platforms": { "type": "array", "items": { "type": "string" } },
        "workflow": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "step": { "type": "string" },
              "action": { "type": "string" },
              "agent": { "type": "string" }
            }
          }
        }
      }
    }
  }
}
