Command Palette

Search for a command to run...

Назад к скиллам
скилл № 62179

hookify

Create hooks to prevent unwanted behaviors from conversation analysis or explicit instructions

БесплатноБез исполняемых скриптов
smartworldarafathот 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.

  1. Check if .claude/ directory exists in current working directory

    • If not, create it first with: mkdir -p .claude
  2. Use write_to_file tool to create each .claude/hookify.{name}.local.md file

    • 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
  3. 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 files
    
  4. Verify files were created in the correct location by listing them

  5. 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
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл hookify?

Create hooks to prevent unwanted behaviors from conversation analysis or explicit instructions

Как установить скилл hookify?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл hookify запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить hookify с