{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/site-studies.schema.json",
  "title": "Site Studies",
  "type": "object",
  "required": ["description", "objective", "studies"],
  "properties": {
    "description": { "type": "string", "minLength": 1 },
    "objective": { "type": "string", "minLength": 1 },
    "studies": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "siteName",
          "url",
          "auditDate",
          "evidenceRoot",
          "evidenceFiles",
          "context",
          "strongPatterns",
          "avoidPatterns",
          "agentTakeaways",
          "linkedRoadmapItems"
        ],
        "properties": {
          "id": { "type": "string", "minLength": 1 },
          "siteName": { "type": "string", "minLength": 1 },
          "url": { "type": "string", "minLength": 1 },
          "auditDate": { "type": "string", "minLength": 1 },
          "evidenceRoot": { "type": "string", "minLength": 1 },
          "evidenceFiles": {
            "type": "array",
            "minItems": 1,
            "items": { "type": "string", "minLength": 1 }
          },
          "context": { "type": "string", "minLength": 1 },
          "strongPatterns": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": ["pattern", "why", "reuseAs", "checkToAdd"]
            }
          },
          "avoidPatterns": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": ["issue", "why", "detectedBy", "checkToAdd"]
            }
          },
          "agentTakeaways": {
            "type": "array",
            "minItems": 1,
            "items": { "type": "string", "minLength": 1 }
          },
          "linkedRoadmapItems": {
            "type": "array",
            "minItems": 1,
            "items": { "type": "string", "minLength": 1 }
          }
        }
      }
    }
  }
}
