{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://skill.qiuyiwu.com/schema.json",
  "title": "Skill Hub Manifest",
  "description": "Schema for the skills.json manifest served at https://skill.qiuyiwu.com/skills.json — a directory of AI Skills installable to Claude Code Skills Plugin and similar agent runtimes.",
  "type": "object",
  "required": ["version", "hub", "skills"],
  "properties": {
    "$schema": {"type": "string"},
    "version": {"type": "integer", "const": 1},
    "generated_at": {"type": "string", "format": "date"},
    "hub": {
      "type": "object",
      "required": ["name", "url"],
      "properties": {
        "name": {"type": "string"},
        "slogan": {"type": "string"},
        "url": {"type": "string", "format": "uri"},
        "owner": {
          "type": "object",
          "properties": {
            "name": {"type": "string"},
            "site": {"type": "string", "format": "uri"}
          }
        },
        "consumers": {
          "type": "array",
          "items": {"type": "string"}
        }
      }
    },
    "categories": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "name": {"type": "string"},
          "desc": {"type": "string"}
        }
      }
    },
    "skills": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "name", "category", "type", "visibility", "summary"],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]*$",
            "description": "URL-safe slug, used as filename and folder name"
          },
          "name": {"type": "string", "description": "Human-readable display name"},
          "category": {
            "type": "string",
            "enum": ["strategy", "writing", "design", "presentation", "meta", "knowledge-system"]
          },
          "type": {
            "type": "string",
            "enum": ["claude-code-skill", "web-app", "mcp-server"]
          },
          "visibility": {
            "type": "string",
            "enum": ["public", "private"]
          },
          "summary": {"type": "string", "description": "One-line description, max ~80 chars"},
          "description": {"type": "string", "description": "Full description including when to trigger"},
          "triggers": {
            "type": "array",
            "items": {"type": "string"},
            "description": "Phrases that should auto-activate the skill"
          },
          "package_url": {
            "type": ["string", "null"],
            "format": "uri",
            "description": "Direct download URL for the .skill.tar.gz / .skill.zip package"
          },
          "package_status": {
            "type": "string",
            "enum": ["ready", "to-be-packaged", "n/a"]
          },
          "package_format": {
            "type": "string",
            "enum": ["claude-code-skill+tar.gz", "claude-code-skill+zip"]
          },
          "package_size_bytes": {"type": "integer"},
          "preview_url": {"type": "string", "format": "uri"},
          "version": {"type": "string"},
          "author": {"type": "string"},
          "tags": {
            "type": "array",
            "items": {"type": "string"}
          }
        }
      }
    },
    "stats": {
      "type": "object",
      "properties": {
        "total": {"type": "integer"},
        "by_category": {"type": "object"},
        "by_visibility": {"type": "object"},
        "by_package_status": {"type": "object"}
      }
    }
  }
}
