writing-hookify-rules
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
Security Assessment
Detected risks:
About writing-hookify-rules
The writing-hookify-rules skill helps users create, configure, and understand Hookify rule files used to monitor actions and trigger guidance messages based on matching patterns. It provides structured guidance for building markdown-based rule definitions with YAML frontmatter, allowing users to define events, matching logic, and response behavior in a consistent format. The skill is designed to reduce configuration errors and simplify the process of writing rule-based safeguards and workflow checks for command execution, file edits, prompt handling, and session stop events.
The skill covers both simple and advanced Hookify rule formats. It explains required frontmatter fields such as name, enabled, event, and pattern, along with optional actions like warn and block. It also documents advanced condition-based matching using multiple fields and operators including regex matching, substring checks, equality validation, and prefix or suffix detection. Additional guidance is provided for crafting effective markdown message bodies that clearly explain detected issues, risks, and recommended alternatives. The documentation includes practical examples for bash command monitoring, file edit validation, environment variable protection, and code quality checks.
This skill is useful for developers, DevOps engineers, security-focused teams, and AI workflow maintainers who need customizable rule-based monitoring within Hookify environments. Common use cases include detecting dangerous shell commands, preventing insecure permission changes, warning about sensitive data exposure, enforcing coding standards, and guiding users during automated workflows. It is particularly valuable for teams that want lightweight policy enforcement and contextual guidance without building complex tooling from scratch.
FAQ
What file format do Hookify rules use?
Hookify rules are written as markdown files that contain YAML frontmatter followed by a markdown message body.
Can a Hookify rule monitor multiple conditions at once?
Yes. Advanced rules can use a conditions array where all defined conditions must match before the rule triggers.
Which events can Hookify rules listen for?
Rules can listen for bash, file, stop, prompt, or all events depending on the configured event field.
What happens if the action field is omitted?
If no action is specified, the rule defaults to warn behavior, which shows a message but allows the operation to continue.
Are regex patterns supported in Hookify rules?
Yes. Hookify rules support regex-based matching using Python regex syntax for patterns and condition operators such as regex_match.
Install writing-hookify-rules
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
anthropics/claude-plugins-official