create-hook

Create JSON hooks that enforce policies or automate agent lifecycle events.

1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/voidful/Aixlarity --skill create-hook-voidful
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hook
Source: https://github.com/voidful/Aixlarity/tree/main/aixlarity-ide/extensions/copilot/assets/prompts/skills/create-hook
Command: npx skills add https://github.com/voidful/Aixlarity --skill create-hook-voidful

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI coding agents sometimes run commands or take actions you would rather block, gate, or augment with context. This Skill turns those concerns into concrete hook definitions stored in .github/hooks/ so policies are enforced automatically instead of repeated in every conversation. ## Core Features & Use Cases - Policy Extraction from Conversation: Reviews the current conversation for concerns like "don't run this command" or "always check before X" and generalizes them into a hook. - Lifecycle Event Automation: Creates hooks for events such as PreToolUse, SessionStart, or Stop that can block, warn, or inject context. - Iterative Refinement: Drafts the hook JSON and any companion scripts, asks about ambiguous parts, then summarizes what the hook enforces and how to test it. - Use Case: After telling an agent twice not to run destructive git commands, invoke this Skill to produce a PreToolUse hook in .github/hooks/ that blocks those commands permanently. ## Quick Start Ask the agent to create a hook that blocks force pushes to the main branch before any git command runs.

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 certain agent commands?

Describe the behavior you want blocked, and the Skill drafts a PreToolUse hook JSON saved to `.github/hooks/`. It generalizes your concern from the conversation and iterates with you until the enforcement rule is clear.

What events can an agent hook trigger on?

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 agent hook files stored?

Hooks are saved as JSON files in the `.github/hooks/` directory of your project. Companion scripts referenced by a hook can be saved alongside it when the policy needs executable logic.

Can a hook inject context instead of blocking an action?

Yes. Hooks can inject context at specific points such as session start or before tool use, rather than blocking. You choose whether the hook should block, warn, or inject context when defining it.

When should I use a hook instead of repeating instructions in chat?

Use a hook when a rule must apply consistently across sessions, such as gating destructive commands or injecting standing context. Chat instructions are forgotten; hooks enforce the policy automatically on every matching event.