brainstorming
Structured design dialogue that validates ideas before implementation begins.
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.
Full skill instructions
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
Structured design dialogue that validates ideas before implementation begins.
Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.
Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.
Introduction to the obra skills system with mandatory skill invocation rules and best practices.
Execute a written implementation plan with critical review and task checkpoints.
Delegate independent tasks to specialized agents working concurrently with isolated context.
Isolated git worktrees with smart directory selection and safety verification.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Plan searchable and shareable content that drives traffic, builds authority, and generates leads.
README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.
Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.
Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.
The world's fastest calendar for remote work
Capture, organize, and utilize your knowledge effortlessly.
Instant Summaries of Audio & Video Interviews with AnySummary
Transform PDFs into engaging mind maps.
Chat with any PDF instantly
Create an optimal daily plan using your voice
A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.
AskYourPDF Pricing Plans: Tailored to Your Needs