Skip to content

skill.json

Source: schemas/skill.json

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Skill YAML backbone",
  "description": "JSON Schema for the skill.yaml backbone loaded by donna.skills.loader. Validates step structure, tool_invocations, and the on_failure DSL (F-W2-D).",
  "type": "object",
  "required": ["capability_name", "steps"],
  "properties": {
    "capability_name": {"type": "string"},
    "version": {"type": ["integer", "string"]},
    "steps": {
      "type": "array",
      "minItems": 1,
      "items": {"$ref": "#/definitions/step"}
    },
    "final_output": {"type": "string"}
  },
  "definitions": {
    "step": {
      "type": "object",
      "required": ["name"],
      "properties": {
        "name": {"type": "string"},
        "kind": {"enum": ["llm", "tool", "mixed"]},
        "prompt": {"type": "string"},
        "output_schema": {"type": "string"},
        "tools": {
          "type": "array",
          "items": {"type": "string"}
        },
        "tool_invocations": {
          "type": "array",
          "items": {"$ref": "#/definitions/tool_invocation"}
        }
      }
    },
    "tool_invocation": {
      "type": "object",
      "properties": {
        "tool": {"type": "string"},
        "for_each": {"type": "string"},
        "as": {"type": "string"},
        "args": {"type": "object"},
        "store_as": {"type": "string"},
        "retry": {
          "type": "object",
          "properties": {
            "max_attempts": {"type": "integer", "minimum": 1},
            "backoff_s": {
              "type": "array",
              "items": {"type": "number"}
            }
          }
        },
        "on_failure": {
          "description": "F-W2-D: failure policy for this tool invocation.",
          "enum": ["escalate", "continue", "fail_step", "fail_skill"],
          "default": "escalate"
        }
      }
    }
  }
}