# 安装 hook-development

- 类型: 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 (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.
- 仓库: https://github.com/anthropics/claude-plugins-official

## 方式一 · 一键代装（复制提示词让 AI 代劳）

### Claude Code
```
请帮我安装 askskill 上的 "hook-development" 技能：
1. 下载 https://raw.githubusercontent.com/anthropics/claude-plugins-official/main/plugins/plugin-dev/skills/hook-development/SKILL.md
2. 保存为 ~/.claude/skills/hook-development/SKILL.md
3. 装好后重载技能，告诉我可以用了
```

### Codex
```
请帮我安装 askskill 上的 "hook-development" 技能：
1. 下载 https://raw.githubusercontent.com/anthropics/claude-plugins-official/main/plugins/plugin-dev/skills/hook-development/SKILL.md
2. 保存为 ~/.codex/skills/hook-development/SKILL.md
3. 装好后重载技能，告诉我可以用了
```

### Cursor
```
请帮我安装 askskill 上的 "hook-development" 技能：
1. 下载 https://raw.githubusercontent.com/anthropics/claude-plugins-official/main/plugins/plugin-dev/skills/hook-development/SKILL.md
2. 保存为 ~/.cursor/skills/hook-development/SKILL.md
3. 装好后重载技能，告诉我可以用了
```

## 方式二 · 命令行安装（原生命令与配置）

### Claude Code
```bash
mkdir -p '~/.claude/skills/hook-development' && curl -fsSL 'https://raw.githubusercontent.com/anthropics/claude-plugins-official/main/plugins/plugin-dev/skills/hook-development/SKILL.md' -o '~/.claude/skills/hook-development/SKILL.md'
```

### Codex
```bash
mkdir -p '~/.codex/skills/hook-development' && curl -fsSL 'https://raw.githubusercontent.com/anthropics/claude-plugins-official/main/plugins/plugin-dev/skills/hook-development/SKILL.md' -o '~/.codex/skills/hook-development/SKILL.md'
```

### Cursor
```bash
mkdir -p '~/.cursor/skills/hook-development' && curl -fsSL 'https://raw.githubusercontent.com/anthropics/claude-plugins-official/main/plugins/plugin-dev/skills/hook-development/SKILL.md' -o '~/.cursor/skills/hook-development/SKILL.md'
```
