{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schema": {
      "type": "string",
      "const": "skillflux-skill/v1"
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "displayName": {
      "type": "object",
      "properties": {
        "en": {
          "type": "string",
          "minLength": 1
        },
        "zh": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "en",
        "zh"
      ],
      "additionalProperties": false
    },
    "summary": {
      "type": "object",
      "properties": {
        "en": {
          "type": "string",
          "minLength": 1
        },
        "zh": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "en",
        "zh"
      ],
      "additionalProperties": false
    },
    "upstreamDescription": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "source": {
      "type": "object",
      "properties": {
        "repo": {
          "type": "string",
          "pattern": "^https:\\/\\/github\\.com\\/[^/]+\\/[^/]+$"
        },
        "path": {
          "type": "string",
          "pattern": "^(?:[^/].*[^/]|[^/]?)$"
        },
        "commitSha": {
          "type": "string",
          "pattern": "^[0-9a-f]{40}$"
        },
        "pinnedAt": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        }
      },
      "required": [
        "repo",
        "path",
        "commitSha",
        "pinnedAt"
      ],
      "additionalProperties": false
    },
    "author": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "license": {
      "type": "object",
      "properties": {
        "spdx": {
          "type": [
            "string",
            "null"
          ]
        },
        "raw": {
          "type": [
            "string",
            "null"
          ]
        },
        "file": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "spdx",
        "raw",
        "file"
      ],
      "additionalProperties": false
    },
    "sourceSiteSlug": {
      "type": "string",
      "minLength": 1
    },
    "category": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "listed",
        "benchmarked",
        "delisted"
      ]
    },
    "addedAt": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "updatedAt": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "schema",
    "id",
    "name",
    "displayName",
    "summary",
    "upstreamDescription",
    "source",
    "author",
    "license",
    "sourceSiteSlug",
    "category",
    "tags",
    "status",
    "addedAt",
    "updatedAt"
  ],
  "additionalProperties": false
}
