writing-hookify-rules

Create custom Hookify rules using YAML frontmatter, event types, and regex.

Updated Jan 11, 2017
One-click install
npx skills add https://github.com/kaustubhhiware/dotfiles --skill writing-hookify-rules-kaustubhhiware
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/kaustubhhiware/dotfiles/tree/main/claude/plugins/marketplaces/claude-plugins-official/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/kaustubhhiware/dotfiles --skill writing-hookify-rules-kaustubhhiware

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and examples for creating custom Hookify rules, enabling users to define specific patterns and actions for the Hookify system.

Core Features & Use Cases

  • Rule Creation Guidance: Understand the structure and syntax for Hookify rule files (SKILL.md frontmatter and body).
  • Event Type Configuration: Learn how to trigger rules based on different events like bash, file, stop, and prompt.
  • Pattern Matching: Master the use of simple and advanced regex patterns for precise condition matching.
  • Use Case: A developer needs to ensure that no sensitive API keys are accidentally committed to version control. They can use this Skill to learn how to write a Hookify rule that triggers a warning or blocks commits containing patterns like API_KEY=.

Quick Start

Use the writing-hookify-rules skill to learn how to create a new hookify rule for blocking dangerous commands.

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 custom Hookify rule to block dangerous bash commands?

To write a custom Hookify rule, you define YAML frontmatter specifying the `bash` event type and use regex patterns to match dangerous commands. The rule body then defines the blocking action or warning trigger.

What event types can I configure for Hookify rules?

Hookify rules support configuration for `bash`, `file`, `stop`, and `prompt` event types. You select the appropriate event type in the YAML frontmatter to trigger rules based on code or command execution monitoring.

Can I use regex pattern matching in my Hookify rules?

Yes, Hookify rules support both simple and advanced regex pattern matching for precise condition validation. This allows you to define specific triggers like detecting `API_KEY=` patterns before a commit action executes.

Do I need to understand YAML to create custom Hookify rules?

Yes, understanding YAML is required because custom Hookify rules rely on YAML frontmatter to define the rule structure, event types, and pattern matching logic. Knowledge of regex and Hookify's event-driven architecture is also necessary.

How does the Hookify event-driven architecture work for file monitoring?

The Hookify event-driven architecture triggers custom rules when specified events occur. For file monitoring, you configure the `file` event type in your YAML frontmatter to execute defined actions when file patterns match your regex conditions.

What is the best way to prevent sensitive API keys from being committed using custom rules?

The best way to prevent committing sensitive API keys is to create a Hookify rule using the `file` or `bash` event type with a regex pattern matching `API_KEY=`. The rule will trigger a warning or block the commit action when the pattern is detected.