writing-hookify-rules

Generate Hookify rule markdown with YAML frontmatter for bash, file, prompt, or stop events.

1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Leap0920/Clean-Portfolio --skill writing-hookify-rules-leap0920
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/Leap0920/Clean-Portfolio/tree/main/%25USERPROFILE%25/.openclaude/plugins/marketplaces/claude-plugins-official/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/Leap0920/Clean-Portfolio --skill writing-hookify-rules-leap0920

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the confusion and mistakes involved in creating Hookify rules that correctly match risky actions and produce helpful Claude guidance.

Core Features & Use Cases

  • Rule authoring: Design Hookify rule files with the required YAML frontmatter and a clear triggering message.
  • Pattern matching: Use the appropriate single pattern regex or multi-condition matching with conditions to target specific events (bash, file edits, prompts, and stop).
  • Practical guardrails: Create rules that warn or block actions, with examples covering dangerous commands, sensitive file edits, and problematic code patterns.

Quick Start

Ask the AI to create a Hookify rule that blocks edits to .env files by warning the user first and then preventing the action on file write events.

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 a Hookify rule to block unsafe bash commands?

To create a Hookify rule that blocks unsafe bash commands, author a local markdown file with YAML frontmatter specifying the bash event, a regex pattern for detection, and a message body explaining the risk and recommended next steps.

What is the correct YAML frontmatter format for Hookify rules?

Correct YAML frontmatter for Hookify rules requires specifying the enabled field, the target event type, and either a single regex pattern or multi-condition mappings with proper field and operator values to trigger safety guardrails.

Can I use multi-condition matching instead of a single regex pattern for file edit detection?

Yes, you can use multi-condition matching for file edit detection by defining the conditions block with proper field, operator, and pattern mappings instead of relying on a single regex pattern in your Hookify rule.

What events can I target when creating safety guardrails with Hookify?

When creating safety guardrails with Hookify, you can target bash, file edit, prompt, stop, or all events to detect and react to risky actions across different stages of Claude's workflow.

How do I set up a Hookify rule to warn before preventing edits to sensitive files like .env?

To warn before preventing edits to sensitive files like .env, create a Hookify rule local markdown file targeting file write events with a matching pattern and a message body that explains the detection and recommended next steps.