Skip to content

Build a hook

Add an event-driven hook (Advanced tier) to a plugin: author it, register it, and document its behavior.

Invoke askit-build-hook (create mode). It asks for the event (for example PreToolUse), the trigger/matcher, the hook type (command / http / mcp_tool / prompt / agent), the scope, and the failure behavior. It scaffolds the hook + its hooks/hooks.json registration (copying templates/hooks.json if needed).

Event, trigger, scope, and failure behavior (Standard sec 3.5). A blocking hook must also carry an actionable message, and must be idempotent if its event can repeat.

Add the hook to library.json components.hooks as { name, version, tier, status }. For Codex, verify current plugin-hook ingestion at build time and set agent-targets to match.

node scripts/evaluate.mjs . --json

Hook documentation and idempotency are graded at the Advanced tier; the deterministic hook check arrives with Gold self-hosting (Phase 5).