{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://harness-forge.dev/schemas/content/content-metadata.schema.json",
  "title": "Harness Forge Content Metadata",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "id",
    "kind",
    "title",
    "summary",
    "status",
    "owner",
    "applies_to",
    "languages",
    "generated"
  ],
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "kind": {
      "type": "string",
      "enum": [
        "command",
        "agent",
        "context",
        "rule",
        "example",
        "language-pack",
        "style-guide",
        "task-template",
        "workflow-template"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "summary": {
      "type": "string",
      "minLength": 1
    },
    "status": {
      "type": "string",
      "enum": ["draft", "stable", "deprecated"]
    },
    "owner": {
      "type": "string",
      "minLength": 1
    },
    "applies_to": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "languages": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "generated": {
      "type": "boolean"
    },
    "canonical_source": {
      "type": "string",
      "minLength": 1
    },
    "maturity": {
      "type": "string",
      "enum": ["seeded", "stable", "expanding"]
    },
    "targets": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "generated": {
            "const": true
          }
        }
      },
      "then": {
        "required": ["canonical_source"]
      }
    }
  ]
}
