Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add claude-world/director-mode-lite --skill "hook-template"
Install specific skill from multi-skill repository
# Description
Generate hook script from template
# SKILL.md
name: hook-template
description: Generate hook script from template
user-invocable: true
Hook Template Generator
Generate a hook script and configuration based on requirements.
Usage: /hook-template [hook-type] [purpose]
Hook Types
| Type | When it Runs | Use Case |
|---|---|---|
PreToolUse |
Before tool | Block, validate |
PostToolUse |
After tool | Log, notify |
Stop |
When stopping | Continue loops |
Notification |
On alerts | External notify |
Process
- Gather Requirements
- Hook type
- Purpose
-
Matcher (for Pre/PostToolUse)
-
Generate Script at
.claude/hooks/[name].sh -
Update settings.json with hook config
-
Make Executable:
chmod +x -
Validate with
/hooks-check
Templates
PreToolUse (Blocker)
#!/bin/bash
INPUT=$(cat)
TOOL=$(echo "$INPUT" | jq -r '.tool_name')
# Your logic
echo '{"decision": "allow"}'
Stop (Auto-Loop)
#!/bin/bash
CHECKPOINT=".auto-loop/checkpoint.json"
if [[ ! -f "$CHECKPOINT" ]]; then
echo '{"decision": "allow"}'
exit 0
fi
# Continue logic
Example
/hook-template PreToolUse "block edits to package-lock.json"
Creates:
- .claude/hooks/protect-lockfile.sh
- Updates .claude/settings.json
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.