{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://devheallabs.com/dh-adom/source/02-Specification/Schema-Definitions/agent.schema.json",
  "title": "DH-ADOM Agent",
  "type": "object",
  "required": [
    "agent_id",
    "name",
    "type",
    "parent_agent",
    "feature",
    "intent",
    "permissions",
    "autonomy"
  ],
  "properties": {
    "agent_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "type": {
      "enum": [
        "ROOT",
        "FEATURE",
        "SPECIALIST",
        "REVIEWER",
        "TEST",
        "SECURITY",
        "RESEARCH",
        "RELEASE",
        "MAINTENANCE"
      ]
    },
    "parent_agent": {
      "type": [
        "string",
        "null"
      ]
    },
    "feature": {
      "type": [
        "string",
        "null"
      ]
    },
    "version": {
      "type": "string"
    },
    "owner": {
      "type": "string"
    },
    "intent": {
      "type": "object",
      "required": [
        "goal",
        "non_goals"
      ],
      "properties": {
        "goal": {
          "type": "string"
        },
        "non_goals": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "capabilities": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "skills": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "memory": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "autonomy": {
      "type": "object",
      "required": [
        "level",
        "max_steps",
        "max_runtime_seconds",
        "max_cost_usd",
        "max_delegation_depth"
      ],
      "properties": {
        "level": {
          "type": "string"
        },
        "max_steps": {
          "type": "integer",
          "minimum": 0
        },
        "max_runtime_seconds": {
          "type": "integer",
          "minimum": 0
        },
        "max_cost_usd": {
          "type": "number",
          "minimum": 0
        },
        "max_delegation_depth": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}