Hook Development for Claude Code Plugins
anthropics/claude-plugins-official
Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.
当用户要求创建hookify规则、编写hook规则、配置hookify、添加hookify规则或需要关于hookify规则语法和模式的指导时,应使用此技能。
$ npx skills add affaan-m/ECC --skill hookify-rules -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install affaan-m/ECC hookify-rules --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/docs/zh-CN/skills/hookify-rules .claude/skills/hookify-rules && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "hookify-rules" agent skill from https://github.com/affaan-m/ECC/tree/main/docs/zh-CN/skills/hookify-rules into .claude/skills/hookify-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hookify-rules", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/affaan-m/ECC/tree/main/docs/zh-CN/skills/hookify-rulesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add affaan-m/ECC --skill hookify-rules -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install affaan-m/ECC hookify-rules --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .agents/skills && cp -r skills-src/docs/zh-CN/skills/hookify-rules .agents/skills/hookify-rules && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "hookify-rules" agent skill from https://github.com/affaan-m/ECC/tree/main/docs/zh-CN/skills/hookify-rules into .agents/skills/hookify-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hookify-rules", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add affaan-m/ECC --skill hookify-rules -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install affaan-m/ECC hookify-rules --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/docs/zh-CN/skills/hookify-rules .cursor/skills/hookify-rules && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "hookify-rules" agent skill from https://github.com/affaan-m/ECC/tree/main/docs/zh-CN/skills/hookify-rules into .cursor/skills/hookify-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hookify-rules", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/affaan-m/ECC.git --path docs/zh-CN/skills/hookify-rules--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add affaan-m/ECC --skill hookify-rules -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install affaan-m/ECC hookify-rules --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/docs/zh-CN/skills/hookify-rules .gemini/skills/hookify-rules && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "hookify-rules" agent skill from https://github.com/affaan-m/ECC/tree/main/docs/zh-CN/skills/hookify-rules into .gemini/skills/hookify-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hookify-rules", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install affaan-m/ECC hookify-rulesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add affaan-m/ECC --skill hookify-rules -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .github/skills && cp -r skills-src/docs/zh-CN/skills/hookify-rules .github/skills/hookify-rules && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "hookify-rules" agent skill from https://github.com/affaan-m/ECC/tree/main/docs/zh-CN/skills/hookify-rules into .github/skills/hookify-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hookify-rules", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add affaan-m/ECC --skill hookify-rules -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install affaan-m/ECC hookify-rules --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/docs/zh-CN/skills/hookify-rules .opencode/skills/hookify-rules && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "hookify-rules" agent skill from https://github.com/affaan-m/ECC/tree/main/docs/zh-CN/skills/hookify-rules into .opencode/skills/hookify-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hookify-rules", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
hookify-rules当用户要求创建hookify规则、编写hook规则、配置hookify、添加hookify规则或需要关于hookify规则语法和模式的指导时,应使用此技能。
Hookify Rules is an agent skill from affaan-m/ECC. 当用户要求创建hookify规则、编写hook规则、配置hookify、添加hookify规则或需要关于hookify规则语法和模式的指导时,应使用此技能。
Its SKILL.md is about 610 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Agent Workflows, covering Hooks and plugins. It works with Bash. The repository describes itself as: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. The licence is MIT.
Read from SKILL.md and the folder at commit ef648e0. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
python3From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Hookify Rules loads about 605 tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 120 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
你正在向 .env 文件中添加 API 密钥。请确保该文件已包含在 .gitignore 中!Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from affaan-m/ECC at commit ef648e0, republished under its MIT licence (© affaan-m). 120 words, ~605 tokens.
.claude/skills/hookify-rules/SKILL.md (or your agent's skills folder).Hookify 规则是带有 YAML 前置元数据的 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 | 是* | 正则表达式字符串 | 要匹配的模式(*或使用 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
---
你正在向 .env 文件中添加 API 密钥。请确保该文件已包含在 .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
---
此处显示警告信息© affaan-m, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in docs/zh-CN/skills/hookify-rules of affaan-m/ECC.
Open the folder on GitHubat commit ef648e0
Hookify Rules next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Hookify Rules this skillaffaan-m/ECC | 275k | — | ~605 | Automated safety check: Notes | MIT | |
| Hook Development for Claude Code Pluginsanthropics/claude-plugins-official | 38k | 11 repos | ~4.1k | Automated safety check: Notes | Apache-2.0 | |
| Plugin Settings Patternanthropics/claude-plugins-official | 38k | 7 repos | ~3k | Automated safety check: Pass | Apache-2.0 | |
| Crush Configurationcharmbracelet/crush | 29k | — | ~3.7k | Automated safety check: Pass | Custom licence | |
| Verify Setup Health Checkdiet103/claude-code-infrastructure-showcase | 10k | — | ~363 | Automated safety check: Pass | MIT | |
| Claude SmartReflexioAI/claude-smart | 783 | — | ~439 | Automated safety check: Pass | Apache-2.0 |
anthropics/claude-plugins-official
Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.
anthropics/claude-plugins-official
Shows how Claude Code plugins keep per-project settings and state in .claude/plugin-name.local.md files with YAML frontmatter and a markdown body.
charmbracelet/crush
Explains how to configure the Crush coding agent with crushrc or crush.json, covering providers, models, LSPs, MCP servers, hooks, permissions and config precedence.
diet103/claude-code-infrastructure-showcase
Run the infrastructure health check and fix anything that fails
ReflexioAI/claude-smart
Codex-only — use when the user asks to run claude-smart commands in Codex, including claude-smart show, learn, restart, dashboard, clear-all, or slash-like requests such as /claude-smart:learn.
greatSumini/cc-system
Create and configure Claude Code hooks for customizing agent behavior.
affaan-m/ECC
Ingest, index, search, edit, and monitor video and audio with the VideoDB Python SDK — upload from files, URLs, or RTSP feeds, build spoken and scene indexes with timestamped search and playable…
affaan-m/ECC
Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.
affaan-m/ECC
Builds DRAFT counterparty agreements from one markdown template and a small JSON spec per party, with clauses picked by the party's role.
affaan-m/ECC
Measures whether agents actually follow a skill, rule or agent definition by generating scenarios at three strictness levels and scoring tool-call traces.
affaan-m/ECC
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.
affaan-m/ECC
Adds one optional external Codex critique that tries to break a council's decision draft, sent to OpenAI only after you consent.
Works with
Categories
当用户要求创建hookify规则、编写hook规则、配置hookify、添加hookify规则或需要关于hookify规则语法和模式的指导时,应使用此技能。. Hookify Rules is an agent skill from affaan-m/ECC.
Hookify Rules fits situations like: tasks that involve Hooks and plugins.
Run `npx skills add affaan-m/ECC --skill hookify-rules -a claude-code`. Or copy the skill folder (docs/zh-CN/skills/hookify-rules in affaan-m/ECC) into .claude/skills/hookify-rules in your project. Claude Code loads it when a task matches its description.
Run `npx skills add affaan-m/ECC --skill hookify-rules -a codex`. Or copy the skill folder (docs/zh-CN/skills/hookify-rules in affaan-m/ECC) into .agents/skills/hookify-rules in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add affaan-m/ECC --skill hookify-rules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hookify-rules, .gemini/skills/hookify-rules, .github/skills/hookify-rules and .opencode/skills/hookify-rules in your project.
Going by SKILL.md and its folder, Hookify Rules needs the command-line tools its instructions call (python3) and credentials named API_KEY. Our summary lists: Python 3; A credential in API_KEY.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Hookify Rules is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 605 tokens (SKILL.md is roughly 2.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Hookify Rules: Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Plugin Settings Pattern (anthropics/claude-plugins-official, 38k stars), Crush Configuration (charmbracelet/crush, 29k stars) and Verify Setup Health Check (diet103/claude-code-infrastructure-showcase, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
affaan-m (a GitHub user) maintains it in affaan-m/ECC, which has 275,023 GitHub stars. The repository holds 645 skills in this directory. The repository was last updated on October 5, 2026.
Source: affaan-m/ECC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.