Skip to main content
skill CX Codex

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add ai-driven-dev/framework
/plugin install aidd-context@aidd-framework
Open on GitHub

What 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-framework

This 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-code

3Manually: put the files in place

~/.claude/skills/08-hook-generate/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/08-hook-generate/

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

Similar skills

All skills for Agent setup: memory, context, orchestration →
vue-options-api-best-practices github.com/vuejs-ai The vue-options-api-best-practices skill for Claude Code teaches AI coders to write Vue 3 with Options API and TypeScript. It covers data(), methods, this context, lifecycle hooks and provide/inject. CX Codex +1 12,700installs eol-process deanpeters eol-process guides product sunset workflows across every phase, from initial decisions to post-mortem reviews. It helps retire software while keeping customer trust. CX Codex +1 1,000installs golang-uber-fx samber golang-uber-fx — a skill for uber-go/fx — a dependency injection framework with lifecycle hooks, module system, and graceful shutdown. Useful if your project already uses fx or you're migrating to it for long-running services. CX Codex +1 38,700installs vue-router-best-practices github.com/vuejs-ai vue-router-best-practices is a Claude Code skill that teaches Vue Router 4 navigation guards, route params, and component lifecycle synchronization. It helps prevent redirect loops and memory leaks. CX Codex +1 16,700installs rig-lifecycle mvschwarz Teaches the agent to reason about OpenRig lifecycle operations, verify post-reboot state in rig ps, and handle recovery without silent fresh fallbacks. CX Codex +1 ★ 8,928repo stars lifecycle-canary-convergence dodo-labs-ai lifecycle-canary-convergence is a Claude Code skill that checks Memory lifecycle state through an inventory, dry-run, apply, and audit. It runs before another retry or canary. CX Codex +1 ★ 104repo stars

From the same set80

The whole set →
0-hexagonal The 0-hexagonal rule splits each context into four layers and keeps dependencies pointed inward. Use it when reviewing TypeScript architecture. CX Codex +1 ★ 571repo stars 09-mermaid 09-mermaid turns a written description of an architecture or a flow into a Mermaid diagram, with a plan you approve before anything gets drawn. CX Codex +1 ★ 571repo stars 06-test 06-test finds untested behaviors, iterates tests until they pass, and validates user flows end to end in the browser. CX Codex +1 ★ 571repo stars 03-release-tag 03-release-tag is a Claude Code skill that prepares SemVer releases from recent commits, updates version files, and creates annotated tags after you review the release details. CX Codex +1 ★ 571repo stars 06-product-brief 06-product-brief drafts a concise product brief before gathering requirements. Helps outline an opportunity and establish how to validate it. CX Codex +1 ★ 571repo stars 01-commit The 01-commit skill stages changes one concern at a time, writes a conventional commit message, and commits locally. It can push the branch when asked. CX Codex +1 ★ 571repo stars 02-implement 02-implement implements an existing plan in code, phase by phase, until every acceptance criterion passes. Useful when the plan is ready and the code is not. CX Codex +1 ★ 571repo stars 04-issue-create 04-issue-create is a skill for Claude Code that prepares and opens issues in a configured project tracker. It asks for explicit approval before submitting a ticket. CX Codex +1 ★ 571repo stars

Project sponsors

Companies that keep this analytics open