From plugin-creator
Use this skill when authoring `hooks/hooks.json` for a Claude Code plugin. It explains the supported hook events, the matcher/command structure, and how to reference plugin-relative scripts via ${CLAUDE_PLUGIN_ROOT}.
How this skill is triggered — by the user, by Claude, or both
Slash command
/plugin-creator:writing-hooksThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Hooks let a plugin run deterministic shell commands in response to Claude Code
Hooks let a plugin run deterministic shell commands in response to Claude Code
lifecycle events. They live at <plugin-name>/hooks/hooks.json and are wired
into the manifest via "hooks": "./hooks/hooks.json".
{
"hooks": {
"<EventName>": [
{
"matcher": "<optional pattern>",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/do-something.sh"
}
]
}
]
}
}
hooks key.{ matcher?, hooks[] } entries.{ "type": "command", "command": "<shell>" }.PreToolUse — before a tool runs. matcher filters by tool name
(e.g. "Write|Edit").PostToolUse — after a tool runs.UserPromptSubmit — when the user submits a prompt.SessionStart / SessionEnd — session lifecycle.Stop — when Claude finishes responding.Notification — when Claude Code emits a notification.(Use only the events you actually need; omit the rest.)
${CLAUDE_PLUGIN_ROOT} for any script shipped inside the plugin so
paths resolve correctly wherever the plugin is installed.<plugin-name>/scripts/ and make them executable.{
"hooks": "./hooks/hooks.json"
}
hooks.json parses as JSON.matcher is included only where meaningful (mostly PreToolUse /
PostToolUse).${CLAUDE_PLUGIN_ROOT} and are executable.plugin.json hooks.npx claudepluginhub louleowk/awesome-plugins --plugin plugin-creatorProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.