Writing Hookify Rules

Create and maintain YAML-frontmatter hookify rules that watch prompt patterns and present guidance messages.

Updated Jan 19, 2026
One-click install
npx skills add https://github.com/kgadek/kgadek-claude-plugin --skill writing-hookify-rules-kgadek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/kgadek/kgadek-claude-plugin/tree/main/ai-spec/2026-01-21-sdd-inspirations/references/anthropics-claude-plugins-official/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/kgadek/kgadek-claude-plugin --skill writing-hookify-rules-kgadek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hookify rules automate safe and policy-driven responses by watching prompts for defined patterns and surfacing contextual guidance, warnings, or blocks. Rules are stored in .claude/hookify.{rule-name}.local.md and loaded when Claude evaluates a prompt.

Core Features & Use Cases

  • Define YAML-frontmatter based rules that trigger messages when patterns match.
  • Store rules in .claude/hookify.{rule-name}.local.md and load them during tool use.
  • Use cases include enforcing content policies, restricting dangerous commands, and guiding user interactions.

Quick Start

Create a new rule file in .claude/hookify.{name}.local.md with fields name, enabled, event, pattern, and a helpful message.

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 custom prompt rules to block dangerous commands in Claude?

To block dangerous commands in Claude, create hookify rules using YAML frontmatter with fields like name, enabled, event, pattern, and message, then save them under .claude/hookify.{rule-name}.local.md to load on demand.

What is a hookify rule and how does it enforce content policies?

A hookify rule is a YAML-based configuration that watches prompts for defined patterns and surfaces contextual guidance, warnings, or blocks to automate safe and policy-driven responses during Claude interactions.

How do I configure YAML frontmatter to trigger warnings for specific prompt patterns?

Configure YAML frontmatter by setting the enabled field to true, defining the event type, specifying the pattern to match in prompts, and writing a helpful guidance message that surfaces when the pattern triggers.

Can I apply hookify rules across both code-edit scenarios and content policy checks?

Yes, you can apply hookify rules across code-edit scenarios and content policy checks by defining patterns in YAML frontmatter, providing timely warnings or blocks whenever matched patterns occur during tool use.

Where do hookify rule files need to be saved for Claude to load them on demand?

Hookify rule files must be saved under the .claude/hookify.{rule-name}.local.md file path, ensuring Claude evaluates and loads the YAML frontmatter rules automatically when processing prompts.