Writing Hookify Rules

Create and manage custom AI behavior rules with YAML frontmatter in Markdown files.

Updated Sep 7, 2025
One-click install
npx skills add https://github.com/BartekFo/my-dev-setup --skill writing-hookify-rules-bartekfo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/BartekFo/my-dev-setup/tree/main/.claude/plugins/cache/claude-plugins-official/hookify/e30768372b41/skills/writing-rules
Command: npx skills add https://github.com/BartekFo/my-dev-setup --skill writing-hookify-rules-bartekfo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill allows you to define custom rules and guardrails for AI behavior, ensuring specific patterns are detected and handled appropriately during AI interactions.

Core Features & Use Cases

  • Custom Rule Creation: Define rules with specific events, patterns, and actions.
  • Event Handling: Trigger rules on bash, file, stop, or prompt events.
  • Use Case: Prevent sensitive information like API keys from being accidentally logged or committed by defining a file event rule that blocks any edits containing API_KEY in .env files.

Quick Start

Create a new hookify rule by defining its name, event, and pattern in a .local.md file within the .claude directory.

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 guardrails to prevent sensitive data in file operations?

Custom AI guardrails are defined using a declarative YAML frontmatter format within Markdown files, specifying event triggers like file operations and pattern matching to block sensitive data. You create rules in a .local.md file within the .claude directory to enforce these workflow behaviors.

What events can I trigger custom AI behavior rules on?

Custom AI behavior rules can be triggered on bash commands, file operations, agent stop events, and user prompts. This event handling capability allows you to apply conditional logic and pattern matching across various AI interaction stages.

How do I set up a rule to block API keys from being committed to .env files?

To block API keys from .env files, set up a custom rule by defining a file event that matches the pattern API_KEY and blocks any edits containing it. This proactive rule is loaded dynamically to prevent accidental sensitive information logging during AI interactions.

Can I use conditional logic and pattern matching for AI prompt enforcement?

Yes, AI prompt enforcement supports pattern matching and conditional logic for user prompt events. You can define declarative rules in YAML frontmatter to manage and constrain AI behavior dynamically based on the matched input patterns.

Do I need any special dependencies to create and manage declarative AI rules?

No special dependencies are required; declarative AI rules are created and managed using YAML frontmatter within standard Markdown files. This approach facilitates proactive AI safety and workflow enforcement through dynamic rule loading without external libraries.

What is the best way to manage proactive AI safety rules for bash commands?

The best way to manage proactive AI safety rules for bash commands is by defining declarative rules with bash event triggers and pattern matching in Markdown files. This allows dynamic loading and conditional logic to handle specific command patterns appropriately.