[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M738PHE3M66Z2S2MVQEDVJYT":3,"skill-same:01M738PHE3M66Z2S2MVQEDVJYT":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":40,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M738PHE3M66Z2S2MVQEDVJYT","hook-factory",null,"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.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Falirezarezvani--hook-factory\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: hook-factory\ndescription: 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.\nversion: 2.0.0\nauthor: Claude Code Skills Factory\ntags: [hooks, automation, code-generation, workflow, productivity, interactive, installer]\norigin: \"https:\u002F\u002Fraw.githubusercontent.com\u002Falirezarezvani\u002Fclaude-code-skill-factory\u002Fmain\u002Fgenerated-skills\u002Fhook-factory\u002FSKILL.md\"\n---\n\n# Hook Factory v2.0\n\n**Generate production-ready Claude Code hooks with interactive Q&A, automated installation, and enhanced validation.**\n\n## What This Skill Does\n\nHook Factory v2.0 is a comprehensive hook generation system with three modes:\n\n1. **Interactive Mode** (NEW!) - 7-question guided flow with smart defaults\n2. **Natural Language** - Describe what you want in plain English\n3. **Template Mode** - Direct generation from 10 production templates\n\n**Key Features:**\n- **Interactive Q&A** - 7 questions with validation and smart defaults\n- **Automated Installation** - Python and Bash installers with backup\u002Frollback\n- **Enhanced Validation** - Secrets detection, event-specific rules, command validation\n- **10 Templates** - Covering 7 event types (PostToolUse, SubagentStop, SessionStart, PreToolUse, UserPromptSubmit, Stop, PrePush)\n- **Comprehensive Safety** - Tool detection, silent failure, atomic operations\n- **macOS\u002FLinux Support** - Production-ready for Unix environments\n\n## When to Use This Skill\n\nUse hook-factory when you want to:\n\n- Auto-format code after editing\n- Automatically stage files with git\n- Run tests when agents complete\n- Load project context at session start\n- Create custom workflow automation\n- Learn how hooks work through examples\n\n## Capabilities\n\n### Three Generation Modes\n\n**1. Interactive Mode (Recommended)**\n```bash\npython3 hook_factory.py -i\n```\n- 7-question guided flow\n- Smart defaults based on event type\n- Input validation and safety warnings\n- Optional auto-install\n\n**2. Natural Language Mode**\n```bash\npython3 hook_factory.py -r \"auto-format Python files after editing\"\n```\n- Simple keyword matching\n- Quick generation for common patterns\n\n**3. Template Mode (Advanced)**\n```bash\npython3 hook_factory.py -t post_tool_use_format -l python\n```\n- Direct template selection\n- Full customization control\n\n### Supported Hook Templates (10 Total)\n\n**Formatting & Code Quality:**\n1. **post_tool_use_format** - Auto-format after editing (Python, JS, TS, Rust, Go)\n2. **post_tool_use_git_add** - Auto-stage files with git\n\n**Testing & Validation:**\n3. **subagent_stop_test_runner** - Run tests when agent completes\n4. **pre_tool_use_validation** - Validate before tool execution\n5. **pre_push_validation** - Check before git push\n\n**Session Management:**\n6. **session_start_load_context** - Load context at session start\n7. **stop_session_cleanup** - Cleanup at session end\n\n**User Interaction:**\n8. **user_prompt_submit_preprocessor** - Pre-process user prompts\n9. **notify_user_desktop** - Desktop notifications (macOS\u002FLinux)\n\n**Security:**\n10. **security_scan_code** - Security scanning with semgrep\u002Fbandit\n\n### Languages Supported\n\n- Python (black formatter, pytest)\n- JavaScript (prettier, jest)\n- TypeScript (prettier, jest)\n- Rust (rustfmt, cargo test)\n- Go (gofmt, go test)\n\n### Enhanced Validation (v2.0)\n\n**4-Layer Validation System:**\n\n1. **Structure Validation** - JSON syntax, required fields, types\n2. **Safety Validation** - No destructive ops, tool detection, silent failure\n3. **Matcher Validation** - Valid glob patterns, tool names, file paths\n4. **Event-Specific Validation** - Rules per event type (PreToolUse, SessionStart, etc.)\n\n**NEW in v2.0:**\n- ✅ **Secrets Detection** - AWS keys, JWT tokens, API keys, private keys (20+ patterns)\n- ✅ **Event-Specific Rules** - PreToolUse must have tool matcher, SessionStart read-only, etc.\n- ✅ **Command Validation** - Bash syntax, Unix commands, path validation, dangerous operations\n- ✅ **macOS\u002FLinux Validation** - Platform-specific command checks\n\n### Safety Features\n\nEvery generated hook includes:\n- ✅ Tool detection (checks if required tools are installed)\n- ✅ Silent failure mode (never interrupts your workflow)\n- ✅ Appropriate timeout settings (5s-120s based on event type)\n- ✅ No destructive operations\n- ✅ Comprehensive validation before generation\n- ✅ Clear documentation and troubleshooting guides\n- ✅ Automatic backup during installation\n\n## How to Invoke\n\n### Natural Language Requests\n\nSimply describe what you want the hook to do:\n\n```\n\"I want to auto-format Python files after editing\"\n\"Create a hook that runs tests when agents complete\"\n\"Auto-add files to git after editing\"\n\"Load my TODO.md at session start\"\n```\n\n### Explicit Template Selection\n\nIf you know which template you want:\n\n```\n\"Generate a hook using the post_tool_use_format template for JavaScript\"\n\"Create a test runner hook for Rust\"\n```\n\n### List Available Templates\n\n```\n\"Show me all available hook templates\"\n\"List hook templates\"\n```\n\n## Example Interactions\n\n### Example 1: Auto-Format Python\n\n**You:** \"I need a hook to auto-format my Python code after editing\"\n\n**Hook Factory:**\n- Detects template: `post_tool_use_format`\n- Detects language: Python\n- Generates hook with black formatter\n- Validates configuration\n- Saves to `generated-hooks\u002Fauto-format-code-after-editing-python\u002F`\n- Creates `hook.json` and `README.md`\n\n### Example 2: Git Auto-Add\n\n**You:** \"Automatically stage files with git when I edit them\"\n\n**Hook Factory:**\n- Detects template: `post_tool_use_git_add`\n- Generates git auto-add hook\n- Validates git commands\n- Saves to `generated-hooks\u002Fauto-add-files-to-git-after-editing\u002F`\n\n### Example 3: Test Runner\n\n**You:** \"Run my JavaScript tests after the agent finishes coding\"\n\n**Hook Factory:**\n- Detects template: `subagent_stop_test_runner`\n- Detects language: JavaScript\n- Configures jest\u002Fnpm test\n- Saves to `generated-hooks\u002Frun-tests-when-agent-completes-javascript\u002F`\n\n## Output Structure\n\nFor each hook, Hook Factory creates:\n\n```\ngenerated-hooks\u002F\n└── [hook-name]\u002F\n    ├── hook.json        # Complete hook configuration (validated)\n    └── README.md        # Installation guide, usage, troubleshooting\n```\n\n### hook.json\n\nValid JSON configuration ready to copy into your Claude Code settings:\n\n```json\n{\n  \"matcher\": {\n    \"tool_names\": [\"Write\", \"Edit\"]\n  },\n  \"hooks\": [\n    {\n      \"type\": \"command\",\n      \"command\": \"if ! command -v black &> \u002Fdev\u002Fnull; then\\n    exit 0\\nfi\\n\\nif [[ \\\"$CLAUDE_TOOL_FILE_PATH\\\" == *.py ]]; then\\n    black \\\"$CLAUDE_TOOL_FILE_PATH\\\" || exit 0\\nfi\",\n      \"timeout\": 60\n    }\n  ]\n}\n```\n\n### README.md\n\nComprehensive documentation including:\n- Overview and how it works\n- Prerequisites\n- Installation instructions (manual)\n- Configuration options\n- Safety notes\n- Troubleshooting guide\n- Advanced customization tips\n\n## Installation of Generated Hooks\n\n### Automated Installation (NEW in v2.0!)\n\n**Using Python Installer:**\n```bash\ncd generated-skills\u002Fhook-factory\n\n# Install to user level (~\u002F.claude\u002Fsettings.json)\npython3 installer.py install generated-hooks\u002F[hook-name] user\n\n# Install to project level (.claude\u002Fsettings.json)\npython3 installer.py install generated-hooks\u002F[hook-name] project\n\n# Uninstall\npython3 installer.py uninstall [hook-name] user\n\n# List installed hooks\npython3 installer.py list user\n```\n\n**Using Bash Script (macOS\u002FLinux):**\n```bash\ncd generated-skills\u002Fhook-factory\n\n# Install\n.\u002Finstall-hook.sh generated-hooks\u002F[hook-name] user\n\n# Features:\n# - Automatic backup with timestamp\n# - JSON validation before\u002Fafter\n# - Atomic write operations\n# - Rollback on failure\n# - Keeps last 5 backups\n```\n\n**Auto-Install from Interactive Mode:**\n- Answer 'y' to Q7 (Auto-Install)\n- Hook is automatically installed\n- No manual steps required\n\n### Manual Installation (Legacy)\n\n1. **Review Generated Files**\n   ```bash\n   cd generated-hooks\u002F[hook-name]\n   cat README.md\n   cat hook.json\n   ```\n\n2. **Manual Installation**\n   - Open `.claude\u002Fsettings.json` (project) or `~\u002F.claude\u002Fsettings.json` (user)\n   - Copy the hook configuration from `hook.json`\n   - Add to the appropriate event type array\n   - Save and restart Claude Code\n\n3. **Verify**\n   - Check Claude Code logs: `~\u002F.claude\u002Flogs\u002F`\n   - Test the hook by performing the trigger action\n\n## Validation\n\nEvery hook is validated for:\n\n- **JSON Syntax**: Valid, parseable JSON\n- **Structure**: Required fields present and correct types\n- **Safety**: No destructive operations (rm -rf, etc.)\n- **Tool Detection**: External tools have detection checks\n- **Silent Failure**: Commands won't interrupt workflow\n- **Timeouts**: Appropriate for event type\n- **Matchers**: Valid glob patterns and tool names\n\n## Best Practices\n\n1. **Start Simple**: Use natural language requests for common patterns\n2. **Review Before Installing**: Always read the generated README.md\n3. **Test in Isolation**: Try hooks in a test project first\n4. **Customize Gradually**: Start with defaults, customize later\n5. **Monitor Logs**: Check `~\u002F.claude\u002Flogs\u002F` if hooks aren't working\n\n## Limitations\n\n**Platform Support:**\n- ✅ macOS and Linux fully supported\n- ❌ Windows not supported (Unix commands, bash-specific syntax)\n\n**Customization:**\n- Interactive mode provides smart defaults but limited deep customization\n- Advanced users should use template mode + manual editing\n- No GUI - CLI only\n\n**Template System:**\n- 10 templates cover common patterns\n- Custom templates require manual addition to templates.json\n- No template composition yet (combining multiple patterns)\n\n## Technical Details\n\n### Files in This Skill\n\n**Core Files:**\n- `SKILL.md` - This manifest file\n- `hook_factory.py` - Main orchestrator with CLI interface (687 lines)\n- `generator.py` - Template substitution and hook generation\n- `validator.py` - Enhanced validation engine (700+ lines)\n- `templates.json` - 10 production hook templates\n- `README.md` - Skill usage guide and examples\n\n**NEW in v2.0:**\n- `installer.py` - Automated installation system (536 lines)\n- `install-hook.sh` - Bash installation script (148 lines)\n- `examples\u002F` - 10 reference examples (10 folders × 2 files)\n\n### Dependencies\n\n- Python 3.7+\n- Standard library only (no external dependencies)\n\n### Architecture (v2.0)\n\n**Interactive Mode Flow:**\n```\nUser: python3 hook_factory.py -i\n    ↓\n[7-Question Flow with Smart Defaults]\n    ↓\n[Template Selection]\n    ↓\n[Variable Substitution]\n    ↓\n[4-Layer Validation]\n    ↓\n[File Generation]\n    ↓\n[Optional: Auto-Install via installer.py]\n    ↓\nGenerated Hook in generated-hooks\u002F + Installed\n```\n\n**Natural Language Flow:**\n```\nUser Request\n    ↓\n[Keyword Matching]\n    ↓\n[Template Selection]\n    ↓\n[Variable Substitution]\n    ↓\n[4-Layer Validation]\n    ↓\n[File Generation]\n    ↓\nGenerated Hook in generated-hooks\u002F\n```\n\n**Installation Flow:**\n```\nHook Folder\n    ↓\n[installer.py or install-hook.sh]\n    ↓\n[Backup settings.json]\n    ↓\n[Load + Validate JSON]\n    ↓\n[Merge Hook]\n    ↓\n[Atomic Write (temp → rename)]\n    ↓\n[Validate Result]\n    ↓\n✅ Installed (or ❌ Rollback)\n```\n\n## Troubleshooting\n\n### \"Could not determine hook type from request\"\n- Use more specific keywords (format, test, git add, load)\n- Or use explicit template selection\n- Or list templates to see what's available\n\n### Generated hook not working\n- Check Claude Code logs\n- Verify required tools are installed\n- Test command manually in terminal\n- Review README.md troubleshooting section\n\n### Validation errors\n- Review error messages and fix suggestions\n- Common issues: missing tool detection, destructive commands\n- Modify template if needed\n\n## Examples Directory\n\nThe `examples\u002F` directory contains reference implementations:\n\n```\nexamples\u002F\n├── auto-format-python\u002F      # PostToolUse format example\n├── git-auto-add\u002F            # PostToolUse git example\n├── test-runner\u002F             # SubagentStop test example\n└── load-context\u002F            # SessionStart context example\n```\n\nEach example includes working `hook.json` and `README.md` files you can copy directly.\n\n## Contributing\n\nTo add new hook patterns:\n\n1. Add template to `templates.json`\n2. Update keyword matching in `generator.py`\n3. Add example to `examples\u002F`\n4. Update this SKILL.md\n\n## Version History\n\n- **1.0.0** (2025-10-30): Initial release\n  - 4 core hook patterns\n  - Natural language generation\n  - Comprehensive validation\n  - Simple keyword matching\n\n## Support\n\n- **Documentation**: See README.md in skill directory\n- **Examples**: See examples\u002F directory\n- **Validation Issues**: Check validator.py output\n- **Claude Code Hooks**: https:\u002F\u002Fdocs.claude.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Fhooks\n\n---\n\n**Generated by Claude Code Skills Factory**\n**Last Updated:** 2025-10-30\n","# Hook Factory v2.0\n\n**Generate production-ready Claude Code hooks with interactive Q&A, automated installation, and enhanced validation.**\n\n## What This Skill Does\n\nHook Factory v2.0 is a comprehensive hook generation system with three modes:\n\n1. **Interactive Mode** (NEW!) - 7-question guided flow with smart defaults\n2. **Natural Language** - Describe what you want in plain English\n3. **Template Mode** - Direct generation from 10 production templates\n\n**Key Features:**\n- **Interactive Q&A** - 7 questions with validation and smart defaults\n- **Automated Installation** - Python and Bash installers with backup\u002Frollback\n- **Enhanced Validation** - Secrets detection, event-specific rules, command validation\n- **10 Templates** - Covering 7 event types (PostToolUse, SubagentStop, SessionStart, PreToolUse, UserPromptSubmit, Stop, PrePush)\n- **Comprehensive Safety** - Tool detection, silent failure, atomic operations\n- **macOS\u002FLinux Support** - Production-ready for Unix environments\n\n## When to Use This Skill\n\nUse hook-factory when you want to:\n\n- Auto-format code after editing\n- Automatically stage files with git\n- Run tests when agents complete\n- Load project context at session start\n- Create custom workflow automation\n- Learn how hooks work through examples\n\n## Capabilities\n\n### Three Generation Modes\n\n**1. Interactive Mode (Recommended)**\n```bash\npython3 hook_factory.py -i\n```\n- 7-question guided flow\n- Smart defaults based on event type\n- Input validation and safety warnings\n- Optional auto-install\n\n**2. Natural Language Mode**\n```bash\npython3 hook_factory.py -r \"auto-format Python files after editing\"\n```\n- Simple keyword matching\n- Quick generation for common patterns\n\n**3. Template Mode (Advanced)**\n```bash\npython3 hook_factory.py -t post_tool_use_format -l python\n```\n- Direct template selection\n- Full customization control\n\n### Supported Hook Templates (10 Total)\n\n**Formatting & Code Quality:**\n1. **post_tool_use_format** - Auto-format after editing (Python, JS, TS, Rust, Go)\n2. **post_tool_use_git_add** - Auto-stage files with git\n\n**Testing & Validation:**\n3. **subagent_stop_test_runner** - Run tests when agent completes\n4. **pre_tool_use_validation** - Validate before tool execution\n5. **pre_push_validation** - Check before git push\n\n**Session Management:**\n6. **session_start_load_context** - Load context at session start\n7. **stop_session_cleanup** - Cleanup at session end\n\n**User Interaction:**\n8. **user_prompt_submit_preprocessor** - Pre-process user prompts\n9. **notify_user_desktop** - Desktop notifications (macOS\u002FLinux)\n\n**Security:**\n10. **security_scan_code** - Security scanning with semgrep\u002Fbandit\n\n### Languages Supported\n\n- Python (black formatter, pytest)\n- JavaScript (prettier, jest)\n- TypeScript (prettier, jest)\n- Rust (rustfmt, cargo test)\n- Go (gofmt, go test)\n\n### Enhanced Validation (v2.0)\n\n**4-Layer Validation System:**\n\n1. **Structure Validation** - JSON syntax, required fields, types\n2. **Safety Validation** - No destructive ops, tool detection, silent failure\n3. **Matcher Validation** - Valid glob patterns, tool names, file paths\n4. **Event-Specific Validation** - Rules per event type (PreToolUse, SessionStart, etc.)\n\n**NEW in v2.0:**\n- ✅ **Secrets Detection** - AWS keys, JWT tokens, API keys, private keys (20+ patterns)\n- ✅ **Event-Specific Rules** - PreToolUse must have tool matcher, SessionStart read-only, etc.\n- ✅ **Command Validation** - Bash syntax, Unix commands, path validation, dangerous operations\n- ✅ **macOS\u002FLinux Validation** - Platform-specific command checks\n\n### Safety Features\n\nEvery generated hook includes:\n- ✅ Tool detection (checks if required tools are installed)\n- ✅ Silent failure mode (never interrupts your workflow)\n- ✅ Appropriate timeout settings (5s-120s based on event type)\n- ✅ No destructive operations\n- ✅ Comprehensive validation before generation\n- ✅ Clear documentation and troubleshooting guides\n- ✅ Automatic backup during installation\n\n## How to Invoke\n\n### Natural Language Requests\n\nSimply describe what you want the hook to do:\n\n```\n\"I want to auto-format Python files after editing\"\n\"Create a hook that runs tests when agents complete\"\n\"Auto-add files to git after editing\"\n\"Load my TODO.md at session start\"\n```\n\n### Explicit Template Selection\n\nIf you know which template you want:\n\n```\n\"Generate a hook using the post_tool_use_format template for JavaScript\"\n\"Create a test runner hook for Rust\"\n```\n\n### List Available Templates\n\n```\n\"Show me all available hook templates\"\n\"List hook templates\"\n```\n\n## Example Interactions\n\n### Example 1: Auto-Format Python\n\n**You:** \"I need a hook to auto-format my Python code after editing\"\n\n**Hook Factory:**\n- Detects template: `post_tool_use_format`\n- Detects language: Python\n- Generates hook with black formatter\n- Validates configuration\n- Saves to `generated-hooks\u002Fauto-format-code-after-editing-python\u002F`\n- Creates `hook.json` and `README.md`\n\n### Example 2: Git Auto-Add\n\n**You:** \"Automatically stage files with git when I edit them\"\n\n**Hook Factory:**\n- Detects template: `post_tool_use_git_add`\n- Generates git auto-add hook\n- Validates git commands\n- Saves to `generated-hooks\u002Fauto-add-files-to-git-after-editing\u002F`\n\n### Example 3: Test Runner\n\n**You:** \"Run my JavaScript tests after the agent finishes coding\"\n\n**Hook Factory:**\n- Detects template: `subagent_stop_test_runner`\n- Detects language: JavaScript\n- Configures jest\u002Fnpm test\n- Saves to `generated-hooks\u002Frun-tests-when-agent-completes-javascript\u002F`\n\n## Output Structure\n\nFor each hook, Hook Factory creates:\n\n```\ngenerated-hooks\u002F\n└── [hook-name]\u002F\n    ├── hook.json        # Complete hook configuration (validated)\n    └── README.md        # Installation guide, usage, troubleshooting\n```\n\n### hook.json\n\nValid JSON configuration ready to copy into your Claude Code settings:\n\n```json\n{\n  \"matcher\": {\n    \"tool_names\": [\"Write\", \"Edit\"]\n  },\n  \"hooks\": [\n    {\n      \"type\": \"command\",\n      \"command\": \"if ! command -v black &> \u002Fdev\u002Fnull; then\\n    exit 0\\nfi\\n\\nif [[ \\\"$CLAUDE_TOOL_FILE_PATH\\\" == *.py ]]; then\\n    black \\\"$CLAUDE_TOOL_FILE_PATH\\\" || exit 0\\nfi\",\n      \"timeout\": 60\n    }\n  ]\n}\n```\n\n### README.md\n\nComprehensive documentation including:\n- Overview and how it works\n- Prerequisites\n- Installation instructions (manual)\n- Configuration options\n- Safety notes\n- Troubleshooting guide\n- Advanced customization tips\n\n## Installation of Generated Hooks\n\n### Automated Installation (NEW in v2.0!)\n\n**Using Python Installer:**\n```bash\ncd generated-skills\u002Fhook-factory\n\n# Install to user level (~\u002F.claude\u002Fsettings.json)\npython3 installer.py install generated-hooks\u002F[hook-name] user\n\n# Install to project level (.claude\u002Fsettings.json)\npython3 installer.py install generated-hooks\u002F[hook-name] project\n\n# Uninstall\npython3 installer.py uninstall [hook-name] user\n\n# List installed hooks\npython3 installer.py list user\n```\n\n**Using Bash Script (macOS\u002FLinux):**\n```bash\ncd generated-skills\u002Fhook-factory\n\n# Install\n.\u002Finstall-hook.sh generated-hooks\u002F[hook-name] user\n\n# Features:\n# - Automatic backup with timestamp\n# - JSON validation before\u002Fafter\n# - Atomic write operations\n# - Rollback on failure\n# - Keeps last 5 backups\n```\n\n**Auto-Install from Interactive Mode:**\n- Answer 'y' to Q7 (Auto-Install)\n- Hook is automatically installed\n- No manual steps required\n\n### Manual Installation (Legacy)\n\n1. **Review Generated Files**\n   ```bash\n   cd generated-hooks\u002F[hook-name]\n   cat README.md\n   cat hook.json\n   ```\n\n2. **Manual Installation**\n   - Open `.claude\u002Fsettings.json` (project) or `~\u002F.claude\u002Fsettings.json` (user)\n   - Copy the hook configuration from `hook.json`\n   - Add to the appropriate event type array\n   - Save and restart Claude Code\n\n3. **Verify**\n   - Check Claude Code logs: `~\u002F.claude\u002Flogs\u002F`\n   - Test the hook by performing the trigger action\n\n## Validation\n\nEvery hook is validated for:\n\n- **JSON Syntax**: Valid, parseable JSON\n- **Structure**: Required fields present and correct types\n- **Safety**: No destructive operations (rm -rf, etc.)\n- **Tool Detection**: External tools have detection checks\n- **Silent Failure**: Commands won't interrupt workflow\n- **Timeouts**: Appropriate for event type\n- **Matchers**: Valid glob patterns and tool names\n\n## Best Practices\n\n1. **Start Simple**: Use natural language requests for common patterns\n2. **Review Before Installing**: Always read the generated README.md\n3. **Test in Isolation**: Try hooks in a test project first\n4. **Customize Gradually**: Start with defaults, customize later\n5. **Monitor Logs**: Check `~\u002F.claude\u002Flogs\u002F` if hooks aren't working\n\n## Limitations\n\n**Platform Support:**\n- ✅ macOS and Linux fully supported\n- ❌ Windows not supported (Unix commands, bash-specific syntax)\n\n**Customization:**\n- Interactive mode provides smart defaults but limited deep customization\n- Advanced users should use template mode + manual editing\n- No GUI - CLI only\n\n**Template System:**\n- 10 templates cover common patterns\n- Custom templates require manual addition to templates.json\n- No template composition yet (combining multiple patterns)\n\n## Technical Details\n\n### Files in This Skill\n\n**Core Files:**\n- `SKILL.md` - This manifest file\n- `hook_factory.py` - Main orchestrator with CLI interface (687 lines)\n- `generator.py` - Template substitution and hook generation\n- `validator.py` - Enhanced validation engine (700+ lines)\n- `templates.json` - 10 production hook templates\n- `README.md` - Skill usage guide and examples\n\n**NEW in v2.0:**\n- `installer.py` - Automated installation system (536 lines)\n- `install-hook.sh` - Bash installation script (148 lines)\n- `examples\u002F` - 10 reference examples (10 folders × 2 files)\n\n### Dependencies\n\n- Python 3.7+\n- Standard library only (no external dependencies)\n\n### Architecture (v2.0)\n\n**Interactive Mode Flow:**\n```\nUser: python3 hook_factory.py -i\n    ↓\n[7-Question Flow with Smart Defaults]\n    ↓\n[Template Selection]\n    ↓\n[Variable Substitution]\n    ↓\n[4-Layer Validation]\n    ↓\n[File Generation]\n    ↓\n[Optional: Auto-Install via installer.py]\n    ↓\nGenerated Hook in generated-hooks\u002F + Installed\n```\n\n**Natural Language Flow:**\n```\nUser Request\n    ↓\n[Keyword Matching]\n    ↓\n[Template Selection]\n    ↓\n[Variable Substitution]\n    ↓\n[4-Layer Validation]\n    ↓\n[File Generation]\n    ↓\nGenerated Hook in generated-hooks\u002F\n```\n\n**Installation Flow:**\n```\nHook Folder\n    ↓\n[installer.py or install-hook.sh]\n    ↓\n[Backup settings.json]\n    ↓\n[Load + Validate JSON]\n    ↓\n[Merge Hook]\n    ↓\n[Atomic Write (temp → rename)]\n    ↓\n[Validate Result]\n    ↓\n✅ Installed (or ❌ Rollback)\n```\n\n## Troubleshooting\n\n### \"Could not determine hook type from request\"\n- Use more specific keywords (format, test, git add, load)\n- Or use explicit template selection\n- Or list templates to see what's available\n\n### Generated hook not working\n- Check Claude Code logs\n- Verify required tools are installed\n- Test command manually in terminal\n- Review README.md troubleshooting section\n\n### Validation errors\n- Review error messages and fix suggestions\n- Common issues: missing tool detection, destructive commands\n- Modify template if needed\n\n## Examples Directory\n\nThe `examples\u002F` directory contains reference implementations:\n\n```\nexamples\u002F\n├── auto-format-python\u002F      # PostToolUse format example\n├── git-auto-add\u002F            # PostToolUse git example\n├── test-runner\u002F             # SubagentStop test example\n└── load-context\u002F            # SessionStart context example\n```\n\nEach example includes working `hook.json` and `README.md` files you can copy directly.\n\n## Contributing\n\nTo add new hook patterns:\n\n1. Add template to `templates.json`\n2. Update keyword matching in `generator.py`\n3. Add example to `examples\u002F`\n4. Update this SKILL.md\n\n## Version History\n\n- **1.0.0** (2025-10-30): Initial release\n  - 4 core hook patterns\n  - Natural language generation\n  - Comprehensive validation\n  - Simple keyword matching\n\n## Support\n\n- **Documentation**: See README.md in skill directory\n- **Examples**: See examples\u002F directory\n- **Validation Issues**: Check validator.py output\n- **Claude Code Hooks**: https:\u002F\u002Fdocs.claude.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Fhooks\n\n---\n\n**Generated by Claude Code Skills Factory**\n**Last Updated:** 2025-10-30\n",{"name":5,"tags":24,"author":32,"origin":33,"version":34,"description":7},[25,26,27,28,29,30,31],"hooks","automation","code-generation","workflow","productivity","interactive","installer","Claude Code Skills Factory","https:\u002F\u002Fraw.githubusercontent.com\u002Falirezarezvani\u002Fclaude-code-skill-factory\u002Fmain\u002Fgenerated-skills\u002Fhook-factory\u002FSKILL.md","2.0.0","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa","core\u002Fskills\u002Falirezarezvani--hook-factory",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill hook-factory",{"tool":51,"command":52},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill hook-factory",{"tool":54,"command":55},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill hook-factory","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Falirezarezvani--hook-factory\u002FSKILL.md",true,[],[60,68,75,83,91,99],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":64,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":79,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":87,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]