create-hook

Generate and update Cursor hooks.json and hook scripts for project and user levels.

Updated Dec 17, 2024
One-click install
npx skills add https://github.com/LAF-US/IDAHO-VAULT --skill create-hook-laf-us
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hook
Source: https://github.com/LAF-US/IDAHO-VAULT/tree/main/.cursor/skills-cursor/create-hook
Command: npx skills add https://github.com/LAF-US/IDAHO-VAULT --skill create-hook-laf-us

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the setup and ongoing maintenance of Cursor hooks, eliminating manual handoffs and guesswork when wiring events to custom logic.

Core Features & Use Cases

  • Provides templates and guidance to create project-level hooks in .cursor/hooks and user-level hooks in ~/.cursor/hooks.
  • Supports both command hooks (scripts) and prompt hooks, with clear separation of events like preToolUse, postToolUse, and beforeShellExecution.
  • Enforces a minimal, standards-compliant hooks.json workflow and a straightforward path to register new hooks for automation.

Quick Start

Place a shell script under .cursor/hooks and register it in hooks.json to enable a project-level hook.

Frequently Asked Questions about create-hook

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

FAQPage Schema
How do I automate Cursor agent events using hooks?

Cursor hooks automate agent events by mapping preToolUse, postToolUse, and beforeShellExecution events to custom logic in a minimal hooks.json file, eliminating manual setup and guesswork.

What is the difference between command hooks and prompt hooks in Cursor?

Command hooks execute shell scripts in response to Cursor events, while prompt hooks provide custom instructions to the agent, with both types registered in hooks.json for event-handling automation.

How do I set up project-level hooks in Cursor?

To set up project-level hooks in Cursor, place an executable shell script under .cursor/hooks and register it in a minimal hooks.json file to wire events like preToolUse or postToolUse to your script.

Can I configure user-level hooks that apply across all Cursor projects?

Yes, you can configure user-level hooks by placing scripts in ~/.cursor/hooks and updating the user-level hooks.json to apply event-handling automation across all your Cursor projects.

Why are my Cursor hook scripts not executing during agent events?

Cursor hook scripts may not execute if the files lack proper executability checks or if the events are not correctly registered in the minimal hooks.json configuration for preToolUse or postToolUse.