{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/sananthanarayan/skilldrop/contracts/pack.schema.json",
  "title": "skilldrop packs/<pack>/pack.json",
  "$comment": "RFC-0001 / RFC-0032 / RFC-0033 / RFC-0034. One pack's metadata. Membership is not listed here: a skill is in this pack because it sits at packs/<pack>/skills/<name>/, and a loop because it sits at packs/<pack>/loops/<name>/. Key names follow agent-ready-repo's pack.toml so the two stay mechanically convertible.",
  "type": "object",
  "additionalProperties": false,
  "required": ["description"],
  "properties": {
    "$comment": { "type": "string" },
    "description": { "type": "string", "description": "One line — who this pack is for." },
    "display_name": { "type": "string", "description": "RFC-0032. Human title for the pack's page and plugin entry." },
    "keywords": { "type": "array", "items": { "type": "string" }, "description": "RFC-0032. Search terms, copied into the plugin entry." },
    "links": {
      "type": "object",
      "additionalProperties": false,
      "description": "RFC-0032. Catalogue-facing links; `documentation` is the pack's page.",
      "properties": {
        "homepage": { "type": "string" },
        "repository": { "type": "string" },
        "documentation": { "type": "string" }
      }
    },
    "maintainers": {
      "type": "array",
      "description": "RFC-0032.",
      "items": { "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": { "type": "string" } } }
    },
    "first-value": {
      "type": "object",
      "additionalProperties": false,
      "description": "RFC-0032. What to try first after installing, how to tell it worked, and what to do if it didn't. Key names match agent-ready-repo's [pack.first-value].",
      "required": ["audience-posture", "prerequisites", "starter-task", "starter-prompt", "verification", "recovery"],
      "properties": {
        "audience-posture": { "type": "string", "enum": ["technical", "non-technical"] },
        "prerequisites": { "type": "array", "items": { "type": "string" } },
        "starter-task": { "type": "string" },
        "starter-prompt": { "type": "string" },
        "verification": { "type": "string" },
        "recovery": { "type": "string" }
      }
    },
    "journey": {
      "type": "object",
      "additionalProperties": false,
      "description": "A typical session with the pack, rendered as its walkthrough page: when you'd reach for it, what you bring, each step's skill with what you do, what you get and where you decide, and what you end with. Every step's skill must sit in this pack or in a pack it requires.",
      "required": ["when", "you_bring", "steps", "you_end_with"],
      "properties": {
        "when": { "type": "string" },
        "you_bring": { "type": "array", "items": { "type": "string" } },
        "time": { "type": "string", "description": "A rough range for one session; left out when it depends too much on the work." },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["skill", "you_do", "you_get"],
            "properties": {
              "skill": { "type": "string" },
              "you_do": { "type": "string" },
              "you_get": { "type": "string" },
              "decide": { "type": "string", "description": "The human decision at this step, if any: a loop gate or a judgment call." }
            }
          }
        },
        "you_end_with": { "type": "string" }
      }
    },
    "requires": {
      "type": "array",
      "items": { "type": "string" },
      "description": "RFC-0033. Packs installed together with this one (in practice, `core`). One level only: a required pack may not itself require."
    }
  }
}
