This document provides debugging protocols for the plugin-expert agent.
Validates and debugs Claude Code hook configurations, scripts, and functionality for plugin development.
/plugin marketplace add Git-Fg/thecattoolkit/plugin install git-fg-bootstrap-plugins-bootstrap@Git-Fg/thecattoolkitThis document provides debugging protocols for the plugin-expert agent.
When verifying guard hooks:
Detect Plugin Type:
guard-python → Python hooksguard-ts → TypeScript hooksVerify Configuration:
hooks.json exists in plugin directory${CLAUDE_PLUGIN_ROOT}Validate:
hook-tester.py validate on the plugin's hooks.jsonWhen debugging hook failures, focus on systematic validation of the hook system components:
Locate and verify the hooks.json configuration file exists in the correct location (.claude/hooks/hooks.json). Validate the JSON structure is well-formed and matches the expected schema for the hook events being used.
Ensure all referenced hook scripts are present in the .cattoolkit/hooks/scripts/ directory and have proper execute permissions. Check that scripts can be invoked without permission errors.
Validate hook scripts by testing them with appropriate JSON payloads matching their expected event types. Verify that each script outputs valid JSON responses conforming to Claude Code's requirements:
Identify and resolve common failure patterns:
Ensure hooks implement appropriate security patterns including path validation, error handling, and proper checking of flags like stop_hook_active for stop events.
Execute full validation using the hook testing tools to verify the complete hook suite functions correctly across all configured events.
Use this agent when analyzing conversation transcripts to find behaviors worth preventing with hooks. Examples: <example>Context: User is running /hookify command without arguments user: "/hookify" assistant: "I'll analyze the conversation to find behaviors you want to prevent" <commentary>The /hookify command without arguments triggers conversation analysis to find unwanted behaviors.</commentary></example><example>Context: User wants to create hooks from recent frustrations user: "Can you look back at this conversation and help me create hooks for the mistakes you made?" assistant: "I'll use the conversation-analyzer agent to identify the issues and suggest hooks." <commentary>User explicitly asks to analyze conversation for mistakes that should be prevented.</commentary></example>