creating-hooks

Creates GitHub Copilot hooks with hooks.json configuration, cross-platform scripts, and documentation.

113|17|Updated Oct 5, 2025
One-click install
npx skills add https://github.com/jaktestowac/awesome-copilot-for-testers --skill creating-hooks-jaktestowac
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: creating-hooks
Source: https://github.com/jaktestowac/awesome-copilot-for-testers/tree/main/plugins/creating-hooks/skills/creating-hooks
Command: npx skills add https://github.com/jaktestowac/awesome-copilot-for-testers --skill creating-hooks-jaktestowac

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams need deterministic guardrails at specific GitHub Copilot lifecycle events, but writing safe, documented hooks with correct hooks.json configuration and cross-platform scripts is error-prone and often skipped. ## Core Features & Use Cases - Hook Pack Generation: Produces a complete hook pack containing hooks.json, Bash and PowerShell scripts, and a README with installation and behavior notes. - Safety-First Design Guidance: Enforces observe-or-warn-first defaults, fast execution, fail-safe input handling, and clear denial messages. - Quality Validation: Ships a checklist covering lifecycle fit, operational speed, cross-platform support, and pack completeness. - Use Case: A team wants to block destructive shell commands like rm -rf before Copilot executes them; this Skill generates a preToolUse deny hook with scripts for both Bash and PowerShell plus setup documentation. ## Quick Start Ask the assistant to create a Copilot hook that blocks destructive shell commands before tool execution, including the hooks.json config, scripts, and README.

Frequently Asked Questions about creating-hooks

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

FAQPage Schema
How do I create a GitHub Copilot hook in VS Code?▼

Define a hooks.json file that binds a lifecycle event like preToolUse to a command script, then place the pack under .github/hooks/. The script reads the hook payload from stdin and returns a JSON permissionDecision such as deny with a reason.

How do I block dangerous shell commands with a Copilot hook?▼

Use a preToolUse hook whose script pattern-matches the toolArgs command against destructive patterns like rm -rf or git reset --hard. On a match, return permissionDecision deny with a clear, user-readable reason explaining what to do instead.

Do Copilot hooks work on both Windows and Linux?▼

Yes, hooks.json supports separate command entries: a Bash script via the command field and a PowerShell script via the windows field. Both scripts should implement the same policy so behavior is consistent across platforms.

When should I use a hook instead of custom instructions?▼

Use a hook when you need deterministic enforcement at a specific lifecycle event, such as blocking a command before it runs. Use instructions for guidance-only behavior, a skill for reusable workflows, and a prompt for user-started tasks.

Why is my Copilot hook slowing down the workflow?▼

Hooks run on lifecycle events, so long-running scripts create friction on every trigger. Keep scripts short and deterministic, set a tight timeoutSec such as 10 seconds, and start with observe or warn modes before enabling hard blocks.