{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://dedupedai.com/use-cases/schema.json",
 "title": "Deduped AI Use Case record",
 "type": "object",
 "description": "Full record published at /use-cases/u/<repo-slug>/<use-case-slug>.json. Fields are only ever added, never renamed.",
 "required": [
  "schema_version",
  "generated",
  "id",
  "repo",
  "title",
  "summary",
  "steps",
  "agent_prompt",
  "url",
  "disclaimer"
 ],
 "properties": {
  "schema_version": {
   "const": 1
  },
  "generated": {
   "type": "string",
   "format": "date"
  },
  "id": {
   "type": "string",
   "description": "repo-slug--use-case-slug"
  },
  "repo": {
   "type": "string",
   "description": "owner/name"
  },
  "repo_url": {
   "type": "string",
   "format": "uri"
  },
  "repo_slug": {
   "type": "string",
   "description": ""
  },
  "title": {
   "type": "string",
   "description": ""
  },
  "page_title": {
   "type": "string",
   "description": ""
  },
  "summary": {
   "type": "string",
   "description": "One or two sentences"
  },
  "who": {
   "type": "string",
   "description": ""
  },
  "problem": {
   "type": "string",
   "description": ""
  },
  "outcome": {
   "type": "string",
   "description": ""
  },
  "steps": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "agent_prompt": {
   "type": "string",
   "description": "Paste into a coding agent"
  },
  "agents": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "difficulty": {
   "type": "string",
   "description": ""
  },
  "time": {
   "type": "string",
   "description": "Human readable, e.g. 30 minutes"
  },
  "basis": {
   "enum": [
    "readme",
    "field"
   ]
  },
  "caveat": {
   "type": "string",
   "description": ""
  },
  "category": {
   "type": "string",
   "description": ""
  },
  "tags": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "lang": {
   "type": "string",
   "description": "Primary language, lowercase"
  },
  "requirements": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "risk": {
   "type": "string",
   "description": "e.g. dual-use"
  },
  "seen_in_the_wild": {
   "type": "boolean"
  },
  "best": {
   "type": "boolean"
  },
  "score": {
   "type": "number",
   "minimum": 0,
   "maximum": 1
  },
  "evidence": {
   "type": "array",
   "maxItems": 3,
   "items": {
    "type": "object",
    "required": [
     "url"
    ],
    "properties": {
     "platform": {
      "enum": [
       "x",
       "reddit",
       "hn"
      ]
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "posted": {
      "type": "string",
      "description": ""
     }
    }
   }
  },
  "url": {
   "type": "string",
   "format": "uri"
  },
  "md": {
   "type": "string",
   "format": "uri"
  },
  "disclaimer": {
   "type": "string",
   "description": "Full disclaimer text"
  }
 }
}
