Hook Authoring

Define lifecycle hooks and decision semantics for Meerkat's agent runtime.

19|5|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/lukacf/meerkat --skill hook-authoring-lukacf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Hook Authoring
Source: https://github.com/lukacf/meerkat/tree/main/meerkat-hooks/skills/hook-authoring
Command: npx skills add https://github.com/lukacf/meerkat --skill hook-authoring-lukacf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hook authoring for Meerkat enables developers to implement and customize lifecycle hooks, execution modes, and decision semantics that govern agent behavior.

Core Features & Use Cases

  • Hook points: Supports the eight lifecycle hook points (RunStarted, PreLlmRequest, PostLlmResponse, PreToolExecution, PostToolExecution, TurnBoundary, RunCompleted, RunFailed).
  • Execution modes: Enables Foreground, Background, and Observe modes for hooks and monitoring.
  • Patch-based rewrites: Allows hooks to rewrite tool arguments using JSON patches in PreToolExecution.

Quick Start

Create a sample SKILL.md that defines hooks for RunStarted and PreToolExecution, including a patch-based rewrite example.

Frequently Asked Questions about Hook Authoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define lifecycle hooks for an agent runtime to intercept tool execution?

Lifecycle hook points like RunStarted, PreToolExecution, and RunCompleted allow you to intercept agent runtime events at specific execution boundaries. They enable custom logic injection for monitoring, safety checks, or argument modifications across Foreground, Background, and Observe execution modes.

Can I rewrite tool arguments before execution using JSON patches?

Yes, you can rewrite tool arguments using JSON patches within the PreToolExecution hook. This patch-based rewrite mechanism allows you to dynamically alter tool inputs right before they execute, ensuring parameters meet your custom safety policies or operational requirements.

What happens when a lifecycle hook fails during agent execution?

When a lifecycle hook fails, the agent runtime applies either a fail-closed or fail-open safety policy. Enforcing a fail-closed policy halts execution to prevent unsafe actions, while fail-open allows the agent to proceed despite the hook failure.

How do I run monitoring hooks without blocking the main agent runtime process?

Run monitoring hooks in Observe or Background execution modes to avoid blocking the main agent runtime process. Foreground mode pauses execution until the hook completes, whereas Observe and Background modes allow non-intrusive monitoring and asynchronous task processing.

Does hook authoring require any specific dependencies or environment setup?

Hook authoring requires no external dependencies, but you must create a SKILL.md file with YAML frontmatter containing name and description fields. This file defines your custom hooks and decision semantics for the Meerkat agent runtime environment.