From hookify-plus
This skill should be used when the user asks to "create a hookify rule", "hookify this behavior", "prevent this from happening again", "analyze conversation for unwanted behaviors", or invokes /hookify with or without arguments.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hookify-plus:hookifyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**FIRST:** Load the `hookify-plus:writing-rules` skill using the Skill tool to understand rule file format and syntax.
FIRST: Load the hookify-plus:writing-rules skill using the Skill tool to understand rule file format and syntax.
Create hook rules to prevent problematic behaviors by analyzing the conversation or acting on explicit user instructions.
If $ARGUMENTS is provided:
$ARGUMENTS.If $ARGUMENTS is empty:
Conversation-analyzer agent prompt:
{
"subagent_type": "general-purpose",
"description": "Analyze conversation for unwanted behaviors",
"prompt": "You are analyzing a Claude Code conversation to find behaviors the user wants to prevent.
Read user messages in the current conversation and identify:
1. Explicit requests to avoid something (\"don't do X\", \"stop doing Y\")
2. Corrections or reversions (user fixing Claude's actions)
3. Frustrated reactions (\"why did you do X?\", \"I didn't ask for that\")
4. Repeated issues (same problem multiple times)
For each issue found, extract:
- What tool was used (Bash, Edit, Write, etc.)
- Specific pattern or command
- Why it was problematic
- User's stated reason
Return findings as a structured list with:
- category: Type of issue
- tool: Which tool was involved
- pattern: Regex or literal pattern to match
- context: What happened
- severity: high/medium/low
Focus on the most recent issues (last 20-30 messages). Don't go back further unless explicitly asked."
}
After gathering behaviors (from arguments or the agent), present findings using AskUserQuestion.
Question 1 — Which behaviors to hookify:
Question 2 — Action for each selected behavior:
Question 3 — Pattern refinement:
For each confirmed behavior, create a .claude/hookify-plus/{rule-name}.md file.
Rule naming convention:
block-dangerous-rm, warn-console-log, require-tests-before-stop.Basic rule format:
---
name: {rule-name}
enabled: true
event: {bash|file|stop|prompt|all}
pattern: {regex pattern}
action: {warn|block}
---
{Message to show Claude when rule triggers}
Advanced format (multiple conditions):
---
name: {rule-name}
enabled: true
event: file
conditions:
- field: file_path
operator: regex_match
pattern: \.env$
- field: new_text
operator: contains
pattern: API_KEY
---
{Warning message}
IMPORTANT: Rule files must be created in the current working directory's .claude/hookify-plus/ folder, NOT the plugin directory.
Check if .claude/hookify-plus/ directory exists in the current working directory.
mkdir -p .claude/hookify-plusUse the Write tool to create each .claude/hookify-plus/{name}.md file.
.claude/hookify-plus/ path, not the plugin's.Show the user what was created:
Created 3 hookify rules:
- .claude/hookify-plus/dangerous-rm.md
- .claude/hookify-plus/console-log.md
- .claude/hookify-plus/sensitive-files.md
These rules will trigger on:
- dangerous-rm: Bash commands matching "rm -rf"
- console-log: Edits adding console.log statements
- sensitive-files: Edits to .env or credentials files
Verify files were created in the correct location by listing them.
Inform the user: "Rules are active immediately — no restart needed!"
The hookify hooks are already loaded and read new rules on the next tool use.
references/event-types.md — Detailed event type guide with examples and field reference for each eventreferences/pattern-tips.md — Regex basics, common patterns by category, testing tips, and pitfallsreferences/troubleshooting.md — Debugging rule creation failures, non-triggering rules, and example end-to-end workflowCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub anthony-spruyt/claude-plugins --plugin hookify-plus