writing-hookify-rules

Create hookify rule files with YAML frontmatter and regex patterns for hook events.

16|1|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/SocialGouv/iterion --skill writing-hookify-rules-socialgouv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/SocialGouv/iterion/tree/main/vendor/github.com/SocialGouv/claw-code-go/internal/tools/bundled_skills/hookify/skills/writing-rules
Command: npx skills add https://github.com/SocialGouv/iterion --skill writing-hookify-rules-socialgouv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing hookify rules requires knowing the exact frontmatter schema, event types, condition operators, and regex escaping rules; this Skill provides the complete syntax reference and patterns so rules trigger correctly on the first try. ## Core Features & Use Cases - Rule File Authoring: Guides creation of .claude/hookify.{name}.local.md files with correct frontmatter fields (name, enabled, event, action, pattern, conditions). - Event-Specific Patterns: Covers bash, file, stop, prompt, and all event types with field options and ready-made regex patterns for dangerous commands, debug code, and sensitive files. - Advanced Conditions: Explains multi-condition rules using operators like regex_match, contains, equals, and starts_with for complex matching logic. - Use Case: When you want to block rm -rf commands or warn about console.log in TypeScript files, use this Skill to generate a properly formatted hookify rule with a tested regex pattern and a clear warning message. ## Quick Start Create a hookify rule that warns me whenever a bash command contains sudo or rm -rf.

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 a hookify rule to block dangerous commands?▼

Create a `.claude/hookify.{name}.local.md` file with frontmatter setting event to bash, action to block, and a regex pattern like `rm\s+-rf`. The markdown body after the frontmatter is the message shown when the rule triggers.

What event types does hookify support for rules?▼

Hookify supports bash, file, stop, prompt, and all event types. Bash matches commands, file matches Edit/Write/MultiEdit operations, stop fires on completion, prompt matches user input, and all triggers on every event.

How do I write a hookify rule with multiple conditions?▼

Use the conditions array in frontmatter instead of a single pattern. Each condition specifies a field (like file_path or new_text), an operator (regex_match, contains, equals, not_contains, starts_with, ends_with), and a pattern; all conditions must match.

Why is my hookify regex pattern not matching?▼

Common causes are unescaped special characters like dots and parentheses, overly broad patterns matching unintended text, or YAML quoting issues. Use unquoted patterns in YAML and test with python3 re.search before deploying.

How do I disable a hookify rule without deleting it?▼

Set `enabled: false` in the rule's frontmatter to deactivate it temporarily. The rule file stays in `.claude/` but will not trigger until you set enabled back to true.