writing-rules

Solid

Create markdown-based behavioral rules to prevent unwanted actions and block dangerous commands

AI & Automation 308 stars 27 forks Updated today MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
83
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

## Table of Contents - [Overview](#overview) - [Quick Start](#quick-start) - [Rule File Format](#rule-file-format) - [Frontmatter Fields](#frontmatter-fields) - [Event Types](#event-types) - [Advanced Conditions](#advanced-conditions) - [Operators](#operators) - [Field Reference](#field-reference) - [Pattern Writing](#pattern-writing) - [Regex Basics](#regex-basics) - [Examples](#examples) - [Test Patterns](#test-patterns) - [Example Rules](#example-rules) - [Block Destructive Commands](#block-destructive-commands) - [Warn About Debug Code](#warn-about-debug-code) - [Require Tests](#require-tests) - [Protect Production Files](#protect-production-files) - [Management](#management) - [Related Skills](#related-skills) - [Best Practices](#best-practices) # Hookify Rule Writing Guide ## When To Use - Creating behavioral rules to prevent unwanted actions - Defining persistent guardrails for Claude Code sessions ## When NOT To Use - Complex multi-step workflows - use agents instead - One-time operations that do not need persistent behavioral rules ## Overview Hookify rules are markdown files with YAML frontmatter that define patterns to watch for and messages to show when those patterns match. Rules are stored in `.claude/hookify.{rule-name}.local.md` files. ## Quick Start Create `.claude/hookify.dangerous-rm.local.md`: ```yaml --- name: dangerous-rm enabled: true event: bash pattern: rm\s+-rf action: block --- 🛑 **Dangerous rm command detected!** This command could ...

Details

Author
athola
Repository
athola/claude-night-market
Created
6 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category