Agent skill · software engineering · lobehub

agent-runtime-hooks

Use for agent lifecycle hooks, tool mocks, intervention, sub-agent calls and context compression.

Why this skill is useful

Adds executable lifecycle hooks for agent operations, enabling advanced control and monitoring that the AI cannot generate on its own.

What it needs

Requires typescript installed locally. About 7k tokens when loaded. Last updated 2026-08-07. 81,352 stars on the source repository.

What this skill does

Agent Runtime Hooks Register lifecycle hooks through execAgent({ hooks }). HookDispatcher stores them per operation and dispatches them in registration order. Hook Types 16 hook types across 5 categories: Key Files File Role ---------------------------------------------------------------------- --------------------------------------------------------- packages/agent-runtime/src/types/hooks.ts Event types and required/optional fields apps/server/src/services/agentRuntime/hooks/types.ts Registration and webhook types apps/server/src/services/agentRuntime/hooks/HookDispatcher.ts Registration, dispatch, local mocks, HTTP/QStash delivery apps/server/src/services/agentRuntime/hooks/webhookPayload.ts Event projection and email enrichment apps/server/src/modules/AgentRuntime/adapters/toolCallHookContext.ts Shared tool-event context builder apps/server/src/modules/AgentRuntime/adapters/ServerToolTransport.ts Tool notifications and execution results apps/server/src/modules/AgentRuntime/RuntimeExecutors.ts Tool, compression and human-intervention execution apps/server/src/services/agentRuntime/AgentRuntimeService.ts Step events and human-intervention continuation apps/server/src/services/agentRuntime/CompletionLifecycle.ts Terminal events apps/server/src/services/aiAgent/subAgentRuns.ts Sub-agent events Registration Completion cleans up registrations through hookDispatcher.unregister(operationId). Webhook Hooks Webhook-only hooks deliver in both local and queue modes. For hooks with both handler and webhook, local dispatch calls the handler; queue dispatch uses the serialized webhook. Only webhook configuration is persisted, so functions are unavailable after a process restart. matcher is a regex against ${identifier}/${apiName}, supported only on tool events. Omitted, empty, or matches all tools. Header environment templates resolve only at send time from allowedEnvVars; persist templates, never resolved secrets. Notifications ignore response content and may return HTTP 204. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills lobehub/agent-runtime-hooks--aae627

View the source on GitHub

Browse the @skills marketplace