Create hook(s) following standardized structure - supports parallel creation for 3+ hooks
Create event-driven hooks with standardized structure. Supports parallel creation for 3+ hooks to speed up batch operations.
/plugin marketplace add vanman2024/domain-plugin-builder/plugin install domain-plugin-builder@ai-dev-marketplace<hook-name> <event-type> "<action>" [--plugin=name] [--marketplace] | <hook-1> <event-1> ... [--plugin=name] [--marketplace]šØ EXECUTION NOTICE FOR CLAUDE
When you invoke this command via SlashCommand(/domain-plugin-builder:hooks-create ...), the system returns THESE INSTRUCTIONS below.
YOU are the executor. This is NOT an autonomous subprocess.
Immediately after SlashCommand returns, start executing Phase 0, then Phase 1, etc.
See @CLAUDE.md section "SlashCommand Execution - YOU Are The Executor" for detailed explanation.
CRITICAL: All generated files must follow security rules:
@~/.claude/plugins/marketplaces/dev-lifecycle-marketplace/docs/security/SECURITY-RULES.md
Key requirements:
your_service_key_here.env files with .gitignore.env.example with placeholders onlyArguments: $ARGUMENTS
Goal: Create properly structured hooks. For 3+ hooks, creates them in parallel for faster execution.
CRITICAL EXECUTION INSTRUCTIONS:
!{tool command} syntax shows you WHAT to execute - use the real tool to DO ITPhase 0: Create Todo List
Create todo list for all phases below.
Phase 1: Load Architectural Framework
Actions:
Phase 2: Parse Arguments and Determine Plugin & Mode
Parse $ARGUMENTS to extract:
If plugin not specified:
!{bash basename $(pwd)}
Determine base path - check if already in a plugin directory:
!{bash test -f .claude-plugin/plugin.json && echo "." || (echo "$ARGUMENTS" | grep -q "--marketplace" && echo "plugins/$(basename $(pwd))" || echo ".")}
Store as $BASE_PATH:
All subsequent file operations use $BASE_PATH instead of hardcoded "plugins/$PLUGIN_NAME"
Phase 3: Load Hooks Documentation
WebFetch: https://docs.claude.com/en/docs/claude-code/hooks-guide
This provides context on:
Phase 4: Parse Arguments & Determine Mode
Actions:
Use bash to parse $ARGUMENTS and count how many hooks are being requested:
!{bash echo "$ARGUMENTS" | grep -oE '<[^>]+>' | wc -l}
Store the count. Then extract each hook specification:
Execution modes:
Phase 5: Create Hooks
Mode 1: Single Hook (1 hook)
Task(description="Create hook", subagent_type="domain-plugin-builder:hooks-builder", prompt="You are the hooks-builder agent. Create a complete hook.
Hook name: <name-from-args> Event type: <event-from-args> Action: <action-from-args> Plugin: <plugin-name>
Create hook configuration and script:
Deliverable: Complete hook with script, config, and documentation")
Mode 2: Sequential (2 hooks)
For each hook sequentially: Task(description="Create hook N", subagent_type="domain-plugin-builder:hooks-builder", prompt="<same structure>")
Wait for completion, then create next hook.
Mode 3: Parallel (3+ hooks)
Create TODO list:
TodoWrite with list of all hooks to create.
Launch ALL hooks-builder agents IN PARALLEL (all at once):
Task(description="Create hook 1", subagent_type="domain-plugin-builder:hooks-builder", prompt="You are the hooks-builder agent. Create a complete hook.
Hook name: $HOOK_1 Event type: $EVENT_1 Action: $ACTION_1 Plugin: $PLUGIN_NAME
Create:
Deliverable: Complete hook")
Task(description="Create hook 2", subagent_type="domain-plugin-builder:hooks-builder", prompt="Create hook: $HOOK_2 - Event: $EVENT_2 [same prompt structure as hook 1 above]")
Task(description="Create hook 3", subagent_type="domain-plugin-builder:hooks-builder", prompt="Create hook: $HOOK_3 - Event: $EVENT_3 [same prompt structure as hook 1 above]")
[Continue for all N hooks requested]
Each Task() call happens in parallel. Parse $ARGUMENTS to determine how many Task() calls to make.
Wait for ALL agents to complete before proceeding.
Update TodoWrite as each completes.
Phase 5.5: Git Commit and Push Goal: Save work immediately
Actions:
Complete hook structure with scripts, config, and documentation.
š¤ Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com EOF )"}
Phase 5.6: Sync to Airtable Goal: Sync ALL created hooks to Airtable in bulk
Actions:
Use bulk sync script for efficiency:
Bash: python ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/scripts/bulk-sync-airtable.py --plugin={plugin-name} --marketplace={marketplace-name} --type=hooks
This syncs ALL hooks in parallel instead of one at a time.
Environment Requirement:
Phase 6: Self-Validation
Run validation checks to verify all work completed:
!{bash test -f $BASE_PATH/hooks/hooks.json && echo "ā hooks.json exists" || echo "ā hooks.json MISSING"} !{bash test -d $BASE_PATH/scripts && echo "ā scripts/ exists" || echo "ā scripts/ MISSING"}
Mark all todos complete if validation passes.
Phase 7: Summary Goal: Report results
Actions:
Hooks Created: <count> Plugin: <plugin-name> Mode: $BASE_PATH (marketplace mode if "plugins/", standalone if ".") Location: $BASE_PATH/hooks/
Hooks:
Validation: All passed ā Git Status: Committed and pushed ā Airtable Sync: Attempted ā
Next Steps: