本文へ移動
cccskills
無料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.

日本語の概要は準備中です。原文の説明を表示しています。

jaktestowac/awesome-copilot-for-testersスター 118(GitHub 118 + cccskills 0)
連携ツールGitHub

実行スコア 未検証

インストール方法を見る

含まれるファイル(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(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

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.

日本語の概要は準備中です。原文の説明を表示しています。

jaktestowac/awesome-copilot-for-testers1182026年8月27日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

jaktestowac/awesome-copilot-for-testers1182026年8月27日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

jaktestowac/awesome-copilot-for-testers1182026年8月27日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

jaktestowac/awesome-copilot-for-testers1182026年8月27日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

jaktestowac/awesome-copilot-for-testers1182026年8月27日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

jaktestowac/awesome-copilot-for-testers1182026年8月27日 更新

jaktestowac のスキルをすべて見る

このスキルの問題を報告する