08-hook-generate — Claude Code skill: what it does, how to install
08-hook-generate builds one hook: a handler fired at a lifecycle event of the host tool, with a config entry per tool and the script behind it.
MIT ★ 571 updated 2026-10-29
/plugin marketplace add ai-driven-dev/framework
/plugin install aidd-context@aidd-frameworkWhat 08-hook-generate does
The skill produces a single hook, meaning a handler tied to a lifecycle event of the host tool. Three actions run in order. capture-hook pins down the moment, the action, the matcher, the scope and which tools to cover. write-hook merges the entry into each tool's config and writes the script. validate then checks the file, the merge and whether the moment is right. Each action's own file in actions/ gets read first, and its ## Test has to pass before the next one starts.
Two references carry the rules. references/hook-authoring.md holds the R1–R7 contract, the list of lifecycle moments and how handler, matcher and exit codes fit together. references/tool-paths.md covers supported tools, the event name behind each moment, file formats, scopes and write targets. Scaffolds ship as assets/hook-template.json and assets/hook-script-template.sh.
Nothing lands in a standalone hook file: the entry is merged into the config of the tool you picked, which is why the last action inspects the merge rather than a draft. Rules and skills are out of scope here. This one only builds hooks.
What it helps with
- Scaffold a hook for a lifecycle event across Claude and Cursor
- Move an existing hook into another tool's config format
- Get the matcher and exit codes right on the first pass
- Check that the config entry and the backing script agree before committing
- Work out what a given lifecycle moment is called in each tool
Example prompts for the agent
- Create a hook that runs the linter after a file is edited
- Scaffold a hook for Claude and Cursor: the event is a finished tool call, the action is running the tests
- Refactor my existing hook into the Claude config
How to install 08-hook-generate
1Plugin marketplace
/plugin marketplace add ai-driven-dev/framework/plugin install aidd-context@aidd-frameworkThis installs the whole aidd-context plugin with all its skills
2Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 08-hook-generate -a claude-code3Manually: put the files in place
~/.claude/skills/08-hook-generate/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/08-hook-generate/
1Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 08-hook-generate -a codex2Manually: put the files in place
.agents/skills/08-hook-generate/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 08-hook-generate -a cursor2Manually: put the files in place
.cursor/skills/08-hook-generate/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ai-driven-dev/framework plugins/aidd-context/skills/08-hook-generate2Manually: put the files in place
.github/skills/08-hook-generate/SKILL.md1Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 08-hook-generate -a gemini-cli2Platform CLI
gemini skills install https://github.com/ai-driven-dev/framework --path plugins/aidd-context/skills/08-hook-generateManually: put the files in place
.devin/skills/08-hook-generate/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 08-hook-generate -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about 08-hook-generate
How do I install 08-hook-generate in Claude Code?
Go through the marketplace: /plugin marketplace add ai-driven-dev/framework, then /plugin install aidd-context@aidd-framework.
What does 08-hook-generate do?
It builds a hook end to end: settles the moment, matcher and scope, merges the entry into each chosen tool's config, writes the handler script and validates the result.
Which tools can it target?
Claude, Cursor, Claude, GitHub Copilot and OpenCode. references/tool-paths.md spells out the file format, scope and write target for each.
Source text
SKILL.md · MIT
--- name: 08-hook-generate description: Generate a hook, a handler that runs at a lifecycle event, across the host AI tools. Use when the user wants to create, scaffold, or refactor a hook, or automate an action at a lifecycle point. Not for other artifacts like skills or rules. argument-hint: event | action --- # Hook Generate Builds one hook: an entry merged into the chosen scope for each supported tool, plus the backing script. ## Actions | # | Action | Role | Input | | --- | -------------- | ------------------------------------------------- | ----------------- | | 01 | `capture-hook` | Clarify the moment, action, matcher, scope, tools | user request | | 02 | `write-hook` | Merge the entry per tool, write the script | the captured spec | | 03 | `validate` | Check the file, the merge, and the moment fit | files written | Run the actions in order, `01 → 03`, and run each action's `## Test` before the next. Before running an action, read its file in `actions/`, not only the table or assets. ## References - `references/hook-authoring.md`: the contract (R1-R7), the lifecycle moments, and the handler, matcher, and exit-code model. - `references/tool-paths.md`: per-tool support, moment-to-event names, file formats, scopes, and write targets. ## Assets - `assets/hook-template.json`: the entry scaffold. - `assets/hook-script-template.sh`: the backing-script scaffold.
© AI-Driven Dev · MIT · ai-driven-dev/framework