create-hook

Creates JSON hook files that enforce policies or automate agent lifecycle events.

Updated Aug 20, 2026
One-click install
npx skills add https://github.com/basedgod55hjl/vsbrax --skill create-hook-basedgod55hjl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: create-hook
Source: https://github.com/basedgod55hjl/vsbrax/tree/main/extensions/copilot/assets/prompts/skills/create-hook
Command: npx skills add https://github.com/basedgod55hjl/vsbrax --skill create-hook-basedgod55hjl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams need a reliable way to enforce behavioral policies on AI coding agents—blocking risky commands, injecting context at the right moment, or automating session lifecycle actions—without manually editing configuration files from scratch. ## Core Features & Use Cases - Conversation-Driven Extraction: Reviews the conversation history to generalize user concerns (e.g., "don't run this command") into enforceable hook policies. - Guided Hook Authoring: Drafts hook JSON files in .github/hooks/ with companion scripts, following the agent-customization guidelines and hooks.md template. - Iterative Refinement: Identifies ambiguous parts of the draft, asks clarifying questions, and summarizes what the hook enforces with testing suggestions. - Use Case: A user repeatedly tells the agent not to run destructive git commands. This Skill converts that concern into a PreToolUse hook that blocks matching commands automatically. ## Quick Start Ask the agent to create a hook that blocks a specific command or injects context at session start, and it will draft the JSON file in .github/hooks/ for you.

Frequently Asked Questions about create-hook

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

FAQPage Schema
How do I create a hook to block agent commands?▼

Describe the behavior you want to block, and the Skill drafts a hook JSON file in .github/hooks/ targeting an event like PreToolUse. It generalizes your concern from the conversation and iterates with you until the policy is clear.

What events can trigger an agent hook?▼

Hooks can trigger on lifecycle events such as PreToolUse, SessionStart, and Stop. Depending on the event, a hook can block an action, warn the user, or inject additional context into the session.

Where are hook files stored in a project?▼

Hook JSON files are saved in the .github/hooks/ directory of the workspace. Companion scripts run with the working directory defaulting to the workspace root, or the user home directory if no workspace is open.

Can hooks use environment variables for file paths?▼

No, hooks should not use environment variables for pathing. The only exception is plugin-provided environment variables in hooks shipped as part of an agent plugin; use relative paths from the working directory or deliberate absolute paths instead.

When should I use a hook instead of instructions in a prompt?▼

Use a hook when a policy must be enforced deterministically, such as blocking a command or injecting context at a fixed lifecycle event. Prompt instructions are advisory, while hooks execute at defined trigger points regardless of model behavior.