Writing Hookify Rules

Create Hookify rule files with YAML frontmatter and Markdown message bodies.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create Hookify rules that watch for risky commands, sensitive file edits, and workflow checkpoints, so you can add lightweight automation and safety reminders in Claude-driven projects.

Core Features & Use Cases

  • Rule Syntax Guidance: Learn the required frontmatter fields, event types, and message-body format for each rule.
  • Pattern Writing Help: Build regex or multi-condition rules for Bash commands, file edits, prompts, and stop events.
  • Practical Use Cases: Block dangerous commands like destructive shell operations, warn when .env files are edited, or require a pre-stop checklist before finishing work.

Quick Start

Ask for a Hookify rule that warns on a destructive shell command and saves it as a .claude/hookify...local.md file.

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 a Hookify rule to block dangerous bash commands?

To write a Hookify rule, create a YAML frontmatter block with name, enabled, event, and pattern fields, then add a Markdown message body. Store the file in .claude/hookify.{rule-name}.local.md to block risky bash commands or warn on patterns.

Can I use regex patterns in guardrail rules to warn on sensitive file edits?

Yes, you can use regex patterns in guardrail rules to warn on sensitive file edits. Configure the event type in the YAML frontmatter and define your regex pattern to match specific file paths like .env files before triggering the Markdown warning message.

What is the required format for Hookify rule files?

The required format for Hookify rule files is a YAML frontmatter section containing name, enabled, event, and either pattern or conditions fields, followed by a Markdown message body. Files must be saved locally within the .claude directory.

How do I enforce a pre-stop checklist using project-level guardrails?

To enforce a pre-stop checklist using project-level guardrails, configure a Hookify rule with the stop event type. Define the required conditions in the YAML frontmatter and write the checklist reminders in the Markdown message body to prompt users before finishing work.

Do I need dependencies to create multi-condition rules for Claude projects?

No dependencies are required to create multi-condition rules for Claude projects. You can define multiple conditions directly in the YAML frontmatter using the conditions field to detect unwanted commands and file changes without external libraries.