Writing Hookify Rules — Hookifyルール設定 Writing Hookify Rules, my-dev-setup, community, Hookifyルール設定, ide skills, 開発環境設定, YAMLフロントマター, 正規表現パターンマッチ, Markdownメッセージ, bashイベントハンドリング, Claude Code

v0.1.0

このスキルについて

Claude、AutoGPT、LangChain などの、Markdown ファイルの YAML フロントマターでのカスタム パターン マッチングと通知機能を必要とする AI エージェントに最適です。 Hookifyルールは開発環境を設定する方法で、MarkdownファイルとYAMLフロントマターを使用してパターンとメッセージを定義する

機能

YAMLフロントマターを使用してパターンとメッセージを定義する
正規表現パターンマッチをサポートする
メッセージはMarkdownフォーマットをサポートする
ルールは`.claude/hookify.{rule-name}.local.md`ファイルに保存される
bash、file、stop、prompt、allイベントをサポートする

# Core Topics

BartekFo BartekFo
[0]
[0]
Updated: 2/10/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 10/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Quality floor passed for review
Review Score
10/11
Quality Score
65
Canonical Locale
en
Detected Body Locale
en

Claude、AutoGPT、LangChain などの、Markdown ファイルの YAML フロントマターでのカスタム パターン マッチングと通知機能を必要とする AI エージェントに最適です。 Hookifyルールは開発環境を設定する方法で、MarkdownファイルとYAMLフロントマターを使用してパターンとメッセージを定義する

このスキルを使用する理由

エージェントが正規表現を使用してカスタム パターンとメッセージを定義し、`.claude/hookify.{rule-name}.local.md` ファイルに保存することで、bash、ファイル、停止、プロンプト、またはすべてのイベントの高度なイベント ハンドリングを可能にし、Markdown フォーマットと警告を提供します。

おすすめ

Claude、AutoGPT、LangChain などの、Markdown ファイルの YAML フロントマターでのカスタム パターン マッチングと通知機能を必要とする AI エージェントに最適です。

実現可能なユースケース for Writing Hookify Rules

イベント トリガー用のカスタム正規表現パターンを定義する
Markdown フォーマットと警告を含む通知を生成する
bash またはファイルの相互作用などの特定のイベント用にルール ファイルを構成する

! セキュリティと制限

  • ルール ファイルの保存には `.claude` ディレクトリへのアクセスが必要
  • YAML フロントマターを含む Markdown ファイルでのみルール定義が可能

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is Writing Hookify Rules?

Claude、AutoGPT、LangChain などの、Markdown ファイルの YAML フロントマターでのカスタム パターン マッチングと通知機能を必要とする AI エージェントに最適です。 Hookifyルールは開発環境を設定する方法で、MarkdownファイルとYAMLフロントマターを使用してパターンとメッセージを定義する

How do I install Writing Hookify Rules?

Run the command: npx killer-skills add BartekFo/my-dev-setup/Writing Hookify Rules. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for Writing Hookify Rules?

Key use cases include: イベント トリガー用のカスタム正規表現パターンを定義する, Markdown フォーマットと警告を含む通知を生成する, bash またはファイルの相互作用などの特定のイベント用にルール ファイルを構成する.

Which IDEs are compatible with Writing Hookify Rules?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for Writing Hookify Rules?

ルール ファイルの保存には `.claude` ディレクトリへのアクセスが必要. YAML フロントマターを含む Markdown ファイルでのみルール定義が可能.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add BartekFo/my-dev-setup/Writing Hookify Rules. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use Writing Hookify Rules immediately in the current project.

! Reference-Only Mode

This page remains useful for installation and reference, but Killer-Skills no longer treats it as a primary indexable landing page. Read the review above before relying on the upstream repository instructions.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

Writing Hookify Rules

Install Writing Hookify Rules, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Writing Hookify Rules

Overview

Hookify rules are markdown files with YAML frontmatter that define patterns to watch for and messages to show when those patterns match. Rules are stored in .claude/hookify.{rule-name}.local.md files.

Rule File Format

Basic Structure

markdown
1--- 2name: rule-identifier 3enabled: true 4event: bash|file|stop|prompt|all 5pattern: regex-pattern-here 6--- 7 8Message to show Claude when this rule triggers. 9Can include markdown formatting, warnings, suggestions, etc.

Frontmatter Fields

name (required): Unique identifier for the rule

  • Use kebab-case: warn-dangerous-rm, block-console-log
  • Be descriptive and action-oriented
  • Start with verb: warn, prevent, block, require, check

enabled (required): Boolean to activate/deactivate

  • true: Rule is active
  • false: Rule is disabled (won't trigger)
  • Can toggle without deleting rule

event (required): Which hook event to trigger on

  • bash: Bash tool commands
  • file: Edit, Write, MultiEdit tools
  • stop: When agent wants to stop
  • prompt: When user submits a prompt
  • all: All events

action (optional): What to do when rule matches

  • warn: Show message but allow operation (default)
  • block: Prevent operation (PreToolUse) or stop session (Stop events)
  • If omitted, defaults to warn

pattern (simple format): Regex pattern to match

  • Used for simple single-condition rules
  • Matches against command (bash) or new_text (file)
  • Python regex syntax

Example:

yaml
1event: bash 2pattern: rm\s+-rf

Advanced Format (Multiple Conditions)

For complex rules with multiple conditions:

markdown
1--- 2name: warn-env-file-edits 3enabled: true 4event: file 5conditions: 6 - field: file_path 7 operator: regex_match 8 pattern: \.env$ 9 - field: new_text 10 operator: contains 11 pattern: API_KEY 12--- 13 14You're adding an API key to a .env file. Ensure this file is in .gitignore!

Condition fields:

  • field: Which field to check
    • For bash: command
    • For file: file_path, new_text, old_text, content
  • operator: How to match
    • regex_match: Regex pattern matching
    • contains: Substring check
    • equals: Exact match
    • not_contains: Substring must NOT be present
    • starts_with: Prefix check
    • ends_with: Suffix check
  • pattern: Pattern or string to match

All conditions must match for rule to trigger.

Message Body

The markdown content after frontmatter is shown to Claude when the rule triggers.

Good messages:

  • Explain what was detected
  • Explain why it's problematic
  • Suggest alternatives or best practices
  • Use formatting for clarity (bold, lists, etc.)

Example:

markdown
1⚠️ **Console.log detected!** 2 3You're adding console.log to production code. 4 5**Why this matters:** 6- Debug logs shouldn't ship to production 7- Console.log can expose sensitive data 8- Impacts browser performance 9 10**Alternatives:** 11- Use a proper logging library 12- Remove before committing 13- Use conditional debug builds

Event Type Guide

bash Events

Match Bash command patterns:

markdown
1--- 2event: bash 3pattern: sudo\s+|rm\s+-rf|chmod\s+777 4--- 5 6Dangerous command detected!

Common patterns:

  • Dangerous commands: rm\s+-rf, dd\s+if=, mkfs
  • Privilege escalation: sudo\s+, su\s+
  • Permission issues: chmod\s+777, chown\s+root

file Events

Match Edit/Write/MultiEdit operations:

markdown
1--- 2event: file 3pattern: console\.log\(|eval\(|innerHTML\s*= 4--- 5 6Potentially problematic code pattern detected!

Match on different fields:

markdown
1--- 2event: file 3conditions: 4 - field: file_path 5 operator: regex_match 6 pattern: \.tsx?$ 7 - field: new_text 8 operator: regex_match 9 pattern: console\.log\( 10--- 11 12Console.log in TypeScript file!

Common patterns:

  • Debug code: console\.log\(, debugger, print\(
  • Security risks: eval\(, innerHTML\s*=, dangerouslySetInnerHTML
  • Sensitive files: \.env$, credentials, \.pem$
  • Generated files: node_modules/, dist/, build/

stop Events

Match when agent wants to stop (completion checks):

markdown
1--- 2event: stop 3pattern: .* 4--- 5 6Before stopping, verify: 7- [ ] Tests were run 8- [ ] Build succeeded 9- [ ] Documentation updated

Use for:

  • Reminders about required steps
  • Completion checklists
  • Process enforcement

prompt Events

Match user prompt content (advanced):

markdown
1--- 2event: prompt 3conditions: 4 - field: user_prompt 5 operator: contains 6 pattern: deploy to production 7--- 8 9Production deployment checklist: 10- [ ] Tests passing? 11- [ ] Reviewed by team? 12- [ ] Monitoring ready?

Pattern Writing Tips

Regex Basics

Literal characters: Most characters match themselves

  • rm matches "rm"
  • console.log matches "console.log"

Special characters need escaping:

  • . (any char) → \. (literal dot)
  • ( )\( \) (literal parens)
  • [ ]\[ \] (literal brackets)

Common metacharacters:

  • \s - whitespace (space, tab, newline)
  • \d - digit (0-9)
  • \w - word character (a-z, A-Z, 0-9, _)
  • . - any character
  • + - one or more
  • * - zero or more
  • ? - zero or one
  • | - OR

Examples:

rm\s+-rf         Matches: rm -rf, rm  -rf
console\.log\(   Matches: console.log(
(eval|exec)\(    Matches: eval( or exec(
chmod\s+777      Matches: chmod 777, chmod  777
API_KEY\s*=      Matches: API_KEY=, API_KEY =

Testing Patterns

Test regex patterns before using:

bash
1python3 -c "import re; print(re.search(r'your_pattern', 'test text'))"

Or use online regex testers (regex101.com with Python flavor).

Common Pitfalls

Too broad:

yaml
1pattern: log # Matches "log", "login", "dialog", "catalog"

Better: console\.log\(|logger\.

Too specific:

yaml
1pattern: rm -rf /tmp # Only matches exact path

Better: rm\s+-rf

Escaping issues:

  • YAML quoted strings: "pattern" requires double backslashes \\s
  • YAML unquoted: pattern: \s works as-is
  • Recommendation: Use unquoted patterns in YAML

File Organization

Location: All rules in .claude/ directory Naming: .claude/hookify.{descriptive-name}.local.md Gitignore: Add .claude/*.local.md to .gitignore

Good names:

  • hookify.dangerous-rm.local.md
  • hookify.console-log.local.md
  • hookify.require-tests.local.md
  • hookify.sensitive-files.local.md

Bad names:

  • hookify.rule1.local.md (not descriptive)
  • hookify.md (missing .local)
  • danger.local.md (missing hookify prefix)

Workflow

Creating a Rule

  1. Identify unwanted behavior
  2. Determine which tool is involved (Bash, Edit, etc.)
  3. Choose event type (bash, file, stop, etc.)
  4. Write regex pattern
  5. Create .claude/hookify.{name}.local.md file in project root
  6. Test immediately - rules are read dynamically on next tool use

Refining a Rule

  1. Edit the .local.md file
  2. Adjust pattern or message
  3. Test immediately - changes take effect on next tool use

Disabling a Rule

Temporary: Set enabled: false in frontmatter Permanent: Delete the .local.md file

Examples

See ${CLAUDE_PLUGIN_ROOT}/examples/ for complete examples:

  • dangerous-rm.local.md - Block dangerous rm commands
  • console-log-warning.local.md - Warn about console.log
  • sensitive-files-warning.local.md - Warn about editing .env files

Quick Reference

Minimum viable rule:

markdown
1--- 2name: my-rule 3enabled: true 4event: bash 5pattern: dangerous_command 6--- 7 8Warning message here

Rule with conditions:

markdown
1--- 2name: my-rule 3enabled: true 4event: file 5conditions: 6 - field: file_path 7 operator: regex_match 8 pattern: \.ts$ 9 - field: new_text 10 operator: contains 11 pattern: any 12--- 13 14Warning message

Event types:

  • bash - Bash commands
  • file - File edits
  • stop - Completion checks
  • prompt - User input
  • all - All events

Field options:

  • Bash: command
  • File: file_path, new_text, old_text, content
  • Prompt: user_prompt

Operators:

  • regex_match, contains, equals, not_contains, starts_with, ends_with

関連スキル

Looking for an alternative to Writing Hookify Rules or another community skill for your workflow? Explore these related open-source skills.

すべて表示

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

カスタマイズ可能なウィジェットプラグインをprompts.chatのフィードシステム用に生成する

149.6k
0
AI

flags

Logo of vercel
vercel

React フレームワーク

138.4k
0
ブラウザ

pr-review

Logo of pytorch
pytorch

Pythonにおけるテンソルと動的ニューラルネットワーク(強力なGPUアクセラレーション)

98.6k
0
開発者