Reusable skill for integrating CLI hooks across multiple AI coding tools. Safe, idempotent configuration merges with tool-specific templates.
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
