ワンクリックで
hook-factory
// Generate production-ready Claude Code hooks with interactive Q&A, automated installation, and enhanced validation. Supports 10 templates across 7 event types for comprehensive workflow automation.
// Generate production-ready Claude Code hooks with interactive Q&A, automated installation, and enhanced validation. Supports 10 templates across 7 event types for comprehensive workflow automation.
Analyzes, generates, and enhances CLAUDE.md files for any project type using best practices, modular architecture support, and tech stack customization. Use when setting up new projects, improving existing CLAUDE.md files, or establishing AI-assisted development standards.
Complete App Store Optimization (ASO) toolkit for researching, optimizing, and tracking mobile app performance on Apple App Store and Google Play Store
Comprehensive Scrum Master assistant for sprint planning, backlog grooming, retrospectives, capacity planning, and daily standups with intelligent context-aware reporting
Comprehensive Test Driven Development guide for engineering subagents with multi-framework support, coverage analysis, and intelligent test generation
Comprehensive technology stack evaluation and comparison tool with TCO analysis, security assessment, and intelligent recommendations for engineering teams
Analyzes social media campaign performance across platforms with engagement metrics, ROI calculations, and audience insights for data-driven marketing decisions
| name | hook-factory |
| description | Generate production-ready Claude Code hooks with interactive Q&A, automated installation, and enhanced validation. Supports 10 templates across 7 event types for comprehensive workflow automation. |
| version | 2.0.0 |
| author | Claude Code Skills Factory |
| tags | ["hooks","automation","code-generation","workflow","productivity","interactive","installer"] |
Generate production-ready Claude Code hooks with interactive Q&A, automated installation, and enhanced validation.
Hook Factory v2.0 is a comprehensive hook generation system with three modes:
Key Features:
Use hook-factory when you want to:
1. Interactive Mode (Recommended)
python3 hook_factory.py -i
2. Natural Language Mode
python3 hook_factory.py -r "auto-format Python files after editing"
3. Template Mode (Advanced)
python3 hook_factory.py -t post_tool_use_format -l python
Formatting & Code Quality:
Testing & Validation: 3. subagent_stop_test_runner - Run tests when agent completes 4. pre_tool_use_validation - Validate before tool execution 5. pre_push_validation - Check before git push
Session Management: 6. session_start_load_context - Load context at session start 7. stop_session_cleanup - Cleanup at session end
User Interaction: 8. user_prompt_submit_preprocessor - Pre-process user prompts 9. notify_user_desktop - Desktop notifications (macOS/Linux)
Security: 10. security_scan_code - Security scanning with semgrep/bandit
4-Layer Validation System:
NEW in v2.0:
Every generated hook includes:
Simply describe what you want the hook to do:
"I want to auto-format Python files after editing"
"Create a hook that runs tests when agents complete"
"Auto-add files to git after editing"
"Load my TODO.md at session start"
If you know which template you want:
"Generate a hook using the post_tool_use_format template for JavaScript"
"Create a test runner hook for Rust"
"Show me all available hook templates"
"List hook templates"
You: "I need a hook to auto-format my Python code after editing"
Hook Factory:
post_tool_use_formatgenerated-hooks/auto-format-code-after-editing-python/hook.json and README.mdYou: "Automatically stage files with git when I edit them"
Hook Factory:
post_tool_use_git_addgenerated-hooks/auto-add-files-to-git-after-editing/You: "Run my JavaScript tests after the agent finishes coding"
Hook Factory:
subagent_stop_test_runnergenerated-hooks/run-tests-when-agent-completes-javascript/For each hook, Hook Factory creates:
generated-hooks/
└── [hook-name]/
├── hook.json # Complete hook configuration (validated)
└── README.md # Installation guide, usage, troubleshooting
Valid JSON configuration ready to copy into your Claude Code settings:
{
"matcher": {
"tool_names": ["Write", "Edit"]
},
"hooks": [
{
"type": "command",
"command": "if ! command -v black &> /dev/null; then\n exit 0\nfi\n\nif [[ \"$CLAUDE_TOOL_FILE_PATH\" == *.py ]]; then\n black \"$CLAUDE_TOOL_FILE_PATH\" || exit 0\nfi",
"timeout": 60
}
]
}
Comprehensive documentation including:
Using Python Installer:
cd generated-skills/hook-factory
# Install to user level (~/.claude/settings.json)
python3 installer.py install generated-hooks/[hook-name] user
# Install to project level (.claude/settings.json)
python3 installer.py install generated-hooks/[hook-name] project
# Uninstall
python3 installer.py uninstall [hook-name] user
# List installed hooks
python3 installer.py list user
Using Bash Script (macOS/Linux):
cd generated-skills/hook-factory
# Install
./install-hook.sh generated-hooks/[hook-name] user
# Features:
# - Automatic backup with timestamp
# - JSON validation before/after
# - Atomic write operations
# - Rollback on failure
# - Keeps last 5 backups
Auto-Install from Interactive Mode:
Review Generated Files
cd generated-hooks/[hook-name]
cat README.md
cat hook.json
Manual Installation
.claude/settings.json (project) or ~/.claude/settings.json (user)hook.jsonVerify
~/.claude/logs/Every hook is validated for:
~/.claude/logs/ if hooks aren't workingPlatform Support:
Customization:
Template System:
Core Files:
SKILL.md - This manifest filehook_factory.py - Main orchestrator with CLI interface (687 lines)generator.py - Template substitution and hook generationvalidator.py - Enhanced validation engine (700+ lines)templates.json - 10 production hook templatesREADME.md - Skill usage guide and examplesNEW in v2.0:
installer.py - Automated installation system (536 lines)install-hook.sh - Bash installation script (148 lines)examples/ - 10 reference examples (10 folders × 2 files)Interactive Mode Flow:
User: python3 hook_factory.py -i
↓
[7-Question Flow with Smart Defaults]
↓
[Template Selection]
↓
[Variable Substitution]
↓
[4-Layer Validation]
↓
[File Generation]
↓
[Optional: Auto-Install via installer.py]
↓
Generated Hook in generated-hooks/ + Installed
Natural Language Flow:
User Request
↓
[Keyword Matching]
↓
[Template Selection]
↓
[Variable Substitution]
↓
[4-Layer Validation]
↓
[File Generation]
↓
Generated Hook in generated-hooks/
Installation Flow:
Hook Folder
↓
[installer.py or install-hook.sh]
↓
[Backup settings.json]
↓
[Load + Validate JSON]
↓
[Merge Hook]
↓
[Atomic Write (temp → rename)]
↓
[Validate Result]
↓
✅ Installed (or ❌ Rollback)
The examples/ directory contains reference implementations:
examples/
├── auto-format-python/ # PostToolUse format example
├── git-auto-add/ # PostToolUse git example
├── test-runner/ # SubagentStop test example
└── load-context/ # SessionStart context example
Each example includes working hook.json and README.md files you can copy directly.
To add new hook patterns:
templates.jsongenerator.pyexamples/Generated by Claude Code Skills Factory Last Updated: 2025-10-30