Writing Hookify Rules

Create Hookify rule files with YAML frontmatter and regex patterns.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/stellarone/evaluate --skill writing-hookify-rules-stellarone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/stellarone/evaluate/tree/main/.agents/skills/writing-hookify-rules
Command: npx skills add https://github.com/stellarone/evaluate --skill writing-hookify-rules-stellarone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing Hookify rules can be error-prone because the rule file must follow a specific YAML frontmatter schema and a correct event/pattern structure for Claude to trigger reliably.

Core Features & Use Cases

  • Rule authoring guidance: Defines the required frontmatter fields (name, enabled, event, pattern) and the expected body message format.
  • Safety-oriented guardrails: Teaches how to write patterns that are specific enough to avoid overly broad matches, with guidance on escaping regex and preventing false positives.
  • Multi-condition rule support: Explains how to use advanced conditions with operators like regex_match, contains, equals, and not_contains so rules trigger only when all criteria match.
  • File placement and naming conventions: Documents where to store rules in .claude and how to name local rule files for consistent loading.

Quick Start

Ask the AI to create a Hookify rule that warns (or blocks) when a bash command contains rm -rf and to include clear, user-facing guidance in the message body.

Frequently Asked Questions about Writing Hookify Rules

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

FAQPage Schema
How do I write Hookify rules with YAML frontmatter for Claude event triggers?▼

Hookify rules require YAML frontmatter with fields for name, enabled, event, and pattern, plus a body message for Claude. Rules must be stored as .claude/hookify.{rule-name}.local.md files to load correctly.

What regex syntax do Hookify safety rules use for pattern matching?▼

Hookify rules use Python-style regex patterns for matching bash, file, stop, or prompt events. Patterns should be specific enough to avoid overly broad matches, with proper regex escaping to prevent false positives during event-driven safeguards.

Can I create multi-condition Hookify rules that trigger only when all criteria match?▼

Multi-condition Hookify rules support operators like regex_match, contains, equals, and not_contains. Rules trigger only when all specified criteria match, allowing precise control over event-driven safeguards beyond single-pattern matching.

How do I block dangerous bash commands like rm -rf using Hookify rules?▼

Create a Hookify rule with a bash event trigger and a regex pattern matching the target command. The rule's message body should contain clear, user-facing guidance to warn or block the action when the pattern matches during execution.

Why are my Hookify rules not triggering on Claude events?▼

Hookify rules fail to trigger when YAML frontmatter fields are incorrect, patterns are too broad or improperly escaped, or files are not stored in .claude/hookify.{rule-name}.local.md format. Verify the enabled toggle is set and all required fields are present.

What file naming convention does Hookify use for local rule files?▼

Hookify local rule files must follow the naming convention .claude/hookify.{rule-name}.local.md. This consistent file placement in the .claude directory ensures rules are properly loaded and associated with their configured event triggers.