Writing Hookify Rules

Create custom AI behavior rules using markdown with YAML frontmatter.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/opensesh/BOS-2.0 --skill writing-hookify-rules-opensesh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/opensesh/BOS-2.0/tree/main/.claude/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/opensesh/BOS-2.0 --skill writing-hookify-rules-opensesh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill allows users to define custom rules that govern the AI's behavior, ensuring specific actions are taken or prevented based on predefined patterns and events within the coding environment.

Core Features & Use Cases

  • Customizable Guardrails: Create rules to warn about or block potentially dangerous commands (e.g., rm -rf), sensitive file edits (e.g., .env files), or insecure code patterns (e.g., console.log).
  • Event-Driven Logic: Rules can trigger on various events like bash commands, file operations, agent stop signals, or user prompts.
  • Use Case: A developer wants to ensure no console.log statements are accidentally committed to production code. They can create a hookify rule that triggers a warning whenever console.log is detected in a file edit operation.

Quick Start

Use the writing hookify rules skill to create a new rule that warns about editing .env 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 AI behavior rules for code safety?

You can define custom AI behavior rules for code safety by writing declarative markdown files with YAML frontmatter that specify pattern matching and conditional logic to warn about or block potentially dangerous commands and insecure code patterns.

Can I prevent an AI agent from editing sensitive files like .env?

Yes, you can prevent an AI agent from editing sensitive files like .env by creating event-driven rules that trigger warnings or blocks specifically on file operations matching those filenames.

How do I block dangerous bash commands triggered by an AI agent?

To block dangerous bash commands triggered by an AI agent, create a rule that triggers on bash command events and uses regex pattern matching to intercept and prevent execution of commands like rm -rf.

Do I need to know regex to create behavioral guardrails for AI prompts?

Yes, you need to understand regex to create behavioral guardrails for AI prompts, as effective implementation of the hookify rule file format requires regex knowledge for proper pattern matching and conditional logic.

What events can trigger custom AI guardrails during a coding session?

Custom AI guardrails can trigger on four specific events during a coding session: bash commands, file operations, agent stop signals, and user prompts, allowing comprehensive behavioral control.

What is the best way to stop console.log statements from being committed to production?

The best way to stop console.log statements from entering production is to create a custom rule that triggers a warning whenever console.log is detected during a file edit operation.