Writing Hookify Rules

Define YAML-frontmatter hook rules for Claude events with conditions.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Animesh-Kr/claude-skills --skill writing-hookify-rules-animesh-kr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/Animesh-Kr/claude-skills/tree/main/claude-code-main/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/Animesh-Kr/claude-skills --skill writing-hookify-rules-animesh-kr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing Hookify Rules provides a structured, repeatable way to define rules that detect patterns in commands and text, surfacing warnings or actions to keep workflows safe.

Core Features & Use Cases

  • YAML-frontmatter based rule definitions with required fields like name, enabled, event, and pattern (and optional conditions).
  • Supports basic and advanced rules with single or multiple conditions to cover common security and quality checks.
  • Examples and guidance for creating, testing, and refining rules in various project contexts.

Quick Start

Create a new .claude/hookify.{descriptive-name}.local.md file containing a frontmatter block with name, enabled, event, and pattern, followed by 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 automated detection rules for bash commands and file edits?

Automated detection rules for bash commands and file edits are written using YAML frontmatter with required fields like name, enabled, event, and pattern, followed by a clear message body to warn or block actions.

What is the YAML frontmatter schema required for defining hookify rules?

The YAML frontmatter schema for hookify rules requires four fields: name, enabled, event, and pattern. You can also include optional conditions to support multi-condition detection across typical development workflows.

Can I enforce multiple conditions in a single hookify rule pattern?

Yes, you can enforce multiple conditions in a single hookify rule pattern. The schema supports both basic single-condition rules and advanced multi-condition rules to cover common security and quality checks.

How do I create a markdown file to monitor and block specific actions during interactions?

To monitor and block specific actions, create a .claude/hookify.{descriptive-name}.local.md file containing a YAML frontmatter block with the required fields, followed by a clear message body for user guidance.

What events can I target when setting up workflow guardrails and guidelines?

You can target bash command monitoring, file edits, prompts, and stop events when setting up workflow guardrails. This allows you to surface warnings or actions to keep development workflows safe.

Does hookify support advanced security checks beyond simple pattern matching?

Yes, hookify supports advanced security checks through multi-condition patterns. You can define rules with optional conditions to detect complex patterns in commands and text, providing structured and repeatable workflow guardrails.