writing-hookify-rules

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

1|Updated Jul 6, 2015
One-click install
npx skills add https://github.com/ksolomon/dotfiles --skill writing-hookify-rules-ksolomon
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/ksolomon/dotfiles/tree/main/AI/.claude/plugins/marketplaces/claude-plugins-official/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/ksolomon/dotfiles --skill writing-hookify-rules-ksolomon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing hookify rules requires knowing the exact frontmatter schema, event types, condition operators, and regex escaping rules; mistakes produce rules that never trigger or match too broadly. ## Core Features & Use Cases - Rule File Authoring: Guides creation of .claude/hookify.{name}.local.md files with correct frontmatter fields (name, enabled, event, action, pattern, conditions). - Event-Specific Patterns: Provides regex patterns and field options for bash, file, stop, prompt, and all hook events. - Use Case: You want to block dangerous rm -rf commands or warn when console.log is added to TypeScript files; this Skill produces a working rule file with the right pattern and message. ## Quick Start Ask the AI to create a hookify rule that warns whenever a bash command contains sudo or 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 commands?▼

Create a `.claude/hookify.{name}.local.md` file 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 hook events does hookify support?▼

Hookify supports bash, file, stop, prompt, and all events. Bash matches commands, file matches Edit/Write/MultiEdit operations, stop triggers on completion, and prompt matches user input.

How do I write a hookify rule with multiple conditions?▼

Use the conditions array in frontmatter instead of a single pattern. Each condition specifies a field (like file_path or new_text), an operator (regex_match, contains, equals, not_contains, starts_with, ends_with), and a pattern; all conditions must match.

Why is my hookify regex pattern 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 re.search before deploying.

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

Set `enabled: false` in the rule's frontmatter. The rule file stays in place but will not trigger; set it back to true to reactivate.