hook-creator
This skill should be used when the user asks to "create a hook", "write hook config", "add hooks.json", "configure event hooks", "create PreToolUse hook", "add SessionStart hook", "implement hook validation", "set up event-driven automation", needs guidance on hooks.json structure, hook events (PreToolUse, PostToolUse, Stop, SessionStart, SessionEnd, UserPromptSubmit), or wants to automate workflows and implement event-driven behavior in Claude Code plugins.
npx skills add majiayu000/claude-skill-registry --skill hook-creator-basher83-agent-auditor --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Hook Creator ## Overview Creates hook configurations that respond to Claude Code events automatically. Hooks enable automation like formatting on save, running tests after edits, or custom session initialization. **When to use:** User wants to automate workflows, needs event-driven behavior, or requests hooks for their plugin. **References:** Consult `plugins/meta/claude-docs/skills/claude-docs/reference/plugins-reference.md` for hook specifications and available events. ## Hook Structure Requirements Hooks are defined in `hooks/hooks.json` with: 1. **Event type** (SessionStart, PostToolUse, etc.) 2. **Matcher** (optional, for filtering which tool uses trigger hook) 3. **Hook actions** (command, validation, notification) 4. **Proper use of** `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths ## Available Events From official documentation: - `PreToolUse` - Before Claude uses any tool - `PostToolUse` - After Claude uses any tool - `UserPromptSubmit` - When user submits a prompt - `Notification` - When Claude Code sends notifications - `Stop` - When Claude attempts to stop - `SubagentStop` - When subagent attempts to stop - `SessionStart` - At session beginning - `SessionEnd` - At s
- Overview
- Hook Structure Requirements
- Available Events
- Creation Process
- Step 1: Identify Event and Purpose
- Step 2: Choose Hook Type
- Step 3: Write Hook Configuration
- Step 4: Create Associated Scripts
- Step 5: Verify Against Official Docs
- Key Principles
- Examples
- Example 1: Code Formatting Hook
- Example 2: Session Welcome Message
- Example 3: Test Runner Hook
What does the hook-creator skill do?
This skill should be used when the user asks to "create a hook", "write hook config", "add hooks.json", "configure event hooks", "create PreToolUse hook", "add SessionStart hook", "implement hook validation", "set up event-driven automation", needs guidance on hooks.json structure, hook events (PreToolUse, PostToolUse, Stop, SessionStart, SessionEnd, UserPromptSubmit), or wants to automate workflows and implement event-driven behavior in Claude Code plugins.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill hook-creator-basher83-agent-auditor --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
