{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Cortex Agent PRD State",
  "type": "object",
  "required": ["prd_id", "title", "status", "updated_at"],
  "properties": {
    "prd_id": { "type": "string" },
    "title": { "type": "string" },
    "status": {
      "type": "string",
      "enum": ["idea", "draft", "review", "approved", "designed", "implemented", "validated", "published", "blocked"]
    },
    "owner": { "type": ["string", "null"] },
    "summary": { "type": ["string", "null"] },
    "related_mission_id": { "type": ["string", "null"] },
    "related_tasks": {
      "type": "array",
      "items": { "type": "string" }
    },
    "design": {
      "type": "object",
      "properties": {
        "tool": { "type": ["string", "null"] },
        "status": {
          "type": "string",
          "enum": ["not_started", "draft", "reviewed", "ready", "blocked"]
        },
        "url": { "type": ["string", "null"] },
        "local_path": { "type": ["string", "null"] },
        "screen_count": { "type": ["number", "null"] },
        "export_target": { "type": ["string", "null"] }
      },
      "additionalProperties": true
    },
    "review": {
      "type": "object",
      "properties": {
        "decision_id": { "type": ["string", "null"] },
        "status": {
          "type": "string",
          "enum": ["open", "approved", "changes_requested", "blocked"]
        },
        "reviewer": { "type": ["string", "null"] }
      },
      "additionalProperties": true
    },
    "updated_at": { "type": "string" }
  },
  "additionalProperties": true
}

