hooks-automation
Configure Claude Code hooks for automated coordination and learning
от ruvnet★ 850 звёзд на GitHub
Установить hooks-automation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Hooks Automation Skill
Configure intelligent hooks for automated coordination, formatting, and learning.
Available Hooks
PreToolUse Hooks
Triggered before Claude Code tools execute.
{
"PreToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [{
"type": "command",
"command": "npx [email protected] hooks pre-edit \"$TOOL_INPUT_file_path\""
}]
},
{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": "npx [email protected] hooks pre-command \"$TOOL_INPUT_command\""
}]
}
]
}
PostToolUse Hooks
Triggered after successful tool execution.
{
"PostToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [{
"type": "command",
"command": "npx [email protected] hooks post-edit \"$TOOL_INPUT_file_path\" --success"
}]
}
]
}
Session Hooks
Triggered at session start/end.
{
"SessionStart": [{
"hooks": [{
"type": "command",
"command": "npx [email protected] hooks intelligence stats --json"
}]
}],
"SessionEnd": [{
"hooks": [{
"type": "command",
"command": "npx [email protected] hooks metrics --session --json"
}]
}]
}
Hook Commands
# Pre-edit: Check for patterns, validate
npx [email protected] hooks pre-edit "src/api.ts"
# Post-edit: Format, learn pattern
npx [email protected] hooks post-edit "src/api.ts" --success
# Pre-command: Validate safety
npx [email protected] hooks pre-command "npm install"
# Post-command: Track result
npx [email protected] hooks post-command "npm install"
# Intelligence routing
npx [email protected] hooks route "implement OAuth"
# Session metrics
npx [email protected] hooks metrics --session
Automation Features
Auto-Agent Assignment
Hooks automatically assign specialized agents based on file type:
.ts,.tsx→ TypeScript agent.py→ Python agent.md→ Documentation agenttest.*→ Testing agent
Command Validation
Pre-command hooks validate for:
- Dangerous patterns (rm -rf, force push)
- Permission requirements
- Resource limits
Pattern Learning
Post-edit hooks learn:
- Code patterns
- Successful solutions
- Error recovery strategies
Metrics Tracking
Session hooks track:
- Token usage
- Tool invocations
- Success rates
- Performance metrics
Configuration
Full hook configuration in .claude/settings.json:
{
"hooks": {
"PreToolUse": [...],
"PostToolUse": [...],
"PostToolUseFailure": [...],
"SessionStart": [...],
"SessionEnd": [...],
"UserPromptSubmit": [...],
"Stop": [...]
}
}
Best Practices
- Keep hooks fast: <100ms for interactive experience
- Use timeout: Prevent hanging hooks
- Handle failures gracefully: Use
|| truefor optional hooks - Log metrics: Track for optimization
- Test hooks: Verify before deployment
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл hooks-automation?
Configure Claude Code hooks for automated coordination and learning
Как установить скилл hooks-automation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл hooks-automation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
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…