Agent skill · writing content · affaan-m

hookify-rules

Create and configure hookify rules — markdown files with YAML frontmatter that match bash, file, prompt, or stop events by regex or conditions and show warn/block messages to the agent. Use when creating a hookify rule, writing hook rule syntax, configuring hookify, or adding pattern guardrails such as blocking dangerous commands, .env edits, or debug code.

Why this skill is useful

Provides specific syntax and patterns for creating Hookify rules that the AI wouldn't reliably generate on its own.

What it needs

About 3k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.

What this skill does

Writing Hookify Rules Overview ECC evaluates project-local Hookify rules with its built-in Node runtime. No separate Hookify plugin or Python installation is required when ECC hooks are enabled. 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. Rule File Format Basic Structure Frontmatter Fields Field Required Values Description ------- ---------- -------- ------------- name Yes kebab-case string Unique identifier (verb-first: warn-, block-, require-) enabled Yes true/false Toggle without deleting event Yes bash/file/stop/prompt/all Which hook event triggers this action No warn/block warn (default) shows message; block prevents operation pattern Yes regex string Pattern to match (or use conditions for complex rules) Advanced Format (Multiple Conditions) Condition fields by event: bash: command file: filepath, newtext, oldtext, content prompt: userprompt Operators: regexmatch, contains, equals, notcontains, startswith, endswith All conditions must match for rule to trigger. Event Type Guide bash Events Match Bash command patterns: Dangerous commands: rm\s+-rf, dd\s+if=, mkfs Privilege escalation: sudo\s+, su\s+ Permission issues: chmod\s+777 file Events Match Edit/Write/MultiEdit operations: Debug code: console\.log\(, debugger Security risks: eval\(, innerHTML\s= Sensitive files: \.env$, credentials, \.pem$ stop Events Completion checks and reminders. Pattern . matches always. prompt Events Match user prompt content for workflow enforcement. Pattern Writing Tips Regex Basics Escape special chars: . …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills affaan-m/hookify-rules--bfcd41

View the source on GitHub

Browse the @skills marketplace