hookify-rules
Use this skill when the user asks to create hookify rules, write hook rules, configure hookify, add hookify rules, or needs guidance on hookify rule syntax and patterns.
Translation reviewedRead the original Chinese text
当用户要求创建hookify规则、编写hook规则、配置hookify、添加hookify规则或需要关于hookify规则语法和模式的指导时,应使用此技能。
Target: Target not categorized. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original Chinese text
Topics in the source
- 编写 Hookify 规则
- 概述
- 规则文件格式
- 基本结构
- 前置元数据字段
- 高级格式(多条件)
- 事件类型指南
- bash 事件
Hookify 规则是带有 YAML 前置元数据的 Markdown 文件,用于定义要监控的模式以及匹配时显示的消息。规则存储在 .claude/hookify.{rule-name}.local.md 文件中。 | 字段 | 必填 | 值 | 描述 | |-------|----------|--------|-------------| | name | 是 | kebab-case 字符串 | 唯一标识符(动词优先:warn-、block-、require-) | | enabled | 是 | true/false | 无需删除即可切换 | | event | 是 | bash/file/stop/prompt/all | 触发规则的钩子事件 | | action | 否 | warn/block | warn(默认)显示消息;block 阻止操作 | | pattern | 是 | 正则表达式字符串 | 要匹配的模式(\或使用 conditions 实现复杂规则) | 按事件划分的条件字段: bash:command file:filepath、newtext、oldtext、content prompt:userprompt 运算符: regexmatch、contains、equals、notcontains、startswith、endswith 所有条件必须同时满足才能触发规则。 匹配 Bash 命令模式: 危险命令:rm\s+-rf、dd\s+if=、mkfs 权限提升:sudo\s+、su\s+ 权限问题:chmod\s+777 匹配编辑/写入/多重编辑操作: 调试代码:console\.log\(、debugger 安全风险:eval\(、innerHTML\s= 敏感文件:\.env$、credentials、\.pem$ 完成检查与提醒。模式 . 始终匹配。 匹配用户提示内容以强制执行工作流程。 转义特殊字符:. 转义为 \.,( 转义为 \( \s 空白字符,\d 数字,\w 单词字符 + 一个或多个, 零个或多个,? 可选 | 或运算符 过于宽泛:log 会匹配 "login"、"dialog"——请使用 console\.log\( 过于具体:rm -rf /tmp——请使用 rm\s+-rf YAML 转义:使用无引号模式;带引号的字符串需要 \\s 位置:项目根目录下的 .claude/ 目录 命名:.claude/hookify.{descriptive-name}.local.md Gitignore:将 .claude/.local.md 添加到 .gitignore /hookify [description] - 创建新规则(无参数时自动分析对话) /hookify-list - 以表格形式查看所有规则 /ho
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- affaan-m/ECC
- Source file
- docs/zh-CN/skills/hookify-rules/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Requirements
- Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.
A small first task
先阅读原作者说明,再决定是否在自己的 AI 工具中使用。
Instructions for your AI tool
- Claude Desktop: resource-specific guide not available yet
- Claude Code: resource-specific guide not available yet
- Cursor: resource-specific guide not available yet
- Codex: resource-specific guide not available yet
Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:42.357Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.