hookify
Create hooks to prevent unwanted behaviors from conversation analysis or explicit instructions
от smartworldarafath★ 16 звёзд на GitHub
Установить hookify в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Hookify - Create Hooks from Unwanted Behaviors
FIRST: Load the hookify:writing-rules skill using the Skill tool to understand rule file format and syntax.
Create hook rules to prevent problematic behaviors by analyzing the conversation or from explicit user instructions.
Your Task
You will help the user create hookify rules to prevent unwanted behaviors. Follow these steps:
Step 1: Gather Behavior Information
If $ARGUMENTS is provided:
- User has given specific instructions:
$ARGUMENTS - Still analyze recent conversation (last 10-15 user messages) for additional context
- Look for examples of the behavior happening
If $ARGUMENTS is empty:
- Launch the conversation-analyzer agent to find problematic behaviors
- Agent will scan user prompts for frustration signals
- Agent will return structured findings
To analyze conversation: Use the Task tool to launch conversation-analyzer agent:
{
"subagent_type": "general-purpose",
"description": "Analyze conversation for unwanted behaviors",
"prompt": "You are analyzing a Google Antigravity conversation to find behaviors the user wants to prevent.
view_file user messages in the current conversation and identify:
1. Explicit requests to avoid something (\"don't do X\", \"stop doing Y\")
2. Corrections or reversions (user fixing Antigravity's actions)
3. Frustrated reactions (\"why did you do X?\", \"I didn't ask for that\")
4. Repeated issues (same problem multiple times)
For each issue found, extract:
- What tool was used (run_command, replace_file_content, write_to_file, etc.)
- Specific pattern or command
- Why it was problematic
- User's stated reason
Return findings as a structured list with:
- category: Type of issue
- tool: Which tool was involved
- pattern: Regex or literal pattern to match
- context: What happened
- severity: high/medium/low
Focus on the most recent issues (last 20-30 messages). Don't go back further unless explicitly asked."
}
Step 2: Present Findings to User
After gathering behaviors (from arguments or agent), present to user using ask_question:
Question 1: Which behaviors to hookify?
- Header: "Create Rules"
- multiSelect: true
- Options: List each detected behavior (max 4)
- Label: Short description (e.g., "Block rm -rf")
- Description: Why it's problematic
Question 2: For each selected behavior, ask about action:
- "Should this block the operation or just warn?"
- Options:
- "Just warn" (action: warn - shows message but allows)
- "Block operation" (action: block - prevents execution)
Question 3: Ask for example patterns:
- "What patterns should trigger this rule?"
- Show detected patterns
- Allow user to refine or add more
Step 3: Generate Rule Files
For each confirmed behavior, create a .claude/hookify.{rule-name}.local.md file:
Rule naming convention:
- Use kebab-case
- Be descriptive:
block-dangerous-rm,warn-console-log,require-tests-before-stop - Start with action verb: block, warn, prevent, require
File format:
---
name: {rule-name}
enabled: true
event: {bash|file|stop|prompt|all}
pattern: {regex pattern}
action: {warn|block}
---
{Message to show Antigravity when rule triggers}
Action values:
warn: Show message but allow operation (default)block: Prevent operation or stop session
For more complex rules (multiple conditions):
---
name: {rule-name}
enabled: true
event: file
conditions:
- field: file_path
operator: regex_match
pattern: \.env$
- field: new_text
operator: contains
pattern: API_KEY
---
{Warning message}
Step 4: Create Files and Confirm
IMPORTANT: Rule files must be created in the current working directory's .claude/ folder, NOT the plugin directory.
Use the current working directory (where Google Antigravity was started) as the base path.
Check if
.claude/directory exists in current working directory- If not, create it first with:
mkdir -p .claude
- If not, create it first with:
Use write_to_file tool to create each
.claude/hookify.{name}.local.mdfile- Use relative path from current working directory:
.claude/hookify.{name}.local.md - The path should resolve to the project's .claude directory, not the plugin's
- Use relative path from current working directory:
Show user what was created:
Created 3 hookify rules: - .claude/hookify.dangerous-rm.local.md - .claude/hookify.console-log.local.md - .claude/hookify.sensitive-files.local.md These rules will trigger on: - dangerous-rm: run_command commands matching "rm -rf" - console-log: Edits adding console.log statements - sensitive-files: Edits to .env or credentials filesVerify files were created in the correct location by listing them
Inform user: "Rules are active immediately - no restart needed!"
The hookify hooks are already loaded and will read your new rules on the next tool use.
Event Types Reference
- bash: Matches run_command tool commands
- file: Matches repla
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл hookify?
Create hooks to prevent unwanted behaviors from conversation analysis or explicit instructions
Как установить скилл hookify?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл hookify запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…