{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://johnjboren.github.io/deskhub/desk.schema.json",
  "title": "DeskHub Desk Manifest",
  "description": "A Desk is a unit of publication function — a generator, channel, or reader-app — that someone can fork or install into their own Swarm-Console-style publication. Inspired by OpenClaw's Skills system (bundled / managed / workspace-level).",
  "type": "object",
  "required": ["id", "name", "purpose", "kind", "added"],
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*$",
      "description": "Unique slug — lowercase + dashes only."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "Display name for the catalog."
    },
    "purpose": {
      "type": "string",
      "minLength": 1,
      "maxLength": 280,
      "description": "One-line description of what this Desk does."
    },
    "kind": {
      "type": "string",
      "enum": ["generator", "channel", "reader-app", "infrastructure"],
      "description": "generator = daily content producer; channel = subscriber delivery; reader-app = interactive page; infrastructure = backend coordination."
    },
    "category": {
      "type": "string",
      "enum": ["games", "mystic", "markets", "workbench", "factory", "editorial", "research"],
      "description": "Optional grouping for catalog filtering."
    },
    "schedule": {
      "type": "string",
      "pattern": "^([0-9*,/-]+\\s+){4}[0-9*,/-]+$",
      "description": "Cron string. Required for kind=generator|channel."
    },
    "depends_on": {
      "type": "array",
      "items": {"type": "string"},
      "description": "Other desks/services this depends on (e.g., 'unified-gen', 'qdrant', 'claude-cli')."
    },
    "outputs": {
      "type": "array",
      "items": {"type": "string"},
      "description": "Frontend paths this desk publishes to (e.g., 'blog-posts/*.md', 'trends/index.json')."
    },
    "byline": {
      "type": "string",
      "description": "Author string for content this desk produces. Convention: 'Trapper Keeper / The X Desk'."
    },
    "url": {
      "type": "string",
      "format": "uri-reference",
      "description": "Landing URL (for kind=reader-app)."
    },
    "source": {
      "type": "string",
      "format": "uri-reference",
      "description": "Source code URL. Defaults to this repo when omitted."
    },
    "added": {
      "type": "string",
      "format": "date",
      "description": "ISO date this Desk was added to the registry."
    },
    "tags": {
      "type": "array",
      "items": {"type": "string"},
      "description": "Free-form tags for search/filter."
    },
    "status": {
      "type": "string",
      "enum": ["active", "retired", "experimental"],
      "default": "active"
    }
  }
}
