Skip to content

πŸͺ Skill for integrating CLI hooks across Claude Code, Gemini CLI, Cursor, and OpenCode

License

Notifications You must be signed in to change notification settings

runkids/ai-hooks-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Hooks Integration Skill

Reusable skill for integrating CLI hooks across multiple AI coding tools. Safe, idempotent configuration merges with tool-specific templates.

Supported Tools

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.

Installation

skillshare install github.com/runkids/ai-hooks-integration
skillshare sync

Using add-skill

npx skills add runkids/ai-hooks-integration

Install to specific agents:

npx skills add runkids/ai-hooks-integration -a claude-code -a cursor

Manual

Clone to your skills directory:

git clone https://github.com/runkids/ai-hooks-integration.git \
  ~/.config/skillshare/skills/ai-hooks-integration

Requirements

  • Python 3.9+

Usage

Install hooks for all tools:

scripts/install_all.py --command "/path/to/hook" --name my-hook

Remove hooks:

scripts/remove_all.py --command "/path/to/hook" --plugin ~/.config/opencode/plugins/my-hook.js

Add --dry-run to preview changes without writing.

Structure

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)

What It Provides

  • 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

License

MIT License

About

πŸͺ Skill for integrating CLI hooks across Claude Code, Gemini CLI, Cursor, and OpenCode

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages