hook-factory_skill

This skill generates production-ready Claude Code hooks with interactive Q&A, templates, and automated installation to streamline workflow automation.
  • Python

388

GitHub Stars

8

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill alirezarezvani/claude-code-skill-factory --skill hook-factory

  • generator.py16.9 KB
  • hook_factory.py23.0 KB
  • install-hook.sh4.6 KB
  • installer.py17.5 KB
  • README.md13.5 KB
  • SKILL.md12.4 KB
  • templates.json23.2 KB
  • validator.py31.3 KB

Overview

This skill generates production-ready Claude Code hooks with interactive Q&A, automated installers, and strong validation. It provides three generation modes (interactive, natural language, template) and 10 production templates covering 7 event types. The outputs include validated hook.json and README.md plus optional automated installation for macOS/Linux.

How this skill works

The tool inspects your request (interactive prompts, plain English, or explicit template) then selects a template and substitutes variables. It runs a 4-layer validation (structure, safety, matcher, event-specific) plus secrets and command checks, writes the generated hook folder, and can auto-install using a Python or Bash installer with backups and rollback. All generated hooks include tool detection, silent-failure safeguards, and timeout settings tuned to the event.

When to use it

  • Auto-format code after editing
  • Auto-stage files with git on edits
  • Run tests when an agent or subagent finishes
  • Load project context at session start
  • Pre-validate tools or commands before execution
  • Create custom workflow automations for Unix environments

Best practices

  • Start with Interactive Mode for guided defaults and safety checks
  • Review generated README.md and hook.json before installing
  • Test new hooks in a safe project or branch first
  • Use template mode for precise control and advanced customization
  • Enable auto-install only after verifying the generated commands locally
  • Monitor ~/.claude/logs/ for runtime troubleshooting

Example use cases

  • Auto-format Python files after editing using post_tool_use_format with black
  • Automatically git-add changed files via post_tool_use_git_add
  • Run pytest or jest when an agent stops using subagent_stop_test_runner
  • Load TODO.md or project context on session start via session_start_load_context
  • Run semgrep or bandit security scans before push with security_scan_code

FAQ

macOS and Linux are fully supported. Windows is not supported due to bash and Unix-specific command validation.

How does automated installation handle failures?

Installers create timestamped backups, perform JSON validation, write atomically, and rollback on errors. The last 5 backups are kept by default.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
hook-factory skill by alirezarezvani/claude-code-skill-factory | VeilStrat