Writing Hookify Rules

Create hookify rule files with YAML frontmatter and regex patterns for hook event matching.

1|1|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/voxxov222/Claude-code- --skill writing-hookify-rules-voxxov222
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/voxxov222/Claude-code-/tree/main/temp-repo/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/voxxov222/Claude-code- --skill writing-hookify-rules-voxxov222

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing hookify rules requires knowing the exact frontmatter schema, event types, condition operators, and regex conventions, and mistakes in any of these cause rules to silently fail or trigger incorrectly. ## Core Features & Use Cases - Rule File Authoring: Guides creation of .claude/hookify.{name}.local.md files with correct frontmatter fields including name, enabled, event, action, and pattern. - Event and Condition Guidance: Covers bash, file, stop, prompt, and all event types plus multi-condition rules using operators like regex_match, contains, and starts_with. - Use Case: A developer wants to block dangerous rm -rf commands and warn about console.log in TypeScript files; this Skill provides the exact rule syntax, regex patterns, and message formatting to implement both. ## Quick Start Ask the assistant to create a hookify rule that warns when a bash command matches a dangerous pattern like rm -rf.

Frequently Asked Questions about Writing Hookify Rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a hookify rule to block dangerous bash commands?

Create a file named .claude/hookify.{name}.local.md with frontmatter setting event to bash, action to block, and a regex pattern like rm\s+-rf. The markdown body after the frontmatter is the message shown when the rule triggers.

What frontmatter fields does a hookify rule require?

A hookify rule requires name, enabled, and event fields, plus either a simple pattern or a conditions list. The action field is optional and defaults to warn; set it to block to prevent the operation.

Can a hookify rule match multiple conditions at once?

Yes, use the conditions list in frontmatter with field, operator, and pattern entries. All conditions must match for the rule to trigger, and operators include regex_match, contains, equals, not_contains, starts_with, and ends_with.

Why is my hookify rule regex not matching?

Common causes are unescaped special characters like dots and parentheses, overly broad patterns, or YAML quoting issues. Use unquoted patterns in YAML and test with python3 -c "import re; print(re.search(r'pattern', 'text'))" before deploying.

How do I temporarily disable a hookify rule without deleting it?

Set enabled to false in the rule's frontmatter. The rule file stays in place but will not trigger; set it back to true or delete the .local.md file to change its state.