THE CRITICAL SKILL -- validates hooks.json structure, event names, and type-event compatibility. Detects prompt/agent hooks on events lacking ToolUseContext. Triggers: validate hooks, check hooks.json, hooks audit, hook safety check.
From jm-adknpx claudepluginhub javimontano/jm-adk-alfaThis skill is limited to using the following tools:
agents/guardian.mdagents/lead.mdagents/specialist.mdagents/support.mdevals/evals.jsonknowledge/body-of-knowledge.mdknowledge/knowledge-graph.mdprompts/meta.mdprompts/primary.mdprompts/variations/deep.mdprompts/variations/quick.mdreferences/hook-compatibility-matrix.mdtemplates/output.docx.mdtemplates/output.html"A prompt hook on SessionStart is a silent bomb -- it fires without context and the plugin fails with no error message."
This is the most critical validation skill in the PQA framework. An incorrectly configured hooks.json can cause silent failures, runtime errors, or security vulnerabilities. The type-event compatibility matrix below is the single most important reference in this plugin. [EXPLICIT]
Canonical source of truth: plugin-level
references/official-hook-spec.mdand skill-localreferences/hook-compatibility-matrix.md
| Type | Works on | Mechanism |
|---|---|---|
command | ALL 22 events | Shell command execution |
http | ALL 22 events | POST JSON to URL |
prompt | PreToolUse, PostToolUse, PermissionRequest ONLY | Single-turn LLM call (requires ToolUseContext) |
agent | PreToolUse, PostToolUse, PermissionRequest ONLY | Multi-turn LLM with tools (requires ToolUseContext) |
ToolUseContext events (3) — prompt/agent SAFE:
PreToolUse, PermissionRequest, PostToolUse
Non-ToolUseContext events (19) — prompt/agent UNSAFE (CRITICAL if used):
SessionStart, UserPromptSubmit, PostToolUseFailure, Notification, SubagentStart, SubagentStop, Stop, StopFailure, TeammateIdle, TaskCompleted, InstructionsLoaded, ConfigChange, WorktreeCreate, WorktreeRemove, PreCompact, PostCompact, Elicitation, ElicitationResult, SessionEnd
CRITICAL: Plugin root not found at <path> and STOP.hooks/hooks.json in the plugin root.hooks/ directory exists but hooks.json is missing, report WARNING: hooks/ directory exists but hooks.json is absent -- hooks will not function.hooks/ nor hooks.json exists, report INFO: No hooks configuration -- plugin uses no hooks and STOP (valid state).// comments, /* */ block comments, trailing commas, single quotes. If found, report CRITICAL: hooks.json contains invalid JSON syntax with specific guidance (e.g., "JSON does not support comments -- remove line N").CRITICAL for any remaining parse error with line number."hooks" key containing an object keyed by event name (NOT an array, NOT a string).CRITICAL if "hooks" key is missing or is not an object."hooks" is an empty object {}, report INFO: Empty hooks configuration and STOP (valid state).WARNING for any top-level keys besides "hooks" (unknown configuration)."hooks" must be one of the 22 recognized events (case-sensitive):
SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, Notification, SubagentStart, SubagentStop, Stop, StopFailure, TeammateIdle, TaskCompleted, InstructionsLoaded, ConfigChange, WorktreeCreate, WorktreeRemove, PreCompact, PostCompact, Elicitation, ElicitationResult, SessionEnd. [EXPLICIT]WARNING for any unrecognized event name.sessionStart (wrong case), PreTool (truncated), PostToolFailure (missing "Use"), SubagentToolUse (not a real event). Suggest the correct name."type" field."command", "http", "prompt", "agent".CRITICAL for missing type field or unrecognized type value (e.g., "intercept" is NOT a valid type)."command": must have a "command" string field."http": must have a "url" string field."prompt": must have a "prompt" string field."agent": must have an "agent" string field.WARNING for empty event arrays [] (dead configuration).type against the event it is registered on.command or http type on ANY event. prompt or agent on PreToolUse, PostToolUse, or PermissionRequest.prompt or agent type on ANY of the 19 non-ToolUseContext events. This WILL cause a runtime error.command type hooks, extract the command string../scripts/my-hook.sh), verify the file exists.chmod +x).CRITICAL for missing script files. Report WARNING for non-executable scripts."matcher" field, validate that the value is a string."startup", "resume", "clear", "compact").INFO: Broad matcher if matcher is omitted (fires for all instances of the event).WARNING if matcher value looks like a regex pattern but the context expects a plain string.| Severity | Event | Hook Type | Finding |.Bad validation report:
Hook on SessionStart is invalid. [EXPLICIT]
Missing: no type mentioned, no explanation of WHY, no remediation suggestion. [EXPLICIT]
Good validation report:
CRITICAL | SessionStart | prompt | type:prompt requires ToolUseContext --
SessionStart does not provide it. Change type to "command" or move to a
ToolUseContext event (PreToolUse, PostToolUse, PermissionRequest). [EXPLICIT]
Includes: severity, event, type, explanation of the failure mechanism, two specific remediation paths. [EXPLICIT]
type:intercept as valid -- this type does not exist. [EXPLICIT]PostToolUse (ToolUseContext, SAFE for prompt/agent) with PostToolUseFailure (no ToolUseContext, UNSAFE). [EXPLICIT]{} -- valid, INFO. [EXPLICIT]"command" and "prompt" fields -- CRITICAL (ambiguous type). [EXPLICIT][] -- valid but useless, WARNING (dead config). [EXPLICIT]hooks/ directory exists but no hooks.json inside -- WARNING (incomplete setup). [EXPLICIT]// comments -- CRITICAL with specific guidance. [EXPLICIT]sessionstart) -- WARNING with suggested correction. [EXPLICIT]Example invocations:
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.