{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aiusecasesforbusiness.com/schemas/use-case.schema.json",
  "title": "Use case",
  "description": "One real, sourced business use case. One file per use case in content/use-cases/<slug>.json.",
  "type": "object",
  "required": [
    "slug",
    "title",
    "outcome",
    "explainSimply",
    "businessTypes",
    "tools",
    "category",
    "mode",
    "whatWasDone",
    "howItWent",
    "evidence",
    "prompt",
    "fit",
    "similarTools",
    "source",
    "dateAdded"
  ],
  "additionalProperties": false,
  "properties": {
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
      "maxLength": 90
    },
    "status": {
      "type": "string",
      "enum": [
        "published",
        "hidden"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 10,
      "maxLength": 96
    },
    "outcome": {
      "type": "string",
      "minLength": 20,
      "maxLength": 260
    },
    "explainSimply": {
      "type": "string",
      "minLength": 40,
      "maxLength": 600,
      "description": "2 to 4 plain-language sentences for readers new to AI tools. No jargon."
    },
    "vendorCaseStudy": {
      "type": "boolean",
      "description": "True when the source is the tool maker's own case study or launch post. Shows a note at the top of the page."
    },
    "businessTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "solo-founders",
          "startups",
          "content-creators",
          "shopify-ecommerce",
          "agencies-consultants",
          "local-service"
        ]
      },
      "minItems": 1,
      "maxItems": 4
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
        "maxLength": 90
      },
      "minItems": 1,
      "maxItems": 4
    },
    "category": {
      "type": "string",
      "enum": [
        "support",
        "operations",
        "sales",
        "marketing",
        "content",
        "finance",
        "product"
      ]
    },
    "mode": {
      "type": "string",
      "enum": [
        "autopilot",
        "approve",
        "assist"
      ]
    },
    "whatWasDone": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 420
      },
      "minItems": 1,
      "maxItems": 6
    },
    "howItWent": {
      "type": "object",
      "required": [
        "summary"
      ],
      "additionalProperties": false,
      "properties": {
        "summary": {
          "type": "string",
          "minLength": 1,
          "maxLength": 420
        },
        "points": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 320
          },
          "maxItems": 6
        }
      }
    },
    "evidence": {
      "type": "object",
      "required": [
        "grade",
        "note"
      ],
      "additionalProperties": false,
      "properties": {
        "grade": {
          "type": "string",
          "enum": [
            "A",
            "B",
            "C",
            "D"
          ]
        },
        "note": {
          "type": "string",
          "minLength": 1,
          "maxLength": 220
        }
      }
    },
    "prompt": {
      "type": "object",
      "required": [
        "text",
        "origin"
      ],
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "string",
          "minLength": 20,
          "maxLength": 2600
        },
        "origin": {
          "type": "string",
          "enum": [
            "editor",
            "source",
            "submitter",
            "xai-listed-template",
            "adapted"
          ]
        },
        "note": {
          "type": "string",
          "minLength": 1,
          "maxLength": 240
        }
      }
    },
    "setup": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 320
      },
      "maxItems": 8
    },
    "fit": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "how"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "solo-founders",
              "startups",
              "content-creators",
              "shopify-ecommerce",
              "agencies-consultants",
              "local-service"
            ]
          },
          "how": {
            "type": "string",
            "minLength": 1,
            "maxLength": 220
          }
        }
      },
      "minItems": 1,
      "maxItems": 4
    },
    "similarTools": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "tool",
          "note"
        ],
        "additionalProperties": false,
        "properties": {
          "tool": {
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
            "maxLength": 90,
            "description": "A tool in content/tools/, other than the tools this use case already lists."
          },
          "note": {
            "type": "string",
            "minLength": 20,
            "maxLength": 140,
            "description": "One line on how this tool differs for the same job. Facts come from its tool page or from \"source\"."
          },
          "see": {
            "type": "object",
            "required": [
              "type",
              "ref"
            ],
            "additionalProperties": false,
            "description": "Optional page on this site that shows the tool doing the same job.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "use-case",
                  "guide",
                  "grok-prompt",
                  "grok-stack"
                ]
              },
              "ref": {
                "type": "string",
                "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
                "maxLength": 90
              }
            }
          },
          "source": {
            "type": "object",
            "required": [
              "title",
              "url",
              "publisher"
            ],
            "additionalProperties": false,
            "properties": {
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "publisher": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "author": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "date": {
                "type": "string",
                "format": "date"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "first-person",
                  "vendor",
                  "press",
                  "secondhand",
                  "guide",
                  "official"
                ]
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 240
              }
            },
            "description": "Where the note's claim comes from, when the tool page doesn't already state it."
          }
        }
      },
      "minItems": 1,
      "maxItems": 4,
      "description": "Only tools that genuinely do the same job. Aim for 2 to 4; never pad with loosely related tools."
    },
    "source": {
      "type": "object",
      "required": [
        "title",
        "url",
        "publisher"
      ],
      "additionalProperties": false,
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "publisher": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "author": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "date": {
          "type": "string",
          "format": "date"
        },
        "kind": {
          "type": "string",
          "enum": [
            "first-person",
            "vendor",
            "press",
            "secondhand",
            "guide",
            "official"
          ]
        },
        "note": {
          "type": "string",
          "minLength": 1,
          "maxLength": 240
        }
      }
    },
    "moreSources": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "title",
          "url",
          "publisher"
        ],
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "publisher": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "author": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "kind": {
            "type": "string",
            "enum": [
              "first-person",
              "vendor",
              "press",
              "secondhand",
              "guide",
              "official"
            ]
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          }
        }
      }
    },
    "related": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
        "maxLength": 90
      },
      "maxItems": 6
    },
    "featured": {
      "type": "boolean"
    },
    "dateAdded": {
      "type": "string",
      "format": "date"
    },
    "lastReviewed": {
      "type": "string",
      "format": "date"
    },
    "intake": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    }
  }
}
