writing-hookify-rules

Define hookify rule definitions with YAML frontmatter and pattern conditions.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/cjrfoto/claude-config --skill writing-hookify-rules-cjrfoto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/cjrfoto/claude-config/tree/main/plugins/marketplaces/claude-plugins-official/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/cjrfoto/claude-config --skill writing-hookify-rules-cjrfoto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hookify rule creation often lacks a clear, repeatable format for patterns and messages. This skill provides a straightforward guide to defining markdown-based hookify rules, ensuring consistent frontmatter and clear user-facing guidance.

Core Features & Use Cases

  • Structured rule definitions: YAML frontmatter defines name, enabled, event, and pattern to standardize rule creation.
  • Flexible messaging: Each rule includes a descriptive message body shown when the pattern matches.
  • Advanced formatting support: Supports both simple and multi-condition rules with optional fields like conditions, file_path, new_text, and old_text.
  • Use Case: Engineers add rules to prevent unsafe operations or guide users with best practices when patterns are detected.

Quick Start

Create a new hookify rule file under the .claude directory named hookify.{name}.local.md with a matching pattern and a clear guidance message.

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 validation rules that trigger messages when regex patterns match?

Define hookify rules using markdown files with YAML frontmatter specifying name, enabled, event, and pattern to trigger contextual messages when matched patterns are detected in bash or file events.

What is the required frontmatter schema for a hookify rule definition?

The required hookify frontmatter schema includes name, enabled, event, and pattern fields. Optional fields like conditions, file_path, new_text, and old_text are supported for advanced multi-condition rules.

How do I add best practice guidance messages to bash and file event automation?

Write a descriptive message body in the markdown rule file under the .claude directory. This message is shown to users when the defined event and pattern conditions are matched.

Can I use multi-condition rules with optional fields for file path and text changes?

Yes, hookify supports advanced formatting with multi-condition rules. You can include optional fields such as conditions, file_path, new_text, and old_text to enforce more specific pattern matching.

Where should I place hookify rule files to ensure they are detected?

Create new hookify rule files under the .claude directory. Name the file hookify.{name}.local.md to ensure the automation system recognizes and applies your validation patterns.

What are the limitations of using markdown for pattern validation rules?

Markdown-based hookify rules rely on a structured frontmatter schema for pattern matching and messaging. Complex validation logic may require advanced multi-condition formatting using optional fields like conditions and file paths.