create-hook

Define and deploy Cursor hooks to customize agent-event behavior and automation via hooks.json and scripts.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/fredericpoitevin/.cursor --skill create-hook-fredericpoitevin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hook
Source: https://github.com/fredericpoitevin/.cursor/tree/main/skills-cursor/create-hook
Command: npx skills add https://github.com/fredericpoitevin/.cursor --skill create-hook-fredericpoitevin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create Cursor hooks to customize behavior around agent events, enabling proactive control, auditing, and automation.

Core Features & Use Cases

  • Project- and user-level hooks: define hooks by creating .cursor/hooks.json and adding scripts that run before or after agent events.
  • Hook types and routing: choose between command hooks (scripts) and prompt hooks to enforce policy or modify context.
  • Guided setup: align hook location, events, and safety considerations to build deterministic workflows.

Quick Start

Define project or user hooks by creating the appropriate hooks.json in the project root or home directory and adding a sample hook script.

Frequently Asked Questions about create-hook

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

FAQPage Schema
How do I create Cursor hooks to automate agent events?

Cursor hooks are configurations defined in a .cursor/hooks.json file that customize agent-event behavior through command or prompt hooks. They enable proactive control, auditing, and automation by running scripts before or after specific agent events.

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

Project-level hooks are set up by creating a .cursor/hooks.json file in the project root, while user-level hooks use the same file in the home directory. Both allow you to define triggering events, select hook types, and add scripts to enforce deterministic workflows.

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

Command hooks in Cursor execute scripts to perform automation tasks, whereas prompt hooks are used to enforce policies or modify the agent's context. The setup process involves selecting the appropriate hook type based on whether you need script execution or context modification.

Can I use Cursor hooks to enforce policy or modify agent context?

Yes, you can use Cursor prompt hooks specifically to enforce policies or modify the agent's context during events. This allows you to proactively control agent behavior and ensure deterministic workflows without relying solely on manual intervention.

What do I need to configure before deploying Cursor hooks for automation?

Before deploying Cursor hooks, you need to determine the hook scope (project or user level), identify the triggering agent events, and select the hook type. This structured workflow ensures the resulting hooks.json and any optional scripts are safely and correctly configured.