writing-hookify-rules

Write and manage Hookify rules with YAML frontmatter and Markdown message bodies.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hookify rule writing helps you define guardrails by specifying patterns to watch for and messages to display when those patterns match. This guide provides a clear format for creating or updating hookify rules stored in .claude/hookify.{rule-name}.local.md with YAML frontmatter and a markdown body.

Core Features & Use Cases

  • Rule authoring: Define rule identifiers, enablement, and events (bash, file, stop, prompt) with optional conditions.
  • Structured messages: Craft user-facing messages that explain detections and provide actionable advice.
  • Use Case: Create a rule to warn when a script edits a critical file in a deployment workflow.

Quick Start

Create a new Hookify rule by adding .claude/hookify.{name}.local.md with valid frontmatter and a clear 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 and markdown?

To write Hookify rules, create a file named .claude/hookify.{rule-name}.local.md containing YAML frontmatter with name, enabled, event, and pattern fields, followed by a markdown message body. This structure enables the system to watch for specified patterns and display actionable messages.

What events can I target when creating guardrails with Hookify rules?

Hookify rules support bash, file, stop, and prompt events. You can configure single or multi-condition rules within the YAML frontmatter to watch for specific regex patterns during these events and display structured markdown messages when matches occur.

Can I use multiple conditions in a single Hookify rule file?

Yes, Hookify rules support multi-condition configurations. You can define multiple conditions alongside the required frontmatter fields like name, enabled, event, and pattern in your .claude/hookify.{rule-name}.local.md file to watch for complex scenarios.

What is the best way to format user-facing messages in Hookify rules?

The best way to format Hookify messages is using a structured markdown body. Craft the markdown text after the YAML frontmatter to clearly explain pattern detections and provide actionable advice to the user when the rule triggers.

Do I need regex patterns to configure Hookify rules for file events?

Yes, regex patterns are required in the frontmatter to define what the Hookify rule watches for during file events. You specify these patterns in the pattern field to accurately match file modifications or other targeted behaviors.