agent-identifier
Use when creating or configuring Claude Code agents and their frontmatter.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events
$ npx -y skills add Galaxy-Dawn/claude-scholar --skill hook-development --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/hook-developmentContext preview
The summary Claude sees to decide when to auto-load this skill.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events
name: hook-development
description: This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
version: 0.1.0Hooks are event-driven automation scripts that execute in response to Claude Code events. Use hooks to validate operations, enforce policies, add context, and integrate external tools into workflows.
**Key capabilities:**
Use LLM-driven decision making for context-aware validation:
{
"type": "prompt",
"prompt": "Evaluate if this tool use is appropriate: $TOOL_INPUT",
"timeout": 30
}**Supported events:** Stop, SubagentStop, UserPromptSubmit, PreToolUse
**Benefits:**
Execute bash commands for deterministic checks:
{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh",
"timeout": 60
}**Use for:**
**For plugin hooks** in `hooks/hooks.json`, use wrapper format:
{
"description": "Brief explanation of hooks (optional)",
"hooks": {
"PreToolUse": [...],
"Stop": [...],
"SessionStart": [...]
}
}**Key points:**
**Example:**
{
"description": "Validation hooks for code quality",
"hooks": {
"PreToolUse": [
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/validate.sh"
}
]
}
]
}
}**For user settings** in `.claude/settings.json`, use direct format:
{
"PreToolUse": [...],
"Stop": [...],
"SessionStart": [...]
}**Key points:**
**Important:** The examples below show the hook event structure that goes inside either format. For plugin hooks.json, wrap these in `{"hooks": {...}}`.
Execute before any tool runs. Use to approve, deny, or modify tool calls.
**Example (prompt-based):**
{
"PreToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "prompt",
"prompt": "Validate file write safety. Check: system paths, credentials, path traversal, sensitive content. Return 'approve' or 'deny'."
}
]
}
]
}**Output for PreToolUse:**
{
"hookSpecificOutput": {
"permissionDecision": "allow|deny|ask",
"updatedInput": {"field": "modified_value"}
},
"systemMessage": "Explanation for Claude"
}Execute after tool completes. Use to react to results, provide feedback, or log.
**Example:**
{
"PostToolUse": [
{
"matcher": "Edit",
"hooks": [
{
"type": "prompt",
"prompt": "Analyze edit result for potential issues: syntax errors, security vulnerabilities, breaking changes. Provide feedback."
}
]
}
]
}**Output behavior:**
Execute when main agent considers stopping. Use to validate completeness.
**Example:**
{
"Stop": [
{
"matcher": "*",
"hooks": [
{
"type": "prompt",
"prompt": "Verify task completion: tests run, build succeeded, questions answered. Return 'approve' to stop or 'block' with reason to continue."
}
]
}
]
}**Decision output:**
{
"decision": "approve|block",
"reason": "Explanation",
"systemMessage": "Additional context"
}Execute when subagent considers stopping. Use to ensure subagent completed its task.
Similar to Stop hook, but for subagents.
Execute when user submits a prompt. Use to add context, validate, or block prompts.
**Example:**
{
"UserPromptSubmit": [
{
"matcher": "*",
"hooks": [
{
"type": "prompt",
"prompt": "Check if prompt requires security guidance. If discussing auth, permissions, or API security, return relevant warnings."
}
]
}
]
}Execute when Claude Code session begins. Use to load context and set environment.
**Example:**
{
"SessionStart": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/load-context.sh"
}
]
}
]
}**Special capability:** Persist environment variables using `$CLAUDE_ENV_FILE`:
echo "export PROJECT_TYPE=nodejs" >> "$CLAUDE_ENV_FILE"
See `examples/load-context.sh` for complete example.
Execute when session ends. Use for clean
Semi-automated research assistant for academic research and software development. Supports Claude Code, Codex CLI, Kimi Code CLI, and OpenCode across ideation, coding, experiments, writing, and publication.
Repo: Galaxy-Dawn/claude-scholar
Use when creating or configuring Claude Code agents and their frontmatter.
Use only when creating new registrable ML components that require Factory or Registry patterns.
This skill should be used when the user asks to "debug this", "fix this error", "investigate this bug", "troubleshoot this issue", "find the problem",…
This skill provides reference guidance for citation verification in academic writing. Use when the user asks about "citation verification best practices", "how…
This skill should be used when the user asks to review a diff or pull request, write review comments, audit code quality, establish review standards, or…
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command…