/everything-claude-code:hookify-rulesfrom everything-claude-code
Guides creation and configuration of Hookify rules for Claude Code, covering YAML frontmatter, regex patterns, event types (bash, file, stop, prompt), and file organization.
Ships in everything-claude-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Hookify 规则是带有 YAML frontmatter 的 markdown 文件,定义要监视的模式以及这些模式匹配时显示的消息。规则存储在 .claude/hookify.{rule-name}.local.md 文件中。
---
name: rule-identifier
enabled: true
event: bash|file|stop|prompt|all
pattern: regex-pattern-here
---
当此规则触发时向 Claude 显示的消息。
可以包括 markdown 格式、警告、建议等。
| 字段 | 必需 | 值 | 描述 |
|---|---|---|---|
| name | 是 | kebab-case 字符串 | 唯一标识符(动词优先:warn-、block-、require-*) |
| enabled | 是 | true/false | 在不删除的情况下切换 |
| event | 是 | bash/file/stop/prompt/all | 哪个挂钩事件触发此 |
| action | 否 | warn/block | warn(默认)显示消息;block 阻止操作 |
| pattern | 是* | regex 字符串 | 要匹配的模式 (*或对复杂规则使用 conditions) |
---
name: warn-env-api-keys
enabled: true
event: file
conditions:
- field: file_path
operator: regex_match
pattern: \.env$
- field: new_text
operator: contains
pattern: API_KEY
---
您正在将 API 密钥添加到 .env 文件。确保此文件在 .gitignore 中!
按事件的字段:
commandfile_path、new_text、old_text、contentuser_prompt运算符: regex_match、contains、equals、not_contains、starts_with、ends_with
所有条件必须匹配才能触发规则。
匹配 Bash 命令模式:
rm\s+-rf、dd\s+if=、mkfssudo\s+、su\s+chmod\s+777匹配编辑/写入/多重编辑操作:
console\.log\(、debuggereval\(、innerHTML\s*=\.env$、credentials、\.pem$完成检查和提醒。模式 .* 始终匹配。
匹配用户提示内容以强制执行工作流。
. 到 \.、( 到 \(\s 空白、\d 数字、\w 单词字符+ 一个或多个、* 零个或多个、? 可选| 或运算符log 匹配 "login"、"dialog" — 使用 console\.log\(rm -rf /tmp — 使用 rm\s+-rf\\spython3 -c "import re; print(re.search(r'your_pattern', 'test text'))"
.claude/ 目录.claude/hookify.{descriptive-name}.local.md.claude/*.local.md 添加到 .gitignore/hookify [description] - 创建新规则(如果没有参数,自动分析对话)/hookify-list - 以表格格式查看所有规则/hookify-configure - 以交互方式切换规则开/关/hookify-help - 完整文档最小可行规则:
---
name: my-rule
enabled: true
event: bash
pattern: dangerous_command
---
警告消息在这里
What SKILL.md sets; muted values are Claude Code's defaults
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: agents: Invalid string: must end with ".md"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
272 skills in this plugin
/accessibility使用 WCAG 2.2 AA 级标准设计、实施和审计包容性数字产品。使用此技能为 Web 和原生平台(iOS/Android)生成语义化 ARIA 和辅助功能属性。/agent-architecture-audit智能体和 LLM 应用的全栈诊断。审计 12 层智能体堆栈,检查包装器回归、内存污染、工具纪律失败、隐藏修复循环和渲染损坏。生成按严重程度排序的发现和代码优先修复。对于构建智能体应用、自主循环或任何 LLM 驱动功能的开发者至关重要。/agent-eval在自定义任务上对编码智能体(Claude Code、Aider、Codex 等)进行头对头比较,包含通过率、成本、时间和一致性指标/agent-harness-construction设计和优化 AI 智能体操作空间、工具定义和观察格式,以获得更高的完成率。Other plugins' skills for the same job