{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/page-pattern-fixtures.schema.json",
  "title": "Page Pattern Fixtures",
  "type": "object",
  "required": ["description", "objective", "pattern_count", "fixture_count", "fixtures"],
  "properties": {
    "description": { "type": "string", "minLength": 1 },
    "objective": { "type": "string", "minLength": 1 },
    "pattern_count": { "type": "integer", "minimum": 1 },
    "fixture_count": { "type": "integer", "minimum": 1 },
    "fixtures": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "patternId",
          "route",
          "title",
          "scenario",
          "canonicalQuestion",
          "requiredVisibleSections",
          "metadataChecks",
          "schemaChecks",
          "traceabilityChecks",
          "sourceEvidence",
          "goodExample",
          "badExample",
          "agentInstructions",
          "qaGates",
          "completionCriteria"
        ],
        "properties": {
          "id": { "type": "string", "minLength": 1 },
          "patternId": { "type": "string", "minLength": 1 },
          "route": { "type": "string", "pattern": "^/" },
          "title": { "type": "string", "minLength": 1 },
          "scenario": { "type": "string", "minLength": 1 },
          "canonicalQuestion": { "type": "string", "minLength": 1 },
          "requiredVisibleSections": { "$ref": "#/$defs/nonEmptyStrings" },
          "metadataChecks": { "$ref": "#/$defs/nonEmptyStrings" },
          "schemaChecks": { "$ref": "#/$defs/nonEmptyStrings" },
          "traceabilityChecks": { "$ref": "#/$defs/nonEmptyStrings" },
          "sourceEvidence": { "$ref": "#/$defs/nonEmptyStrings" },
          "goodExample": { "type": "string", "minLength": 1 },
          "badExample": { "type": "string", "minLength": 1 },
          "agentInstructions": { "$ref": "#/$defs/nonEmptyStrings" },
          "qaGates": { "$ref": "#/$defs/nonEmptyStrings" },
          "completionCriteria": { "$ref": "#/$defs/nonEmptyStrings" }
        }
      }
    }
  },
  "$defs": {
    "nonEmptyStrings": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string", "minLength": 1 }
    }
  }
}
