SkillKit.Hook (SkillKit v0.1.0)

Copy Markdown View Source

Represents a lifecycle hook that fires at agent boundaries.

Hooks are gate-only: they can allow, deny, or suspend execution — never transform input or output.

Fields

FieldTypeDescription
:eventevent()Which lifecycle event triggers this hook
:matcherRegex.t()Regex matched against the boundary's match target
:handlerhandler()Logic to run — function, MFA, or {module, config}

Summary

Types

event()

@type event() ::
  :pre_tool_use
  | :post_tool_use
  | :pre_subagent
  | :post_subagent
  | :pre_skill_activation
  | :post_skill_activation
  | :pre_conversation_save
  | :post_conversation_save
  | :pre_conversation_load
  | :post_conversation_load
  | :pre_llm_request
  | :post_llm_request
  | :pre_turn
  | :post_turn
  | :pre_agent
  | :post_agent

handler()

@type handler() :: {module(), map()} | (map() -> any()) | {module(), atom(), list()}

t()

@type t() :: %SkillKit.Hook{
  event: event() | nil,
  handler: handler() | nil,
  matcher: Regex.t() | nil
}