mastering-hooks
Master RuleZ, the high-performance AI policy engine for development workflows. Use when asked to "install rulez", "create hooks", "debug hooks", "hook not…
от SpillwaveSolutions★ 46 звёзд на GitHub
Установить mastering-hooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
mastering-hooks
Contents
Overview
RuleZ is a high-performance AI policy engine that intercepts AI coding assistant events and executes configured actions. It works across multiple platforms through adapter-based event translation.
User Prompt --> AI Assistant --> RuleZ Binary --> [Match Rules] --> Execute Actions
| |
v v
PreToolUse inject/run/block
PostToolUse context/validation
BeforeAgent
PermissionRequest
Supported platforms:
- Claude Code (native) - Full event support
- Gemini CLI - Via adapter with dual-fire events
- GitHub Copilot - Via adapter
- OpenCode - Via adapter with dual-fire events
System components:
- RuleZ Binary (Rust): Fast, deterministic hook execution at runtime
- hooks.yaml: Declarative configuration defining rules, matchers, and actions
- Platform Adapters: Translate platform-specific events to unified RuleZ event types
- This Skill: Intelligent assistant for setup, debugging, and optimization
Decision Tree
What do you need?
|
+-- New to RuleZ? --> [1. Install & Initialize]
|
+-- Have hooks.yaml but hooks not working? --> [4. Troubleshoot]
|
+-- Need to add new behavior? --> [2. Create Rules]
|
+-- Want to understand existing config? --> [3. Explain Configuration]
|
+-- Performance or complexity issues? --> [5. Optimize]
|
+-- Setting up for Gemini/Copilot/OpenCode? --> [6. Multi-Platform Setup]
Capabilities
1. Install & Initialize RuleZ
Use when: Setting up RuleZ for the first time in a project or user-wide.
Checklist:
- Verify RuleZ binary is installed:
rulez --version - Initialize configuration:
rulez init(creates.claude/hooks.yaml) - Register with Claude Code:
rulez install(project-local) orrulez install --global - Validate configuration:
rulez validate - Verify installation: Check
.claude/settings.jsonfor hook entries
Reference: cli-commands.md
2. Create Hook Rules
Use when: Adding new behaviors like context injection, command validation, or workflow automation.
Checklist:
- Identify the event type (PreToolUse, PostToolUse, BeforeAgent, etc.)
- Define matchers (tools, extensions, directories, patterns)
- Choose action type (inject, run, block, require_fields)
- Write the rule in hooks.yaml
- Validate:
rulez validate - Test with:
rulez debug <event> --tool <tool_name>
Rule anatomy:
rules:
- name: rule-name # kebab-case identifier
matchers:
operations: [PreToolUse] # When to trigger
tools: [Write, Edit] # What to match
extensions: [.py] # Optional: file filters
actions:
inject: .claude/context/python-standards.md # What to do
Reference: hooks-yaml-schema.md | rule-patterns.md
3. Explain Configuration
Use when: Understanding what existing hooks do, why they exist, or how they interact.
Checklist:
- Run
rulez explain rule <rule-name>for specific rule analysis - Run
rulez explain rulesfor full configuration overview - Check rule precedence (first match wins within same event)
- Identify potential conflicts or overlaps
Example output from rulez explain rule python-standards:
Rule: python-standards
Event: PreToolUse
Triggers when: Write or Edit tool used on .py files
Action: Injects content from .claude/context/python-standards.md
Reference: cli-commands.md
4. Troubleshoot Hook Issues
Use when: Hooks not firing, unexpected behavior, or error messages.
Diagnostic checklist:
- Validate config:
rulez validate- catches YAML/schema errors - Check registration:
cat .claude/settings.json | grep hooks - Enable debug logging:
rulez debug PreToolUse --tool Write --verbose - Check logs:
rulez logs --limit 20 - Verify file paths: Ensure all
path:references exist
Common issues:
| Symptom | Likely Cause | Fix |
|---|---|---|
| Hook never fires | Event/matcher mismatch | Use rulez debug to trace matching |
| "file not found" | Invalid path in action | Check relative paths from project root |
| Context not injected | Script returns invalid JSON | Validate script output format |
| Permission denied | Script not executable | chmod +x script.sh |
| Event not firing on Gemini | Wrong event name | Check platform-adapters.md for mappings |
Reference: troubleshooting-guide.md
5. Opt
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- assets/check-secrets.sh
- assets/hooks-template.yaml
- assets/python-standards.md
- references/agent-inline-hooks.md
- references/cli-commands.md
- references/hooks-yaml-schema.md
- references/platform-adapters.md
- references/quick-reference.md
- references/rule-patterns.md
- references/troubleshooting-guide.md
FAQ
Что делает скилл mastering-hooks?
Master RuleZ, the high-performance AI policy engine for development workflows. Use when asked to "install rulez", "create hooks", "debug hooks", "hook not firing", "configure context injection", "validate hooks.yaml", "PreToolUse", "PostToolUse", "block dangerous commands", "multi-platform hooks", "Gemini CLI hooks", "Copilot hooks", "OpenCode hooks", "dual-fire events", or "cross-platform rules". Covers installation, rule creation, multi-platform adapters, troubleshooting, and optimization.
Как установить скилл mastering-hooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mastering-hooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…