Reusable skill for integrating CLI hooks across multiple AI coding tools. Safe, idempotent configuration merges with tool-specific templates.
| Tool | Config | Hooks Support |
|---|---|---|
| Claude Code | ~/.claude/settings.json |
β Full |
| Gemini CLI | ~/.gemini/settings.json |
β Full |
| Cursor | ~/.cursor/hooks.json |
β Full |
| OpenCode | ~/.config/opencode/plugins/*.js |
β Full |
| Gemini IDE | VS Code / JetBrains | β No hooks API |
Note: Gemini Code Assist (IDE plugin) does not have a hooks JSON API. Use Gemini CLI for automation.
Using skillshare
skillshare install github.com/runkids/ai-hooks-integration
skillshare syncUsing add-skill
npx skills add runkids/ai-hooks-integrationInstall to specific agents:
npx skills add runkids/ai-hooks-integration -a claude-code -a cursorClone to your skills directory:
git clone https://github.com/runkids/ai-hooks-integration.git \
~/.config/skillshare/skills/ai-hooks-integration- Python 3.9+
Install hooks for all tools:
scripts/install_all.py --command "/path/to/hook" --name my-hookRemove hooks:
scripts/remove_all.py --command "/path/to/hook" --plugin ~/.config/opencode/plugins/my-hook.jsAdd --dry-run to preview changes without writing.
skills/ai-hooks-integration/
βββ SKILL.md # Skill entry point
βββ scripts/
β βββ install_all.py # One-shot install
β βββ remove_all.py # One-shot removal
β βββ merge_hooks.py # Single-tool merge
β βββ remove_hooks.py # Single-tool removal
β βββ install_opencode_plugin.py # OpenCode plugin installer
β βββ remove_opencode_plugin.py # OpenCode plugin removal
βββ references/
βββ cli-hooks.md # Config paths & event lists
βββ use-cases.md # Hook patterns by use case
βββ hook-payload-examples.md # Stdin/stdout formats
βββ opencode-plugin-template.md # OpenCode plugin template
βββ claude-code-hook-skill.md # Claude Code specifics
βββ schemas/ # JSON Schema per tool
βββ contracts/ # I/O contracts (YAML)
- Cross-tool event mapping - PreToolUse β beforeShellExecution β tool.execute.before β BeforeTool
- Use case patterns - Security, auto-formatting, testing, notifications, logging, CI/CD
- Safe JSON merge - Idempotent, preserves existing hooks
- Hook templates - Ready-to-use configs per tool
- Payload examples - Stdin/stdout formats with field reference
- OpenCode plugin template - ES module format with all hooks
MIT License