# 08 Hook Generate

> Generate a hook (a handler that runs automatically at a lifecycle event) across the host AI tools a project uses. 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, rules, agents, commands.

- **Type:** Skill
- **Install:** `agentstack add skill-ai-driven-dev-framework-08-hook-generate`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ai-driven-dev](https://agentstack.voostack.com/s/ai-driven-dev)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ai-driven-dev](https://github.com/ai-driven-dev)
- **Source:** https://github.com/ai-driven-dev/framework/tree/main/plugins/aidd-context/skills/08-hook-generate
- **Website:** https://www.ai-driven-dev.fr/

## Install

```sh
agentstack add skill-ai-driven-dev-framework-08-hook-generate
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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.

## 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.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ai-driven-dev](https://github.com/ai-driven-dev)
- **Source:** [ai-driven-dev/framework](https://github.com/ai-driven-dev/framework)
- **License:** MIT
- **Homepage:** https://www.ai-driven-dev.fr/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ai-driven-dev-framework-08-hook-generate
- Seller: https://agentstack.voostack.com/s/ai-driven-dev
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
