claude-opus-4-5-migrat…
Migrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5. Use when the user wants to update their codebase, prompts, or API calls…
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 LING71671/Open-ClaudeCode --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
完整开源的 Claude Code 项目 - 基于 Anthropic 官方源码重建 🌐 Languages: 中文 | English
Repo: LING71671/Open-ClaudeCode
Migrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5. Use when the user wants to update their codebase, prompts, or API calls…
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or…
Security audit workflow for OPC code, providers, plugins, Electron surfaces, local HTTP bridges, filesystem access, and command execution.
Update or audit OPC documentation after code changes. Use when behavior, setup, CLI flags, desktop workflow, provider support, or plugin surfaces changed.
Systematic root-cause debugging for OPC work. Use when there is a bug, crash, regression, failing command, flaky behavior, provider issue, or unexplained…
Read-only QA report for an OPC desktop flow, CLI command, local URL, staging URL, or documented user journey. Does not modify code.