hookify-writing-rules

Write Hookify rules with YAML frontmatter for bash, file, stop, and prompt events.

8|1|Updated Oct 30, 2025
One-click install
npx skills add https://github.com/akiojin/llm-router --skill hookify-writing-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hookify-writing-rules
Source: https://github.com/akiojin/llm-router/tree/main/.claude/skills/hookify-writing-rules
Command: npx skills add https://github.com/akiojin/llm-router --skill hookify-writing-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides guidance for authoring hookify rules to watch for patterns in prompts or code edits and respond with warnings, suggestions, or blocks.

Core Features & Use Cases

  • YAML-frontmatter-based rule definition in .claude/hookify.{rule-name}.local.md
  • Supports events: bash, file, stop, prompt, all
  • Rich message bodies to explain detections and recommended actions
  • Advanced format for multi-condition rules with multiple fields and operators

Quick Start

Create a new rule in .claude/hookify.my-rule.local.md with frontmatter and a message body. Use the basic pattern for simple events and extend with conditions as needed.

Frequently Asked Questions about hookify-writing-rules

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

FAQPage Schema
How do I define hookify rules to monitor prompt patterns?

Hookify rules monitor specified patterns in prompts and code edits using YAML-frontmatter files. Create a rule in .claude/hookify.{rule-name}.local.md with frontmatter (name, enabled, event, pattern) and a message body. The rule triggers alerts when the pattern matches, letting you guide Claude behavior through warnings or blocks.

What events can hookify rules detect?

Hookify rules support bash, file, stop, prompt, and all events. Each event type triggers rules at different points: bash for shell commands, file for edits, prompt for input text, stop for execution halts, and all for any event. Match the event type to where you want pattern detection.

Can I create multi-condition hookify rules?

Yes, hookify rules support multi-condition patterns using a conditions block. Define multiple fields and operators in the advanced format to combine logic—for example, detecting both a specific keyword and file type together. The schema enforces frontmatter structure with name, enabled, event, optional action, and pattern fields.

How do I write effective alert messages in hookify rules?

Hookify rule messages should be clear and actionable, explaining what pattern triggered the alert and recommending next steps. Write the message body after frontmatter to guide users when a rule detects a match, ensuring the guidance is specific to the pattern and its context.

What's the difference between single-condition and multi-condition hookify patterns?

Single-condition patterns match one criterion directly in the pattern field, ideal for simple detections. Multi-condition patterns use a conditions block with multiple fields and operators, enabling complex logic like AND/OR combinations to catch nuanced scenarios across bash, file, stop, and prompt events.

Do hookify rules work with YAML frontmatter files?

Yes, hookify rules use YAML-frontmatter-based rule definition stored in .claude/hookify.{rule-name}.local.md files. The frontmatter declares the rule's metadata (name, enabled, event, action, pattern), and the message body provides user guidance when the rule triggers.