Skip to content
cccskills
FreePublished on GitHub

creating-hooks

Creates GitHub Copilot hooks for VS Code using `hooks.json`, supporting scripts, and companion docs. Use when automating deterministic checks, pre/post tool policies, or reusable hook packs that need safe defaults, observability, and clear installation guidance.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118 stars(GitHub 118 + cccskills 0)
Works withGitHub

Run score Not tested

See how to install

Files included (4)

  • SKILL.md4.5 KB
  • resources/hook-example-pack.md2.8 KB
  • resources/hook-quality-checklist.md1.3 KB
  • resources/hook-template-pack.md2.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Creating Copilot Hooks

Use this skill when the right answer is not more advice, but deterministic behavior at a specific lifecycle point. It helps design hooks that are safe, documented, and understandable.

When to Use

Use this skill when the user asks for things like:

  • "create a Copilot hook for this policy"
  • "block dangerous commands before they run"
  • "log or validate tool usage automatically"
  • "add a reusable hook pack with docs and scripts"
  • "turn this manual guardrail into a hook"

Typical scenarios:

  • pre-tool checks for risky shell commands
  • post-tool validation or formatting triggers
  • audit or observability hooks for shared environments
  • installing a documented hook bundle for reuse across workspaces

Outcome Standard

A strong hook contribution usually includes:

  • the right lifecycle event and the smallest useful behavior
  • explicit safety defaults and clear denial or warning messages
  • a documented hooks.json configuration
  • cross-platform script guidance when Windows and Bash users both matter
  • a README or pack that explains purpose, setup, and limitations

Hook Design Rules

  • Start with observe or warn - block only when the policy is stable and the failure message is clear.
  • Keep hooks fast - long-running hooks become friction generators instead of safeguards.
  • Be explicit on denial - if a hook blocks work, explain exactly why and what to do instead.
  • Separate policy from docs - the script enforces behavior; the README explains it.
  • Prefer deterministic checks - hooks should not depend on fuzzy interpretation when avoidable.

Workflow

Phase 0: Decide whether a hook is the right primitive

Use a hook when deterministic automation is needed at a lifecycle event. If the need is guidance only, use instructions. If the need is a reusable workflow, use a skill. If the need is a user-started task, use a prompt.

Phase 1: Choose the lifecycle event

Clarify or infer:

  • what event should trigger the hook
  • whether the behavior is observe, warn, mutate, or deny
  • how quickly the hook must complete
  • whether it needs cross-platform script support

Phase 2: Design the safety model

Before scripting:

  • define the exact condition being checked
  • decide what the hook should output on allow, warn, or deny
  • write the denial or warning message in user language, not policy jargon
  • make sure the hook fails safely when inputs are missing or malformed

Phase 3: Create the hook pack

Use the resources below as the default starting point:

  • ./resources/hook-template-pack.md
  • ./resources/hook-example-pack.md

A complete pack should usually include:

  • hooks.json
  • one or more supporting scripts
  • a README with purpose, setup, and behavior notes

Phase 4: Validate the operational fit

Check the result against ./resources/hook-quality-checklist.md.

Pay special attention to:

  • whether the hook is fast enough for the event it runs on
  • whether the messages are actionable
  • whether Windows and non-Windows paths are addressed when required
  • whether the hook blocks only what it truly means to block

Common Failure Modes

  • using a hook when a normal instruction would have been enough
  • blocking large classes of commands without a helpful reason
  • writing scripts that are too slow for frequent lifecycle events
  • shipping hooks.json without installation or behavior documentation
  • creating platform-specific hooks with no fallback or adaptation guidance

Resource Map

  • ./resources/hook-template-pack.md - template pack with README, config, and script scaffolds
  • ./resources/hook-example-pack.md - worked example of a safe, documented policy hook
  • ./resources/hook-quality-checklist.md - final review checklist before shipping

Definition of Done

A task using this skill is complete when:

  • the hook behavior matches a clear lifecycle need
  • the configuration, scripts, and documentation agree with each other
  • failure, allow, and deny messages are understandable
  • the pack is install-ready or clearly adapted for the target environment
  • the final result passes the quality checklist without obvious operational risk

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Defines, computes, and interprets test and quality metrics: pass rate, flake rate, suite duration, defect escape rate, time to detect, and coverage with its caveats. Use when building a QA dashboard, reporting suite health to stakeholders, comparing releases over time, or when a coverage percentage or a bug count is being treated as a measure of quality.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Analyzes diffs, changed files, hotfixes, and release candidates to identify where regression risk spreads and what must be retested first. Use when scoping retest after a change, reviewing QA impact for a pull request, or building a minimal confidence suite for release validation.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Writes and reviews API automation tests with Playwright Test, covering setup/teardown, assertions, data management, and hybrid API+UI flows. Use when creating backend API tests, contract checks, data-driven API coverage, API+UI hybrid workflows, or reviewing existing Playwright API suites.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Measures the risk that code shipped without anyone understanding it: a teach-back attestation on high-risk changes, a risk band from changed-code complexity, diff size and whether a human explanation accompanied it, and optional AI-authorship provenance. Findings stay advisory by design. Use when an AI-assisted codebase grows faster than the team reads it, when reviews are rubber-stamped, when nobody can explain a module that ships weekly, or when leadership asks how much of the code the team can actually maintain.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Produces an evidence-backed go/no-go recommendation: exit criteria status, open-defect risk profile, coverage against risk, environment parity, rollback readiness, and the residual risk stated plainly. Use when preparing a release sign-off, when someone asks whether a build is ready to ship, or when a decision to release is being made on impressions rather than evidence.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Records human verification - code review, exploratory sessions, UAT, accessibility passes, UX and observability reviews - as dated, attributed attestations in a register, so human-centric practices stay in the quality contract without pretending to be automated checks. Use when a strategy requires verification no tool can prove, when sign-off evidence is scattered across chats and tickets, when a gap matrix needs to distinguish "attested" from "passed", or when an audit asks who verified what and when.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

See all skills by jaktestowac

Report a problem with this skill