writing-hookify-rules

Create Hookify rules with YAML frontmatter and regex patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps users define custom rules for the Hookify system, enabling fine-grained control over AI behavior during interactions, command execution, and file operations.

Core Features & Use Cases

  • Rule Creation: Guides users in writing SKILL.md files with YAML frontmatter to define triggers, patterns, and actions.
  • Pattern Matching: Explains how to use regex for matching commands, file paths, and user prompts.
  • Use Case: You need to ensure that no sensitive API keys are ever accidentally committed to a .env file. This Skill helps you write a Hookify rule that blocks any file operation attempting to write such keys into a .env file.

Quick Start

Use the writing-hookify-rules skill to create a new hookify rule that blocks the use of rm -rf in bash commands.

Frequently Asked Questions about writing-hookify-rules

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

FAQPage Schema
How do I define custom AI behavior rules for bash commands and file operations?

To define custom AI behavior rules, you write a SKILL.md file with YAML frontmatter specifying triggers, event types (bash, file, stop, prompt), condition operators, and regex patterns to control agent interactions.

How does regex pattern matching work for AI agent command triggers?

Regex pattern matching evaluates user prompts, bash commands, and file paths against defined conditions using standard syntax. When a pattern matches an event type, the custom Hookify rule triggers the specified action to control AI behavior.

Can I block specific shell commands like rm -rf using hookify rules?

Yes, you can block shell commands like rm -rf by creating a hookify rule. You define a bash event type in the YAML frontmatter and use a regex pattern to match the restricted command string.

Do I need to know YAML and regex to create hookify rules?

Yes, creating hookify rules requires an understanding of YAML syntax for frontmatter configuration and regex syntax for pattern matching conditions across bash, file, stop, and prompt event types.

How do I prevent an AI agent from writing sensitive API keys into a .env file?

To prevent writing sensitive API keys into a .env file, define a custom hookify rule with a file event type. Use a regex pattern to match the target file path and key patterns to block the operation.

What are the available event types when writing rules for AI agent interactions?

The available event types for defining AI agent rules are bash, file, stop, and prompt. These events cover command execution, file operations, agent termination, and user interactions respectively.