writing-hookify-rules

Create Hookify rules with YAML frontmatter for Bash, file, stop, and prompt events.

5|1|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/ValorVie/custom-skills --skill writing-hookify-rules-valorvie
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/ValorVie/custom-skills/tree/main/.agents/skills/writing-hookify-rules
Command: npx skills add https://github.com/ValorVie/custom-skills --skill writing-hookify-rules-valorvie

SYSTEM DOCUMENTATION & REQUIREMENTS

## What problem does it solve? Hookify rules provide a structured, frontmatter-driven way to define safety and guidance patterns for Claude, enabling predictable, rule-based responses and warnings during tool interactions.

## Core Features & Use Cases

  • YAML-frontmatter driven rule definitions stored at .claude/hookify.{rule-name}.local.md
  • Supports simple and complex conditions for bash, file, stop, and prompt events
  • Messages and guidance are rendered when a rule matches, allowing warnings or blocks
  • Useful for preventing credential leakage, enforcing style checks, and guiding safe prompts in AI workflows

### Quick Start Create a new .claude/hookify.{name}.local.md with proper frontmatter and a guideline message body, then test it by triggering a sample event.

Frequently Asked Questions about writing-hookify-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Claude Hookify rules for bash and file events?

To write Claude Hookify rules, create a markdown file at .claude/hookify.{name}.local.md using YAML frontmatter to define pattern-matching conditions for bash, file, stop, or prompt events, then add a guideline message body for warnings.

What are Hookify rules used for in AI safety workflows?

Hookify rules are used for AI safety by monitoring user interactions to surface warnings or blocks, preventing credential leakage, enforcing style checks, and guiding safe prompts during tool interactions in Claude workflows.

How do I set up a simple Hookify rule with frontmatter?

Set up a simple Hookify rule by creating a new .claude/hookify.{name}.local.md file with proper YAML frontmatter defining the event trigger and a guideline message body, then test it by triggering a sample event.

Can I use pattern matching to block dangerous actions in Claude?

Yes, you can use pattern matching to block dangerous actions by applying both simple and advanced Hookify rule formats that monitor bash, file, stop, and prompt events, rendering warning messages or blocks when conditions match.

What is the difference between simple and advanced Hookify rule formats?

Simple Hookify rules define basic event triggers in frontmatter, while advanced rules support complex conditions for bash, file, stop, and prompt events, enabling predictable, rule-based responses and focused messaging during tool interactions.

How do I test Hookify rules after creating them?

Test Hookify rules by triggering a sample event that matches the pattern-matching conditions defined in your .claude/hookify.{name}.local.md file, verifying that the expected warning or block message renders correctly.