hooks-creator

Generate Bash or Node.js hooks for Gemini CLI lifecycle events.

4|Updated Dec 17, 2025
One-click install
npx skills add https://github.com/MatrixFounder/Agentic-development --skill hooks-creator-matrixfounder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hooks-creator
Source: https://github.com/MatrixFounder/Agentic-development/tree/main/.agent/skills/hooks-creator
Command: npx skills add https://github.com/MatrixFounder/Agentic-development --skill hooks-creator-matrixfounder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill allows users to create and configure custom hooks for the Gemini CLI, enabling fine-grained control over agent behavior, security, and workflow automation.

Core Features & Use Cases

  • Custom Scripting: Generate Bash or Node.js scripts to intercept and modify agent lifecycle events.
  • Security Enforcement: Implement hooks to block dangerous tools or scan for sensitive data.
  • Context Injection: Automatically add relevant information (like Git history) to agent prompts.
  • Use Case: You want to ensure no secrets are ever committed to a file. You can use this skill to generate a BeforeTool hook that scans file content for patterns like API keys before the write_file tool is executed.

Quick Start

Use the hooks-creator skill to generate a bash script that logs the tool name before every tool execution.

Frequently Asked Questions about hooks-creator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create custom hooks for Gemini CLI to automate agent behavior?

Custom Gemini CLI hooks are generated as Bash or Node.js scripts to intercept lifecycle events like BeforeTool and AfterModel. This enables fine-grained control over agent workflows and security automation through settings.json integration.

Can I use Gemini CLI hooks to block dangerous tools or scan for sensitive data?

Yes, Gemini CLI hooks can enforce security by blocking dangerous tools or scanning for sensitive data. A BeforeTool hook can intercept file writing operations to detect API keys before execution, preventing secrets from being committed.

What is the best way to inject context like Git history into Gemini CLI prompts automatically?

Automatically injecting context into Gemini CLI prompts is achieved by configuring custom hooks for lifecycle events. Scripts can intercept the agent workflow to append relevant information dynamically before the model processes the input.

Does generating custom hooks for Gemini CLI require strict JSON output and dependency checks?

Generating custom hooks for Gemini CLI strongly emphasizes security best practices, requiring strict JSON output and dependency checks. This ensures scripts execute reliably and safely without introducing vulnerabilities into the automation workflow.

How do I manage and configure lifecycle event hooks in Gemini CLI settings?

Lifecycle event hooks in Gemini CLI are managed by integrating custom scripts directly into the settings.json configuration file. This approach provides canonical references for detailed API specifications and ensures best practices for hook management.

When do I need to use Bash versus Node.js scripts for Gemini CLI hook customization?

Bash or Node.js scripts for Gemini CLI hook customization are needed when intercepting lifecycle events like SessionStart or AfterModel. The choice depends on your scripting environment and the complexity of the automation logic required.