build
**Quick access to the factory-guide orchestrator for building custom Skills, Prompts, Agents, or Hooks.**
**Interactive guide for creating custom hooks with Q&A workflow and automatic validation.**
How it fires
How this command gets triggered: by you, by Claude, or both.
/build-hookContext preview
What this command does when you run it.
**Interactive guide for creating custom hooks with Q&A workflow and automatic validation.**
**Interactive guide for creating custom hooks with Q&A workflow and automatic validation.**
> **Note**: This command is also available as `/build hook` for consistency with other factories (skills, agents, prompts). Both work identically - use whichever you prefer! > > - **Consistent pattern**: `/build hook` (recommended) > - **Alias**: `/build-hook` (this command)
---
/build-hook /build-hook notification /build-hook formatting /build-hook testing /build-hook git
---
**Two Ways to Build Hooks**:
**Without arguments** (`/build-hook`):
**With argument** (`/build-hook [type]`):
**Interactive Mode**:
cd generated-skills/hook-factory python3 hook_factory.py -i
**Template Mode**:
python3 hook_factory.py -t post_tool_use_format -l python
---
/build-hook
**Output**:
Welcome to the Claude Code Hooks Factory! ๐ง I'll help you build a custom hook through 5-7 straightforward questions. Hooks are workflow automation that run when events occur: - SessionStart: Load context when Claude starts - PostToolUse: Auto-format code after editing - SubagentStop: Run tests when agents complete - And 4 more event types... Let's get started! Question 1: What should this hook do? Examples: - Auto-format Python files - Run tests automatically - Send notifications - Auto-commit to git Your answer: ___
---
/build-hook notification
**Output**:
Great! Building a notification hook. I'll ask you a few questions to customize it: Question 1: When should notifications be sent? 1. When any agent completes (SubagentStop) 2. When specific agent completes (SubagentStop + filter) 3. After every file edit (PostToolUse) 4. At session start (SessionStart) Your choice (1-4): ___
โ Continues with hooks-guide Q&A โ Generates notification hook with macOS/Linux support
---
/build-hook formatting
**Output**:
Perfect! Building an auto-formatting hook. Question 1: Which language should be formatted? 1. Python (black) 2. JavaScript/TypeScript (prettier) 3. Rust (rustfmt) 4. Go (gofmt) 5. Multiple languages Your choice (1-5): ___
โ Generates PostToolUse hook with formatter โ Includes tool detection and silent failure
---
/build-hook testing
**Output**:
Excellent! Building a test runner hook. Question 1: Which test framework? 1. pytest (Python) 2. jest (JavaScript/TypeScript) 3. cargo test (Rust) 4. go test (Go) Your choice (1-4): ___
โ Generates SubagentStop hook for automatic testing โ Configures appropriate timeout (120s)
---
/build-hook git
**Output**:
Great! Building a git automation hook. Question 1: What git operation? 1. Auto-stage files (git add) 2. Auto-commit with message 3. Check before push (validation) 4. Load git status at session start Your choice (1-4): ___
โ Generates git workflow automation โ Includes repository detection
---
**The hooks-guide agent will**: 1. Ask you 5-7 straightforward questions 2. Generate complete hook.json configuration 3. Validate for safety and correctness 4. Create README.md with installation guide 5. Save to `generated-hooks/[hook-name]/` 6. Provide installation instructions 7. Give testing guidance
**You'll get**:
---
**SessionStart** - Run when Claude Code starts/resumes
**PostToolUse** - Run after Write/Edit/Bash tools
**SubagentStop** - Run when agent completes task
**PreToolUse** - Run before tool executes
**UserPromptSubmit** - Run before processing user prompt
**Stop** - Run when session ends
**PrePush** - Run before git push
---
**Every generated hook includes**:
A comprehensive toolkit for generating production-ready Claude Skills and Claude Code Agents at scale.
Repo: alirezarezvani/claude-code-skill-factory
**Quick access to the factory-guide orchestrator for building custom Skills, Prompts, Agents, or Hooks.**
**Easy wrapper for running Codex CLI commands from Claude Code with proper syntax.**
**See what you've built, what's validated, what's installed, and what's next.**
Stage, commit, and push the current branch following git governance rules.