From hookify-plus
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", "hookify rule syntax", or needs guidance on hookify rule file format, frontmatter fields, and regex patterns.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hookify-plus:writing-rulesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Hookify rules are markdown files with YAML frontmatter that define patterns to watch for and messages to display when those patterns match. Store rules as `.md` files in `.claude/hookify-plus/`. Rules are read dynamically — changes take effect on the next tool use.
Hookify rules are markdown files with YAML frontmatter that define patterns to watch for and messages to display when those patterns match. Store rules as .md files in .claude/hookify-plus/. Rules are read dynamically — changes take effect on the next tool use.
---
name: rule-identifier
enabled: true
event: bash|file|stop|prompt|all
pattern: regex-pattern-here
---
Message to show Claude when this rule triggers.
Include markdown formatting, warnings, and suggestions.
name (required): Unique identifier for the rule.
warn-dangerous-rm, block-console-logenabled (required): Boolean to activate/deactivate.
true to activate, false to disable without deleting the rule.event (required): Hook event to trigger on.
bash — Bash tool commandsfile — Edit, Write, MultiEdit, Update toolsread — Read, Glob, Grep, LS tools (reads, not modifications)stop — When the agent wants to stopprompt — When the user submits a promptall — All eventsaction (optional): Behavior when the rule matches.
warn — Show message but allow operation (default)block — Prevent operation (PreToolUse) or stop session (Stop events)warn_once (optional): Boolean. Only warn once per session. Subsequent matches are silently ignored.
warn_interval (optional): Integer. Warn every N matches. Set to 0 to warn every time (default behavior).
tool_matcher (optional): String. Override which tools a rule matches, instead of using the default tool set for the event type.
pattern (simple format): Regex pattern to match (case-insensitive).
command (bash) or new_text (file).Example:
event: bash
pattern: rm\s+-rf
For rules with multiple conditions, replace pattern with a conditions array. All conditions must match for the rule to trigger.
conditions:
- field: file_path
operator: regex_match
pattern: \.env$
- field: new_text
operator: contains
pattern: API_KEY
See references/advanced-conditions.md for the full list of operators, fields, and examples.
The markdown content after frontmatter is shown to Claude when the rule triggers. Write effective messages by following these guidelines:
Example:
**Console.log detected!**
Adding console.log to production code.
**Why this matters:**
- Debug logs should not ship to production
- Console.log can expose sensitive data
**Alternatives:**
- Use a proper logging library
- Remove before committing
Locations:
.claude/hookify-plus/*.md (per-project)~/.claude/hookify-plus/*.md (all projects)<sibling_plugin>/hookify-plus/*.md (same marketplace)Naming convention: {descriptive-name}.md inside the hookify-plus/ directory.
Gitignore: Add .claude/hookify-plus/ to .gitignore if rules should not be committed.
Good names: dangerous-rm.md, console-log.md, require-tests.md
Bad names: rule1.md (not descriptive), my-rule.txt (wrong extension)
.claude/hookify-plus/{name}.md in project rootenabled: false in frontmatter.md file from .claude/hookify-plus/Minimum viable rule:
---
name: my-rule
enabled: true
event: bash
pattern: dangerous_command
---
Warning message here
Event types: bash, file, read, stop, prompt, all
Field options:
| Event | Fields |
|---|---|
bash | command |
file | file_path, new_text, old_text, content |
read | file_path |
prompt | user_prompt |
stop | reason, transcript |
Operators: regex_match, not_regex_match, contains, equals, not_contains, starts_with, ends_with
hookify-plus extras: not_regex_match operator, value key alias for pattern, global rules in ~/.claude/, read event type
See ${CLAUDE_PLUGIN_ROOT}/examples/ for complete examples:
dangerous-rm.md — Block dangerous rm commandsconsole-log-warning.md — Warn about console.logsensitive-files-warning.md — Warn about editing .env filesrequire-tests-stop.md — Require tests before stoppingreferences/pattern-reference.md — Regex basics, common patterns, testing tips, and pitfallsreferences/event-types.md — Detailed event type guide with examples for each eventreferences/advanced-conditions.md — Multiple conditions, operators, field reference, and examplesnpx claudepluginhub anthony-spruyt/claude-plugins --plugin hookify-plusCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.