af-engineer-hook

Design and implement Cursor hooks to intercept agent actions.

3|Updated Oct 5, 2025
One-click install
npx skills add https://github.com/korchasa/ide-rules --skill af-engineer-hook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: af-engineer-hook
Source: https://github.com/korchasa/ide-rules/tree/main/catalog/skills/af-engineer-hook
Command: npx skills add https://github.com/korchasa/ide-rules --skill af-engineer-hook

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

The af-engineer-hook skill helps teams design and implement Cursor hooks to intercept agent actions, apply rules, and enforce security and automation policies across workflows. It enables you to create new hooks, configure hooks.json, and implement blocking or modification logic via scripts.

Core Features & Use Cases

  • Define events (beforeShellExecution, afterFileEdit, etc.) and implement policy logic with either command-based scripts or prompt-based instructions.
  • Configure hooks.json to apply rules globally or per-project; store hook scripts under .cursor/hooks to enforce governance and auditability.
  • Use cases include blocking dangerous commands, filtering sensitive actions, and enforcing organizational standards during automation.

Quick Start

Create a new hook for formatting or security, configure .cursor/hooks.json, and implement the hook script under .cursor/hooks/.

Frequently Asked Questions about af-engineer-hook

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

FAQPage Schema
How do I intercept and block dangerous shell commands executed by Cursor agents?

To set up Cursor hooks, configure .cursor/hooks.json to define events globally or per-project, and implement hook scripts under .cursor/hooks/. You define events like beforeShellExecution and write policy logic using command-based scripts or prompt-based instructions to control agent actions.

What events can I intercept to enforce security and auditing in Cursor workflows?

You can intercept events like beforeShellExecution and afterFileEdit to enforce security and auditing in Cursor workflows. These hooks allow you to apply rules, filter sensitive actions, and enforce organizational standards by implementing blocking or modification logic via scripts.

Can I apply hook configuration globally or does it require a per-project setup?

Cursor hooks support both global and per-project configuration. You define rules in .cursor/hooks.json and store hook scripts under .cursor/hooks/, allowing you to tailor events, data formats, and output handling to enforce governance and auditability across your automation workflows.

Does implementing Cursor hooks require scripting knowledge or can I use prompts?

Implementing Cursor hooks supports both command-based scripts and prompt-based logic, so scripting knowledge is not strictly required. You can choose to write executable scripts for complex blocking logic or use prompt-based instructions to control agent actions within your workflows.

What is the best way to audit file access and modifications during Cursor automation?

The best way to audit file access during Cursor automation is by implementing hooks for events like afterFileEdit. You configure .cursor/hooks.json and use scripts to intercept, log, and filter sensitive file modifications, enforcing governance and auditability across your workflows.

Why do I need a hooks.json configuration file for Cursor automation policies?

The hooks.json configuration file is required to define events, apply rules globally or per-project, and specify how hook scripts intercept agent actions. It provides the central configuration needed to enforce security, auditing, and customization policies within Cursor automation workflows.