writing-hookify-rules

Enforce custom safety guardrails on Claude tool interactions via regex rules.

Updated Nov 3, 2016
One-click install
npx skills add https://github.com/xleliberty/mydotfiles --skill writing-hookify-rules-xleliberty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/xleliberty/mydotfiles/tree/main/.config/.claude/plugins/marketplaces/claude-plugins-official/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/xleliberty/mydotfiles --skill writing-hookify-rules-xleliberty

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the need for granular control over AI behavior by allowing users to define custom safety and operational guardrails for Claude's tool usage.

Core Features & Use Cases

  • Event-Based Monitoring: Trigger custom warnings or blocks on bash commands, file edits, or user prompts.
  • Pattern Matching: Use regex to detect dangerous commands like rm -rf or sensitive data exposure in code.
  • Use Case: Prevent accidental deletion of critical files or warn developers when they attempt to commit console.log statements to production code.

Quick Start

Create a new hookify rule file in the .claude directory that triggers a warning whenever a dangerous bash command is detected.

Frequently Asked Questions about writing-hookify-rules

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

FAQPage Schema
How do I set up custom safety guardrails to monitor Claude tool interactions?

Custom safety guardrails for Claude are enforced by defining YAML-formatted rules that monitor tool interactions through regex-based pattern matching. This mechanism triggers warnings or blocks when specific dangerous actions are detected during bash execution or file modifications.

Can I use regex pattern matching to block dangerous bash commands like rm -rf?

Yes, regex pattern matching can detect dangerous bash commands like rm -rf by defining event triggers in a YAML file. This custom rule monitors bash command execution and applies operational guardrails to prevent unauthorized or dangerous actions automatically.

How do I prevent accidental deletion of critical files or warn developers about console.log statements?

To prevent accidental file deletion or warn about console.log statements, define custom regex pattern matching rules that trigger warnings on file system modifications and bash commands. This monitors user prompts and tool interactions to enforce operational guardrails.

Does this safety hookify approach require any specific dependencies or components to run?

No specific dependencies or components are required to run these safety rules. The hookify approach operates independently by applying regex-based pattern matching and conditional logic defined in YAML-formatted rule files to monitor Claude's tool interactions.

What events can trigger custom warnings when monitoring Claude's tool usage?

Custom warnings are triggered by event-based monitoring on bash command execution, file system modifications, and user prompt analysis. These event triggers are defined in YAML-formatted rule files to apply safety and operational guardrails over Claude's tool usage.

How do I write YAML rule definitions for event triggers and conditional logic in Claude?

YAML rule definitions for Claude require specifying event triggers, conditional logic, regex patterns, and warning messages. These rules are placed in the .claude directory to monitor tool interactions and enforce custom safety guardrails against dangerous actions.