{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://carlashub.github.io/Agents-Workflow-Blueprint/docs/template-library/asset.schema.json",
  "title": "Agent Workflow Blueprint asset",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "version",
    "type",
    "title",
    "purpose",
    "category",
    "profile",
    "governance_profile",
    "intended_model_context",
    "dependencies",
    "shared_controls",
    "evidence_expectations",
    "path",
    "summary",
    "tags",
    "pack",
    "research_patterns",
    "research_pattern_labels",
    "risk_level",
    "required_inputs",
    "expected_outputs",
    "evaluation_cases"
  ],
  "properties": {
    "id": { "type": "string", "pattern": "^(prompt|skill|contract)-[a-z0-9]+(?:-[a-z0-9]+)*$" },
    "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
    "type": { "enum": ["prompt", "skill", "contract"] },
    "title": { "type": "string", "minLength": 3 },
    "purpose": { "type": "string", "minLength": 20 },
    "category": { "type": "string", "minLength": 2 },
    "profile": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
    "governance_profile": { "enum": ["GOV-PROFILE-PROMPT", "GOV-PROFILE-SKILL", "GOV-PROFILE-CONTRACT"] },
    "intended_model_context": { "type": "string", "minLength": 20 },
    "dependencies": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 1 }
    },
    "shared_controls": {
      "type": "array",
      "uniqueItems": true,
      "items": { "type": "string", "pattern": "^SPC-[A-F0-9]{10}$" }
    },
    "evidence_expectations": {
      "type": "array",
      "minItems": 2,
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 4 }
    },
    "path": { "type": "string", "pattern": "^docs/template-library/(prompts|skills|contracts)/[a-z0-9-]+\\.md$" },
    "summary": { "type": "string", "minLength": 20 },
    "tags": { "type": "array", "minItems": 2, "uniqueItems": true, "items": { "type": "string" } },
    "pack": { "type": "string", "minLength": 2 },
    "research_patterns": { "type": "array", "minItems": 3, "uniqueItems": true, "items": { "type": "string" } },
    "research_pattern_labels": { "type": "array", "minItems": 3, "uniqueItems": true, "items": { "type": "string", "minLength": 3 } },
    "risk_level": { "enum": ["standard", "elevated", "high"] },
    "required_inputs": {
      "type": "array",
      "minItems": 3,
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 12 }
    },
    "expected_outputs": {
      "type": "array",
      "minItems": 3,
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 12 }
    },
    "evaluation_cases": {
      "type": "array",
      "uniqueItems": true,
      "items": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }
    }
  }
}
