Writing Hookify Rules

Create Hookify rules with YAML frontmatter to monitor events and surface contextual messages.

25|4|Updated Dec 11, 2025
One-click install
npx skills add https://github.com/CaptainCrouton89/crouton-kit --skill writing-hookify-rules-captaincrouton89
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/CaptainCrouton89/crouton-kit/tree/main/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/CaptainCrouton89/crouton-kit --skill writing-hookify-rules-captaincrouton89

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a standardized approach to defining guardrails for Hookify by enabling the creation of rules that watch for patterns and display guidance or warnings when matched.

Core Features & Use Cases

  • Define rules with YAML frontmatter (name, enabled, event, pattern) to specify when to trigger messages.
  • Support both simple and advanced formats, including multi-condition rules with fields like conditions, file_path, new_text, and pattern.
  • Store rules in .claude/hookify.{rule-name}.local.md files (and project-wide equivalents) for consistent policy enforcement.
  • Use cases include preventing risky edits, guiding prompts, and providing actionable feedback to users.

Quick Start

  • Create a hookify rule that warns when a file edit matches the API_KEY pattern.

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 YAML frontmatter rules to guard prompts and monitor user inputs?

To guard prompts, create Hookify rules using YAML frontmatter with required fields: name, enabled, event, and pattern. Store these markdown files in .claude/hookify.{rule-name}.local.md to monitor inputs and display contextual messages when patterns match.

What events can I target with Hookify rules to surface warnings?

Hookify rules can target Bash, File, Stop, Prompt, or All events. You specify the target event in the YAML frontmatter to trigger contextual markdown messages when matching patterns occur during those specific actions.

How do I set up a rule to warn when a file edit matches an API key pattern?

Create a Hookify rule with the event set to File, define your API_KEY pattern in the YAML frontmatter, and write a markdown message body with the warning. Save it as .claude/hookify.{rule-name}.local.md to surface guidance during risky edits.

Can I use multiple conditions in a single rule to prevent risky edits?

Yes, Hookify supports an advanced format with multi-condition rules. Beyond basic fields, you can use conditions, file_path, new_text, and pattern fields together to precisely match and prevent risky edits before they occur.

Does Hookify support project-wide rule files for consistent policy enforcement?

Yes, Hookify supports storing rules in project-wide equivalent files alongside .claude/hookify.{rule-name}.local.md files. This allows you to enforce consistent guardrails and prompt safety policies across an entire project.

What is the minimum YAML frontmatter required to trigger a contextual message?

The minimum required YAML frontmatter fields are name, enabled, event, and pattern. You can then add an optional markdown message body to guide users with actionable feedback when the pattern matches.