{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://litlfred.github.io/folio-assistant/cat-harness/skills/wireframe-design-review/input.schema.json",
  "title": "Wireframe Design Review Input",
  "description": "What is to be wireframed and why: the use (design of a new or changed surface, or as-is drawing of an existing visualiser), the surface, and where the drawings are kept. Called from Process_CRDM_Requirements (Call_Wireframe) for Design use, when a requirement changes a rendered surface.",
  "type": "object",
  "required": [
    "use",
    "topic",
    "surface"
  ],
  "properties": {
    "use": {
      "type": "string",
      "enum": [
        "design",
        "as-is"
      ],
      "description": "`design`: a new or changed UI, at least two candidates compared blind. `as-is`: an existing visualiser drawn as it renders on main, exactly one candidate."
    },
    "topic": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]*$",
      "description": "Kebab-case name of what is drawn. For Design use from CRDM it is the proposal slug, so the drawings sit beside docs/proposals/<topic>.md; for as-is use it is the docs/wireframes/<topic>/ directory name."
    },
    "surface": {
      "type": "string",
      "description": "The rendered surface: a page, a visualiser ref, the navbar, a form, an app screen."
    },
    "intent": {
      "type": "string",
      "description": "Who the screen is for, what they need to do, and what it must show. Absent: written in step 1 (from the requirements for Design use; read off the visualiser's declaration for as-is use)."
    },
    "requirements": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Design use from CRDM: the requirement keys or sentences that change this surface, verbatim."
    },
    "proposal": {
      "type": "string",
      "description": "Design use from CRDM: repository-relative path of the request's proposal (docs/proposals/<slug>.md), whose assets the candidates become."
    },
    "humanReviewer": {
      "type": "string",
      "description": "Who chooses between candidates. From CRDM: the requester or the BA, by GitHub handle."
    },
    "channels": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "conversation",
              "issue",
              "pull-request"
            ],
            "description": "The Tool the request for feedback goes through."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The issue or pull request; absent for the conversation."
          }
        }
      },
      "description": "Where the candidates are shown: where the requester will look, chosen from context, and more than one may be right (feedback-deep-links, point 5). Each carries the same staging deep links and screenshots."
    },
    "branch": {
      "type": "string",
      "description": "The feature branch the candidates are committed on, so feature-staging publishes them."
    }
  }
}
