writing-hookify-rules

Create AI behavior rules using YAML frontmatter in Markdown files.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/spandios/vibe-utils --skill writing-hookify-rules-spandios
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/spandios/vibe-utils/tree/main/skills/writing-rules
Command: npx skills add https://github.com/spandios/vibe-utils --skill writing-hookify-rules-spandios

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps users create and understand custom rules (hooks) for AI behavior, ensuring safer and more predictable interactions.

Core Features & Use Cases

  • Rule Creation Guidance: Provides clear instructions on how to define custom rules for AI actions.
  • Pattern Matching: Explains how to use regular expressions to trigger rules based on specific commands, file edits, or prompts.
  • Use Case: You want to prevent the AI from accidentally deleting important files. This Skill guides you to create a hookify rule that blocks or warns about rm -rf commands.

Quick Start

Use the writing-hookify-rules skill to create a new hookify rule that warns about sudo 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 create custom AI guardrails for bash commands?

You can create custom AI guardrails by defining deterministic rules using a declarative YAML frontmatter format within Markdown files. This approach ensures safer and more predictable interactions by blocking or warning about specific bash commands like `rm -rf`.

How do I use regular expressions to trigger AI behavior rules?

Regular expressions are used in the `pattern` field of a hookify rule to match specific event triggers. This pattern matching mechanism allows the rule to evaluate commands, file operations, or user prompts against your defined criteria.

What is the YAML format for writing custom AI hooks?

The YAML format for custom AI hooks requires specific fields such as `name`, `event`, `pattern`, and `conditions` within a Markdown file's frontmatter. This declarative structure defines the deterministic guardrails applied to AI interactions.

Do I need to know regex to define deterministic guardrails for AI?

Yes, understanding regular expressions and YAML syntax is required to define deterministic guardrails. You need regex to construct the `pattern` field for matching specific commands, file edits, or prompts that trigger the rules.

Can I prevent AI from accidentally deleting files using custom rules?

Yes, you can prevent accidental file deletion by creating a custom rule that blocks or warns about `rm -rf` commands. The rule uses pattern matching on bash command events to enforce the deterministic guardrail.

What event types are supported when defining AI behavior rules?

AI behavior rules support various event types including bash commands, file operations, and user prompts. You specify the target event in the `event` field of the YAML frontmatter to apply the guardrail accurately.