{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/PDBen-Auto/amazon-product-research-agent-skills/blob/main/skills/amazon-product-research-suite/references/route-plan.schema.json",
  "title": "Amazon Product Research Route Plan",
  "type": "object",
  "required": ["schema_version", "request_id", "decision", "scope", "selected_skills", "execution_order", "missing_inputs", "artifacts", "boundaries"],
  "properties": {
    "schema_version": {"const": "1.0"},
    "request_id": {"type": "string", "minLength": 1},
    "decision": {"type": "string", "minLength": 1},
    "scope": {
      "type": "object",
      "required": ["marketplace", "as_of"],
      "properties": {
        "marketplace": {"type": "string", "minLength": 1},
        "jurisdiction": {"type": ["string", "null"]},
        "as_of": {"type": "string", "format": "date"}
      },
      "additionalProperties": true
    },
    "selected_skills": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["skill_name", "reason", "status"],
        "properties": {
          "skill_name": {"type": "string", "minLength": 1},
          "reason": {"type": "string", "minLength": 1},
          "status": {"enum": ["installed", "missing", "blocked", "complete"]},
          "required_inputs": {"type": "array", "items": {"type": "string"}}
        }
      }
    },
    "execution_order": {"type": "array", "minItems": 1, "items": {"type": "string"}},
    "missing_inputs": {"type": "array", "items": {"type": "object", "required": ["name", "severity", "next_action"]}},
    "artifacts": {"type": "array", "items": {"type": "object", "required": ["type", "path", "producer"]}},
    "boundaries": {"type": "array", "items": {"type": "string"}}
  },
  "additionalProperties": true
}
