{
  "$id": "https://raw.githubusercontent.com/outfitter-dev/skillset/main/docs/reference/schemas/0.1.0/adaptive-hook.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "claude": {
      "additionalProperties": false,
      "properties": {
        "context": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "additionalProperties": false,
              "properties": {
                "env": {
                  "items": {
                    "enum": [
                      "hook.event",
                      "provider",
                      "session.id"
                    ],
                    "type": "string"
                  },
                  "minItems": 1,
                  "type": "array",
                  "uniqueItems": true
                },
                "includeRaw": {
                  "type": "boolean"
                },
                "strategy": {
                  "enum": [
                    "inline",
                    "none",
                    "toolkit"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            }
          ]
        },
        "events": {
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        },
        "match": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "object"
            }
          ]
        },
        "run": {
          "additionalProperties": false,
          "properties": {
            "args": {
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            },
            "command": {
              "minLength": 1,
              "type": "string"
            },
            "cwd": {
              "minLength": 1,
              "type": "string"
            },
            "env": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "script": {
              "minLength": 1,
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "codex": {
      "additionalProperties": false,
      "properties": {
        "context": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "additionalProperties": false,
              "properties": {
                "env": {
                  "items": {
                    "enum": [
                      "hook.event",
                      "provider",
                      "session.id"
                    ],
                    "type": "string"
                  },
                  "minItems": 1,
                  "type": "array",
                  "uniqueItems": true
                },
                "includeRaw": {
                  "type": "boolean"
                },
                "strategy": {
                  "enum": [
                    "inline",
                    "none",
                    "toolkit"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            }
          ]
        },
        "events": {
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        },
        "match": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "object"
            }
          ]
        },
        "run": {
          "additionalProperties": false,
          "properties": {
            "args": {
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            },
            "command": {
              "minLength": 1,
              "type": "string"
            },
            "cwd": {
              "minLength": 1,
              "type": "string"
            },
            "env": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "script": {
              "minLength": 1,
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "context": {
      "additionalProperties": false,
      "properties": {
        "env": {
          "items": {
            "enum": [
              "hook.event",
              "provider",
              "session.id"
            ],
            "type": "string"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        },
        "includeRaw": {
          "type": "boolean"
        },
        "strategy": {
          "enum": [
            "inline",
            "none",
            "toolkit"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "cursor": {
      "additionalProperties": false,
      "properties": {
        "context": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "additionalProperties": false,
              "properties": {
                "env": {
                  "items": {
                    "enum": [
                      "hook.event",
                      "provider",
                      "session.id"
                    ],
                    "type": "string"
                  },
                  "minItems": 1,
                  "type": "array",
                  "uniqueItems": true
                },
                "includeRaw": {
                  "type": "boolean"
                },
                "strategy": {
                  "enum": [
                    "inline",
                    "none",
                    "toolkit"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            }
          ]
        },
        "events": {
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        },
        "match": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "object"
            }
          ]
        },
        "run": {
          "additionalProperties": false,
          "properties": {
            "args": {
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            },
            "command": {
              "minLength": 1,
              "type": "string"
            },
            "cwd": {
              "minLength": 1,
              "type": "string"
            },
            "env": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "script": {
              "minLength": 1,
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "description": {
      "minLength": 1,
      "type": "string"
    },
    "events": {
      "items": {
        "minLength": 1,
        "type": "string"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "match": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "object"
        }
      ]
    },
    "name": {
      "minLength": 1,
      "type": "string"
    },
    "providers": {
      "items": {
        "enum": [
          "claude",
          "codex",
          "cursor"
        ],
        "type": "string"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "run": {
      "additionalProperties": false,
      "properties": {
        "args": {
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "type": "array"
        },
        "command": {
          "minLength": 1,
          "type": "string"
        },
        "cwd": {
          "minLength": 1,
          "type": "string"
        },
        "env": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        "script": {
          "minLength": 1,
          "type": "string"
        }
      },
      "type": "object"
    },
    "status": {
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "events",
    "run"
  ],
  "title": "Adaptive Hook Unit",
  "type": "object"
}
