Writing Hookify Rules

Define custom AI agent rules with Hookify frontmatter and event types.

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/mbarnes-code/multi-agent-vllm --skill writing-hookify-rules-mbarnes-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/mbarnes-code/multi-agent-vllm/tree/main/features/claude-plugins-official/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/mbarnes-code/multi-agent-vllm --skill writing-hookify-rules-mbarnes-code

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance on creating custom rules for the Hookify system, enabling users to define specific behaviors and constraints for AI agents.

Core Features & Use Cases

  • Rule Definition: Learn the structure and syntax for creating Hookify rules, including frontmatter fields and message body content.
  • Event Types: Understand how to trigger rules based on different events like bash commands, file edits, agent stops, or user prompts.
  • Advanced Conditions: Implement complex rules using multiple conditions based on file paths, text content, and more.
  • Use Case: You can create a rule that automatically warns you if you try to delete important files using rm -rf in a bash command, or if you accidentally commit sensitive API keys into a .env file.

Quick Start

Create a new Hookify rule file named .claude/hookify.warn-dangerous-rm.local.md with the provided YAML frontmatter and 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 create custom AI guardrails for bash commands and file edits?

To create custom AI guardrails, you define Hookify rules using YAML frontmatter and message body content in a markdown file. This system triggers specific agent behaviors or warnings based on events like bash commands, file edits, agent stops, or user prompts.

What events can I target when defining AI agent behavior rules?

You can target four event types when defining AI agent behavior rules: bash, file, stop, and prompt. These events allow you to intercept and evaluate agent actions, triggering warnings or blocks for specific conditions like dangerous command execution.

How do I block dangerous shell commands using AI rules?

You block dangerous shell commands by creating a Hookify rule that targets the bash event type. Using Python regex for pattern matching in your rule conditions, you can detect commands like `rm -rf` and output a warning message in the rule body to prevent execution.

Can I use regex pattern matching for advanced conditions in AI guardrails?

Yes, you can use Python regex for pattern matching to build advanced conditions in AI guardrails. This allows you to evaluate multiple conditions simultaneously, checking text content and file paths to warn about sensitive edits like committing API keys into a `.env` file.

What is the file structure for a Hookify rule?

A Hookify rule file is a markdown file, such as `.claude/hookify.warn-dangerous-rm.local.md`, containing YAML frontmatter to define event types and conditions, followed by a message body that provides the warning or constraint output for the AI agent.

Do I need any dependencies to start writing AI guardrails with Hookify?

No external dependencies are required to start writing AI guardrails with Hookify. You only need to create a local markdown rule file with the correct YAML frontmatter syntax and message body content to enforce your custom agent constraints.