{
  "$defs": {
    "CompleteWhenFrontmatter": {
      "additionalProperties": false,
      "description": "Skill-level ``complete_when`` mapping (``condition`` and/or ``criteria``).",
      "properties": {
        "condition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Condition"
        },
        "criteria": {
          "items": {
            "type": "string"
          },
          "title": "Criteria",
          "type": "array"
        }
      },
      "title": "CompleteWhenFrontmatter",
      "type": "object"
    },
    "RequiresConfirmationDocument": {
      "additionalProperties": false,
      "description": "Confirmation gate under a tool constraint.\n\n``enabled`` turns the pause on. ``utter_for_confirmation`` and\n``utter_on_user_denial`` name responses in ``responses.yml``. Omit a name\nto leave that line to the model.",
      "properties": {
        "enabled": {
          "default": false,
          "title": "Enabled",
          "type": "boolean"
        },
        "utter_for_confirmation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Utter For Confirmation"
        },
        "utter_on_user_denial": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Utter On User Denial"
        }
      },
      "title": "RequiresConfirmationDocument",
      "type": "object"
    },
    "SkillReferencesFrontmatter": {
      "additionalProperties": false,
      "description": "Skill-level answering guidance under ``references``.",
      "properties": {
        "instructions": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Instructions"
        }
      },
      "title": "SkillReferencesFrontmatter",
      "type": "object"
    },
    "SkillRoutingFrontmatter": {
      "additionalProperties": false,
      "description": "Engine routing flags under ``routing``.",
      "properties": {
        "engine_managed": {
          "default": false,
          "title": "Engine Managed",
          "type": "boolean"
        },
        "is_default": {
          "default": false,
          "title": "Is Default",
          "type": "boolean"
        }
      },
      "title": "SkillRoutingFrontmatter",
      "type": "object"
    },
    "ToolConstraintEntry": {
      "additionalProperties": {
        "$ref": "#/$defs/ToolConstraintOptions"
      },
      "description": "One ``tool_constraints`` item: a single tool name mapped to its options.",
      "maxProperties": 1,
      "minProperties": 1,
      "title": "ToolConstraintEntry",
      "type": "object"
    },
    "ToolConstraintOptions": {
      "additionalProperties": false,
      "description": "Options for one tool under ``tool_constraints``.",
      "properties": {
        "on_failure": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "On Failure"
        },
        "on_success": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "On Success"
        },
        "requires": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Requires"
        },
        "requires_confirmation": {
          "anyOf": [
            {
              "$ref": "#/$defs/RequiresConfirmationDocument"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "title": "ToolConstraintOptions",
      "type": "object"
    },
    "UtterTriggerEntry": {
      "additionalProperties": {
        "$ref": "#/$defs/UtterTriggerOptions"
      },
      "description": "One ``utter`` item: a response name mapped to its trigger options.",
      "maxProperties": 1,
      "minProperties": 1,
      "title": "UtterTriggerEntry",
      "type": "object"
    },
    "UtterTriggerOptions": {
      "additionalProperties": false,
      "description": "When one ``utter`` response fires (``on: activate`` and/or ``when``).",
      "properties": {
        "on": {
          "anyOf": [
            {
              "const": "activate",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "On"
        },
        "when": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "When"
        }
      },
      "title": "UtterTriggerOptions",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Authoring shape of ``skill.md`` YAML frontmatter.\n\nSupported keys only. Skill-level ``requires`` is rejected before\nvalidation so it is not part of this contract.",
  "properties": {
    "always_include_in_prompt": {
      "default": false,
      "title": "Always Include In Prompt",
      "type": "boolean"
    },
    "complete_when": {
      "anyOf": [
        {
          "$ref": "#/$defs/CompleteWhenFrontmatter"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Description"
    },
    "disabled": {
      "default": false,
      "title": "Disabled",
      "type": "boolean"
    },
    "hidden": {
      "default": false,
      "title": "Hidden",
      "type": "boolean"
    },
    "import_tools": {
      "items": {
        "type": "string"
      },
      "title": "Import Tools",
      "type": "array"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Name"
    },
    "precondition": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Precondition"
    },
    "references": {
      "anyOf": [
        {
          "$ref": "#/$defs/SkillReferencesFrontmatter"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "routing": {
      "$ref": "#/$defs/SkillRoutingFrontmatter"
    },
    "tool_constraints": {
      "items": {
        "$ref": "#/$defs/ToolConstraintEntry"
      },
      "title": "Tool Constraints",
      "type": "array"
    },
    "utter": {
      "items": {
        "$ref": "#/$defs/UtterTriggerEntry"
      },
      "title": "Utter",
      "type": "array"
    }
  },
  "title": "skill.md frontmatter",
  "type": "object"
}
