Writing Hookify Rules

Define custom behavioral rules for AI agents using markdown and YAML frontmatter.

Updated Apr 10, 2025
One-click install
npx skills add https://github.com/LeighAtkins/OpenPaint --skill writing-hookify-rules-leighatkins
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/LeighAtkins/OpenPaint/tree/main/.claude/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/LeighAtkins/OpenPaint --skill writing-hookify-rules-leighatkins

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps users define and manage custom rules for controlling AI behavior, ensuring specific patterns in code or prompts trigger predefined actions or warnings.

Core Features & Use Cases

  • Rule Creation: Define rules with names, events, and patterns using YAML frontmatter.
  • Conditional Logic: Implement complex rules with multiple conditions based on file paths, text content, or commands.
  • Use Case: Prevent accidental deletion of sensitive files by creating a rule that warns the user whenever a rm -rf command targets a .env file.

Quick Start

Create a new hookify rule to warn about console.log statements in TypeScript files.

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 behavioral rules for AI agents?

You define custom behavioral rules for AI agents by creating markdown files with YAML frontmatter that specify rule names, events, and patterns for bash commands, file edits, and user prompts.

How can I prevent AI from deleting sensitive files during development?

To prevent AI from deleting sensitive files, create custom rules using event-based pattern matching that trigger warnings whenever specific bash commands, such as rm -rf, target protected file paths like .env files.

Can I set conditional logic for AI code safety rules based on file paths?

Yes, you can implement complex conditional logic for AI code safety rules by defining multiple conditions based on file paths, text content, or bash commands within the YAML frontmatter of your rule files.

What is event-based pattern matching for AI-assisted development workflows?

Event-based pattern matching for AI-assisted development workflows is a mechanism that activates predefined behavioral rules when specific triggers occur during file edits, bash command execution, or user prompt processing.

How do I create a hookify rule to warn about console.log statements?

To create a hookify rule warning about console.log statements, write a markdown file with YAML frontmatter defining the event trigger and text pattern matching logic to detect console.log in your target files.

Do I need any dependencies to write behavioral control rules for AI?

No dependencies are required to write behavioral control rules for AI, as the rules are managed entirely through standard markdown files with YAML frontmatter for rule creation, activation, and event-based pattern matching.