hook-creator

Generate Copilot CLI preToolUse and postToolUse hooks with templates.

1|1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/magicpro97/copilot-session-knowledge --skill hook-creator-magicpro97
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hook-creator
Source: https://github.com/magicpro97/copilot-session-knowledge/tree/main/skills/hook-creator
Command: npx skills add https://github.com/magicpro97/copilot-session-knowledge --skill hook-creator-magicpro97

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Hook creation for Copilot CLI projects simplifies setting up project-wide guardrails by generating preToolUse and postToolUse scripts tailored to your tech stack and workflow.

Core Features & Use Cases

  • Generate a unified hook runner and a library of rule templates stored under references/ for cross-project reuse.
  • Customize templates per language and framework, map hooks to project workflows, and register them via hooks.json.
  • Automate safety rails during AI-assisted coding sessions to block dangerous actions, enforce coding standards, protect secrets, and gate commits.

Quick Start

Install or copy the templates from this skill into your repository, customize references/templates as needed, and register hooks with your project's hooks.json to begin using preToolUse and postToolUse guards.

Frequently Asked Questions about hook-creator

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

FAQPage Schema
How do I set up preToolUse and postToolUse guardrails for Copilot CLI?▼

To set up Copilot CLI guardrails, you generate preToolUse and postToolUse hook scripts tailored to your tech stack and register them via a hooks.json file. This automates safety rails to block dangerous actions during AI-assisted coding sessions.

What are preToolUse and postToolUse hooks in automated coding guardrails?▼

PreToolUse and postToolUse hooks are automated scripts that enforce code-quality guardrails before and after tool execution. They block dangerous actions, enforce coding standards, protect secrets, and gate commits during AI-assisted coding workflows.

Can I customize code-quality hook templates for different languages and frameworks?▼

Yes, you can customize hook templates per language and framework. The skill generates a library of rule templates stored under references/ that can be adapted to your specific tech stack and mapped to your project workflows.

How do I register generated hook scripts in my project's workflow?▼

You register generated hook scripts by configuring a hooks.json file in your repository. This ready-to-register workflow file maps the preToolUse and postToolUse guards directly into your project's automated safety rails.

When do I need to generate project hooks for safety rails?▼

You need to generate project hooks during start-up projects, new codebase creation, or onboarding. It is specifically required when setting up safety rails to protect secrets and gate commits in AI-assisted coding environments.

Do I need external dependencies to generate Copilot CLI hooks?▼

No external dependencies are required. The hook generation process is entirely self-contained, utilizing templates and references stored within the skill to produce a unified hook runner and cross-project reusable rules.