create-hook

Scaffold event-driven Claude Code hooks with validation and test scripts.

5|3|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/richfrem/agent-plugins-skills --skill create-hook-richfrem
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hook
Source: https://github.com/richfrem/agent-plugins-skills/tree/main/plugins/agent-scaffolders/skills/create-hook
Command: npx skills add https://github.com/richfrem/agent-plugins-skills --skill create-hook-richfrem

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill simplifies creating robust, event-driven hooks for Claude Code, reducing manual setup time and potential misconfigurations.

Core Features & Use Cases

  • Workflow scaffolding: Generates a complete hook configuration framework including event selection, matcher design, and handler type.
  • Validation & testing: Integrates hooks for schema validation (validate_hook_schema.py) and unit tests (test_hook.py).
  • Use Case: A team wants to intercept PreToolUse events to enforce safety checks or custom logging without building from scratch.

Quick Start

Use the create-hook skill to scaffold a new hook configuration for a PreToolUse event.

Frequently Asked Questions about create-hook

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

FAQPage Schema
How do I scaffold a Claude Code hook for PreToolUse events?

A Claude Code hook intercepts events like PreToolUse, Stop, or PermissionRequest to enforce safety checks or custom logging. It uses an event-driven architecture to trigger specific handlers when those actions occur.

What is the best way to automate validation for Claude Code hooks?

The best way to automate validation for Claude Code hooks is by integrating schema validation scripts like validate_hook_schema.py. This ensures your hook configurations conform to required schemas before deployment.

Does scaffolding a Claude hook require existing test scripts?

Yes, scaffolding a Claude hook requires existing validation scripts such as validate_hook_schema.py and test_hook.py. These scripts enforce schema compliance and unit testing across multiple event types during generation.

Can I intercept Stop and PermissionRequest events with a scaffolded hook?

Yes, you can intercept Stop and PermissionRequest events. The scaffolding process supports generating, validating, and testing hooks across multiple event types to handle various plugin workflow scenarios.

Why separate hook entry configuration from execution logic?

Separating hook entry configuration from execution logic enforces a clean architecture that simplifies validation and testing. This separation prevents misconfigurations and makes the event-driven hook easier to maintain.