Skip to content
Back to skills

2616 Generate Hooks 94608e93

ASecurity

Produce hook scripts from discovered anti-patterns — drafts by default, --install writes to settings

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
toolstesting

Works with

  • claude code

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2616-generate-hooks_94608e93 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2616 Generate Hooks 94608e93?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2616 Generate Hooks 94608e93
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2616-generate-hooks-94608e93/badge)](https://www.skillsdirectory.com/skills/tools-only-2616-generate-hooks-94608e93)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: generate-hooks
description: "Produce hook scripts from discovered anti-patterns — drafts by default, --install writes to settings"
argument-hint: "[--install] [--from <analysis-file>]"
allowed-tools: "Read,Write,Edit,Glob,Grep,Task"
---

Generate Claude Code hook configurations from kaizen analysis findings. Translates discovered anti-patterns into automated prevention hooks.

## Arguments

- `--install` — Write hooks directly to project settings instead of draft files. Without this flag, hooks are written as proposals to `.planning/kaizen/hooks/`.
- `--from <analysis-file>` — Source analysis file to generate hooks from. Default: most recent analysis file in `.planning/kaizen/`.

## Execution Steps

1. **Find source analysis.** If `--from` is provided, use that file. Otherwise, glob for the most recent `.planning/kaizen/analysis-*.md`.

2. **Extract hook-eligible findings.** Read the analysis file and identify findings where the recommended improvement type is "hook". Filter for:
   - Tool misuse patterns (PreToolUse deny/redirect)
   - Missing context injection (SubagentStart)
   - Quality gate violations (SubagentStop, Stop)
   - Repeated manual corrections (PreToolUse)

3. **Spawn @improvement-generator agent.** Delegate hook generation:

   ```text
   subagent_type: improvement-generator
   prompt: "Generate hook configurations from these findings: {findings}. Write proposals to .planning/kaizen/hooks/ or install to settings if --install flag is set."
   ```

   The agent uses the kaizen-improvement skill which contains hook patterns and templates.

4. **Output results.**

   **Draft mode (default):** Write each hook proposal as a separate file in `.planning/kaizen/hooks/`:

   ```text
   .planning/kaizen/hooks/
   ├── tool-misuse-prevention.md
   ├── edit-before-read-guard.md
   └── research-to-files-enforcement.md
   ```

   Each file contains the hook configuration, script (if command type), rationale, and testing instructions.

   **Install mode (--install):** Merge hook configurations into the project's `hooks/hooks.json` or `.claude/settings.json`. Report what was installed.

5. **Display summary.** Show the user how many hooks were generated, what anti-patterns they address, and where the output was written.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…