aiskillstore avatar

Writing Hookify Rules

This walks you through creating Hookify rules, which are markdown files that watch for patterns in Claude's tool use and fire warnings or blocks when they match. You'd use it when you want to prevent dangerous bash commands, catch console.log statements before they ship, or enforce checklists before Claude stops working. The guide covers the YAML frontmatter structure, regex pattern writing, and the difference between simple pattern matches and multi-condition rules. It's thorough on the mechanics but light on philosophy. If you're setting up guardrails in a codebase where Claude might do something you'll regret later, this gives you the syntax and examples to write those rules quickly.

skills.sh installs
168
GitHub stars
476
last updated
Aug 21, 2026

Install

$ npx -y skills add aiskillstore/marketplace --skill writing-hookify-rules --agent claude-code

Installs into .claude/skills of the current project.

Files

Writing Hookify 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.

Rule File Format

Basic Structure

---
name: rule-identifier
enabled: true
event: bash|file|stop|prompt|all
pattern: regex-pattern-here
---

Message to show Claude when this rule triggers.
Can include markdown formatting, warnings, suggestions, etc.

Frontmatter Fields

name (required): Unique identifier for the rule

  • Use kebab-case: warn-dangerous-rm, block-console-log
  • Be descriptive and action-oriented
  • Start with verb: warn, prevent, block, require, check

enabled (required): Boolean to activate/deactivate

  • true: Rule is active
  • false: Rule is disabled (won't trigger)
  • Can toggle without deleting rule

event (required): Which hook event to trigger on

  • bash: Bash tool commands
  • file: Edit, Write, MultiEdit tools
  • stop: When agent wants to stop
  • prompt: When user submits a prompt
  • all: All events

Sponsors

Details

Repository
github.com/aiskillstore/marketplace
Category
Documentation
First seen
Jun 3, 2026

More from aiskillstore/marketplace

All 37
1absolutelyskilled avatarinternal-docsabsolutelyskilled/absolutelyskilledinternal docs158skills.sh installs
2cinience avataralicloud-platform-docs-api-review-testcinience/alicloud-skillsSmoke test for alicloud-platform-docs-api-review. Validate minimal authentication, API reachability, and one read-only query path.158skills.sh installs
3cinience avataralicloud-platform-multicloud-docs-api-benchmark-testcinience/alicloud-skillsSmoke test for alicloud-platform-multicloud-docs-api-benchmark. Validate minimal authentication, API reachability, and one read-only query path.156skills.sh installs
4absolutelyskilled avatarproposal-writingabsolutelyskilled/absolutelyskilledproposal writing155skills.sh installs
5k-dense-ai avatarscientific-writingk-dense-ai/claude-scientific-skillsscientific writing155skills.sh installs
6webmaxru avatarwriting-assistance-apiswebmaxru/agent-skillswriting assistance apis152skills.sh installs