{
  "$id": "https://raw.githubusercontent.com/MeterApp/skillhook/main/schema/skillhook.yaml.schema.json",
  "title": "skillhook.yaml",
  "description": "Hooks a repository declares for skillhook (https://github.com/MeterApp/skillhook/blob/main/docs/projects.md): webhook name → shell command, SKILL.md or prompt.",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string"
    },
    "claude": {
      "type": "object",
      "properties": {
        "permission_mode": {
          "type": "string",
          "enum": [
            "acceptEdits",
            "auto",
            "bypassPermissions",
            "manual",
            "dontAsk",
            "plan"
          ]
        },
        "allowed_tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "disallowed_tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "add_dirs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "max_budget_usd": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "append_system_prompt": {
          "type": "string"
        },
        "args": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "config_dir": {
          "type": "string",
          "minLength": 1
        },
        "mcp_servers": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "stdio",
                  "http",
                  "sse"
                ]
              },
              "command": {
                "type": "string",
                "minLength": 1
              },
              "args": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "env": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "headers": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "strict_mcp": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "skills": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1
          },
          {
            "type": "object",
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "path"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "hooks": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "runner": {
            "type": "string",
            "enum": [
              "claude",
              "codex",
              "shell"
            ]
          },
          "account": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
              },
              {
                "minItems": 1,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                }
              }
            ]
          },
          "model": {
            "type": "string"
          },
          "effort": {
            "type": "string"
          },
          "cwd": {
            "type": "string"
          },
          "timeout_seconds": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "auth": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "none"
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bearer"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "header": {
                    "type": "string"
                  },
                  "allow_query_token": {
                    "type": "boolean"
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "basic"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "hmac"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "header": {
                    "type": "string"
                  },
                  "prefix": {
                    "type": "string"
                  },
                  "encoding": {
                    "type": "string",
                    "enum": [
                      "hex",
                      "base64"
                    ]
                  },
                  "algorithm": {
                    "type": "string",
                    "enum": [
                      "sha256",
                      "sha1",
                      "sha512"
                    ]
                  },
                  "delivery_id_header": {
                    "type": "string"
                  },
                  "timestamp_header": {
                    "type": "string"
                  },
                  "tolerance_seconds": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "github"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "sentry"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "linear"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "standard-webhooks"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "tolerance_seconds": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "granola"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "tolerance_seconds": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "svix"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "tolerance_seconds": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "stripe"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "tolerance_seconds": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "slack"
                  },
                  "secret_env": {
                    "type": "string",
                    "pattern": "^[A-Z_][A-Z0-9_]*$"
                  },
                  "tolerance_seconds": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "allow_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              }
            ]
          },
          "when": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "header": {
                  "type": "string"
                },
                "query": {
                  "type": "string"
                },
                "equals": {},
                "not_equals": {},
                "in": {
                  "type": "array",
                  "items": {}
                },
                "matches": {
                  "type": "string"
                },
                "exists": {
                  "type": "boolean"
                },
                "contains": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "env": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "concurrency": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "serialize_cwd": {
            "type": "boolean"
          },
          "dedupe": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              },
              "header": {
                "type": "string"
              },
              "in_flight": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "claude": {
            "type": "object",
            "properties": {
              "permission_mode": {
                "type": "string",
                "enum": [
                  "acceptEdits",
                  "auto",
                  "bypassPermissions",
                  "manual",
                  "dontAsk",
                  "plan"
                ]
              },
              "allowed_tools": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "disallowed_tools": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "add_dirs": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "max_budget_usd": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "append_system_prompt": {
                "type": "string"
              },
              "args": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "config_dir": {
                "type": "string",
                "minLength": 1
              },
              "mcp_servers": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "stdio",
                        "http",
                        "sse"
                      ]
                    },
                    "command": {
                      "type": "string",
                      "minLength": 1
                    },
                    "args": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "env": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "headers": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              },
              "strict_mcp": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "codex": {
            "type": "object",
            "properties": {
              "sandbox": {
                "type": "string",
                "enum": [
                  "read-only",
                  "workspace-write",
                  "danger-full-access"
                ]
              },
              "network_access": {
                "type": "boolean"
              },
              "profile": {
                "type": "string"
              },
              "add_dirs": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "args": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "shell": {
            "type": "object",
            "properties": {
              "command": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                ]
              }
            },
            "required": [
              "command"
            ],
            "additionalProperties": false
          },
          "fallback": {
            "type": "object",
            "properties": {
              "runners": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "claude",
                        "codex",
                        "shell"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "runner": {
                          "type": "string",
                          "enum": [
                            "claude",
                            "codex",
                            "shell"
                          ]
                        },
                        "model": {
                          "type": "string"
                        },
                        "effort": {
                          "type": "string"
                        },
                        "account": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "runner"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "on": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "not_ready",
                    "auth",
                    "usage_limit",
                    "rate_limit",
                    "crash"
                  ]
                }
              }
            },
            "required": [
              "runners"
            ],
            "additionalProperties": false
          },
          "retry": {
            "type": "object",
            "properties": {
              "attempts": {
                "type": "integer",
                "minimum": 1,
                "maximum": 3
              },
              "on": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "auth",
                    "usage_limit",
                    "rate_limit",
                    "budget",
                    "max_turns",
                    "not_found",
                    "timeout",
                    "crash",
                    "unknown"
                  ]
                }
              },
              "backoff_seconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "attempts"
            ],
            "additionalProperties": false
          },
          "agent_api": {
            "type": "string",
            "enum": [
              "mcp",
              "cli",
              "none"
            ]
          },
          "human_wait_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          },
          "response": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "text",
                  "file",
                  "structured"
                ]
              },
              "schema": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              }
            },
            "additionalProperties": false
          },
          "enabled": {
            "type": "boolean"
          },
          "schedule": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "boolean",
                "const": false
              },
              {
                "type": "object",
                "properties": {
                  "cron": {
                    "type": "string",
                    "minLength": 1
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "catch_up": {
                    "type": "string",
                    "enum": [
                      "latest",
                      "all",
                      "none"
                    ]
                  },
                  "overlap": {
                    "type": "string",
                    "enum": [
                      "skip",
                      "queue"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "cron"
                ],
                "additionalProperties": false
              }
            ]
          },
          "webhook": {
            "type": "boolean"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "skill": {
            "type": "string",
            "minLength": 1
          },
          "run": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            ]
          },
          "prompt": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": false
      }
    }
  },
  "required": [
    "hooks"
  ],
  "additionalProperties": false
}
