writing-hookify-rules

Detect problematic tool usage and generate context-sensitive warnings or blocks.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/dobrinz123/claude-skills-share --skill writing-hookify-rules-dobrinz123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/dobrinz123/claude-skills-share/tree/main/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/dobrinz123/claude-skills-share --skill writing-hookify-rules-dobrinz123

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides clear guidance and templates to detect dangerous commands, insecure edits, and risky prompts so repositories can warn or block unsafe operations before they run.

Core Features & Use Cases

  • Event-driven detection: Create rules that trigger on bash, file, prompt, stop, or all events.
  • Simple and advanced patterns: Use single regex patterns or multi-condition rules with fields like file_path, new_text, and command.
  • Enforcement and reminders: Block destructive operations, warn about committing secrets, require checklists before stopping, and standardize team policies across projects.

Quick Start

Create a hookify rule that warns on rm -rf invocations in bash commands and suggests safer alternatives.

Frequently Asked Questions about writing-hookify-rules

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

FAQPage Schema
How do I prevent risky bash commands and unsafe file edits in automated workflows?

You can prevent risky bash commands and unsafe file edits by creating event-driven rules that detect dangerous operations and generate context-sensitive warnings or blocks before they execute.

What events can I target with regex rules to warn or block dangerous operations?

Regex rules can target bash commands, file edits, prompt inputs, and stop events. You can use single regex patterns or multi-condition rules with fields like file_path, new_text, and command to trigger warnings or blocks.

How do I create a rule to block rm -rf and warn about committing secrets?

To block rm -rf or warn about secrets, create a markdown rule file in the .claude directory named hookify.{name}.local.md with YAML frontmatter defining the event, regex pattern, enabled flag, and action set to warn or block.

Can I enforce team policies and require checklists before an agent stops running?

Yes, you can enforce team policies and require checklists by creating stop event rules that block agent termination until specific conditions are met, standardizing safety checks across repository workflows.

Does this rule enforcement system support multi-condition matching beyond single regex patterns?

Yes, the system supports advanced multi-condition rules alongside simple single regex patterns, allowing you to combine fields like file_path, new_text, and command for complex detection logic before warning or blocking operations.

What are the limitations of using local markdown rules for repository command enforcement?

Rules must be placed specifically in the .claude directory as hookify.{name}.local.md files with valid YAML frontmatter. Detection is limited to configured event types and pattern matches, requiring manual rule maintenance for new safety policies.