hook-creator
БесплатноЗапускает вложенные скриптыНе проверенCreates and registers hooks for the Claude Code framework. Handles pre/post tool execution, validation, memory, and session hooks. Use when new validation…
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
Hook Creator Skill
Creates, validates, and registers hooks for the multi-agent orchestration framework.
ROUTER UPDATE REQUIRED (CRITICAL - DO NOT SKIP)
After creating ANY hook, you MUST update documentation:
1. Add to .claude/hooks/README.md under appropriate category
2. Register in config.yaml or settings.json if required
3. Update learnings.md with hook summary
Verification:
grep "<hook-name>" .claude/hooks/README.md || echo "ERROR: hooks/README.md NOT UPDATED!"
WHY: Hooks not documented are invisible and unmaintainable.
Overview
This skill creates hooks for the Claude Code framework:
- Pre-tool execution - Safety validation before commands run
- Post-tool execution - Logging, memory updates, telemetry
- Session lifecycle - Initialize context, cleanup on exit
- Memory management - Auto-extract learnings, format memory files
- Routing enforcement - Ensure Router-First protocol compliance
Hook Types
| Type | Location | Purpose | When Triggered |
|---|---|---|---|
| Safety | .claude/hooks/safety/ |
Validate commands, block dangerous ops | Before Bash/Write/Edit |
| Memory | .claude/hooks/memory/ |
Auto-update learnings, extract insights | After task completion |
| Routing | .claude/hooks/routing/ |
Enforce router-first protocol | On UserPromptSubmit |
| Session | .claude/hooks/session/ |
Initialize/cleanup sessions | Session start/end |
Hook-Agent Archetype Reference
When creating hooks, determine which agent archetypes will be governed by the new hook. See .claude/docs/@HOOK_AGENT_MAP.md for:
- Section 1: Full hook-agent matrix
- Section 2: Archetype hook sets (Router, Implementer, Reviewer, Documenter, Orchestrator, Researcher)
After creating a hook, you MUST add it to both the matrix AND update affected agents' ## Enforcement Hooks sections.
Claude Code Hook Types
| Hook Event | When Triggered | Use Case |
|---|---|---|
PreToolUse |
Before tool executes | Validation, blocking, permission checks |
PostToolUse |
After tool completes | Logging, cleanup, notifications |
UserPromptSubmit |
Before model sees message | Routing, intent analysis, filtering |
Workflow Steps
Step 0: Existence Check and Updater Delegation (MANDATORY - FIRST STEP)
BEFORE creating any hook file, check if it already exists:
Check if hook already exists:
test -f .claude/hooks/<category>/<hook-name>.cjs && echo "EXISTS" || echo "NEW"If hook EXISTS:
DO NOT proceed with creation
Invoke artifact-updater workflow instead:
Skill({ skill: 'artifact-updater', args: '--type hook --path .claude/hooks/<category>/<hook-name>.cjs --changes "<description of requested changes>"', });Return updater result and STOP
If hook is NEW:
- Continue with Step 0.5 below
Step 0.1: Smart Duplicate Detection (MANDATORY)
Before proceeding with creation, run the 3-layer duplicate check:
const { checkDuplicate } = require('.claude/lib/creation/duplicate-detector.cjs');
const result = checkDuplicate({
artifactType: 'hook',
name: proposedName,
description: proposedDescription,
keywords: proposedKeywords || [],
});
Handle results:
EXACT_MATCH: Stop creation. Route tohook-updaterskill instead:Skill({ skill: 'hook-updater' })REGISTRY_MATCH: Warn user — artifact is registered but file may be missing. Investigate before creating. Ask user to confirm.SIMILAR_FOUND: Display candidates with scores. Ask user: "Similar artifact(s) exist. Continue with new creation or update existing?"NO_MATCH: Proceed to Step 0.5 (companion check).
Override: If user explicitly passes --force, skip this check entirely.
Step 0.5: Companion Check
Before proceeding with creation, run the ecosystem companion check:
- Use
companion-check.cjsfrom.claude/lib/creators/companion-check.cjs - Call
checkCompanions("hook", "{hook-name}")to identify companion artifacts - Review the companion checklist — note which required/recommended companions are missing
- Plan to create or verify missing companions after this artifact is complete
- Include companion findings in post-creation integration notes
This step is informational (does not block creation) but ensures the full artifact ecosystem is considered.
Reference Hook
Use .claude/lib/routing/routing-table.cjs as the canonical routing reference.
Before finalizing any hook, compare against routing-table structure:
- H
Установить hook-creator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGlobGrepВложенные файлы
FAQ
Что делает скилл hook-creator?
Creates and registers hooks for the Claude Code framework. Handles pre/post tool execution, validation, memory, and session hooks. Use when new validation, safety, or automation hooks are needed.
Как установить скилл hook-creator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл hook-creator запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This 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…
от Anthropic