{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opcstudio.com.cn/skills.schema.json",
  "title": "OPC Studio Skill Catalog",
  "description": "OPC Studio 面向人类与 AI Agent 的统一 Skill 目录格式。",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "publisher",
    "publisherUrl",
    "github",
    "updatedAt",
    "count",
    "categories",
    "skills"
  ],
  "properties": {
    "$schema": { "type": "string", "format": "uri" },
    "publisher": { "type": "string", "minLength": 1 },
    "publisherUrl": { "type": "string", "format": "uri" },
    "github": { "type": "string", "format": "uri" },
    "install": { "type": "string" },
    "updatedAt": { "type": "string", "format": "date" },
    "count": { "type": "integer", "minimum": 0 },
    "categories": {
      "type": "array",
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 1 }
    },
    "skills": {
      "type": "array",
      "items": { "$ref": "#/$defs/skill" }
    }
  },
  "$defs": {
    "skill": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "category",
        "tagline",
        "description",
        "repo",
        "install",
        "status",
        "free"
      ],
      "properties": {
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        "category": { "type": "string", "enum": ["投资", "增长", "设计", "效率"] },
        "module": { "type": "string", "enum": ["生命周期", "M1", "M2", "M3", "M4", "M5", "M6", "M8"] },
        "moduleLabel": { "type": "string", "minLength": 1 },
        "tagline": { "type": "string", "minLength": 1 },
        "description": { "type": "string", "minLength": 1 },
        "repo": { "type": "string", "format": "uri" },
        "install": { "type": "string", "pattern": "^npx skills add D-kart/[a-z0-9-]+$" },
        "status": { "type": "string", "enum": ["已发布", "开发中"] },
        "free": { "type": "boolean" }
      }
    }
  }
}
