Writing Hookify Rules

Write Hookify rules with YAML frontmatter to detect risky code and command patterns.

2|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/otrebu/all-agents --skill writing-hookify-rules-otrebu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/otrebu/all-agents/tree/main/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0/skills/writing-rules
Command: npx skills add https://github.com/otrebu/all-agents --skill writing-hookify-rules-otrebu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates manual code review by automatically detecting and preventing dangerous patterns, security risks, and workflow violations.

Core Features & Use Cases

  • Rule Creation: Easily define custom rules for bash commands, file edits, and completion checks.
  • Safety Automation: Block dangerous operations like rm -rf and warn about console.log in production code.
  • Use Case: When your team needs to enforce coding standards, prevent security issues, or ensure process compliance without constant manual oversight.

Quick Start

Create a hookify rule to warn about console.log statements in TypeScript files.

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 Hookify rules to detect dangerous bash commands?

Hookify rules detect dangerous bash commands by matching patterns in YAML frontmatter with name, enabled, event, and pattern fields, plus a Markdown message body that triggers when Claude encounters risky operations like `rm -rf`. Define the pattern to catch the command syntax, set the event to bash, and write a clear warning message.

Can I create rules that prevent sensitive data from being exposed in code?

Yes, Hookify rules can detect sensitive data exposure by defining patterns that match common data leaks—API keys, credentials, tokens—across file edits and prompt submissions. Use pattern matching with optional conditions for multi-condition rules to catch insecure code patterns before they're committed.

What's the best way to enforce coding standards automatically across my workflow?

Hookify rules enforce coding standards by automatically detecting violations like console.log in production TypeScript, unused imports, or non-compliant patterns across bash commands and file edits. Configure rules with YAML frontmatter and trigger messages so Claude warns your team without manual review overhead.

Do Hookify rules support complex conditions beyond simple pattern matching?

Hookify rules support both simple single-pattern rules and advanced multi-condition rules through optional conditions fields in YAML frontmatter. Multi-condition rules let you detect nuanced risks—for example, flagging risky commands only in specific file contexts—beyond basic pattern matching.

How do I set up a rule that warns about specific code patterns in file edits?

Set the event field to file in your YAML frontmatter and define a pattern matching the code you want to catch—like production logging statements. When Claude edits a file, the pattern triggers and displays your Markdown message, stopping unsafe changes before they're written.

Can I use Hookify rules to block risky workflow steps or completion checks?

Hookify rules can apply to stop events to block risky workflow steps and completion checks. Configure the event field to stop, set your safety pattern, and provide a Markdown message explaining why the step was blocked, preventing unsafe operations at any stage in your process.