{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/skill-catalog.schema.json",
  "title": "Skill catalog",
  "description": "What GET /v1/skills returns (`skill-catalog.mjs --json`): every /multi-agent command, marketplace plugin skill and saved routine a person can invoke, with both frontmatter descriptions. enabled is the plugin's state in the chosen repository's .claude/settings.json or its always-on flag, null for a plugin skill when no repository was chosen, and always true for commands and routines. A source that is missing on this machine is a note, not an error. Routine text is scrubbed.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion", "repo", "items", "notes"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "repo": {
      "description": "The repository reference the request named, or null.",
      "type": ["string", "null"]
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "invoke",
          "kind",
          "source",
          "description",
          "descriptionTr",
          "enabled",
          "alwaysOn",
          "localOnly"
        ],
        "properties": {
          "id": {
            "description": "kind:name for a command or routine, plugin-skill:plugin:name for a plugin skill.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "invoke": {
            "description": "What a person types: /multi-agent:<name> for a command or routine, <plugin>:<skill> for a plugin skill.",
            "type": "string"
          },
          "kind": {
            "enum": ["command", "plugin-skill", "routine"]
          },
          "source": {
            "description": "The plugin name, pipeline for a shipped command, or local for a routine or a local-only command.",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "descriptionTr": {
            "type": ["string", "null"]
          },
          "enabled": {
            "type": ["boolean", "null"]
          },
          "alwaysOn": {
            "type": "boolean"
          },
          "localOnly": {
            "type": "boolean"
          }
        }
      }
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["section", "code"],
        "properties": {
          "section": {
            "enum": ["command", "plugin-skill", "routine"]
          },
          "code": {
            "description": "no-tree: no command tree; no-clone: no marketplace clone; no-manifest: the clone has no readable marketplace.json; unreadable: the routine registry could not be read.",
            "enum": ["no-tree", "no-clone", "no-manifest", "unreadable"]
          }
        }
      }
    }
  }
}
