Agent skill

create-hook

Create a hook (.json) to enforce policy or automate agent lifecycle events.

Stars 183,714
Forks 39,125

Install this agent skill to your Project

npx add-skill https://github.com/microsoft/vscode/tree/main/extensions/copilot/assets/prompts/skills/create-hook

SKILL.md

Related skill: agent-customization. Load and follow hooks.md for template and principles.

Guide the user to create a hook in .github/hooks/.

Extract from Conversation

First, review the conversation history. If the user has been expressing concerns about agent behavior (e.g., "don't run this command", "always check before doing X", "inject this context"), generalize that into a hook. Extract:

  • Actions that should be blocked or gated
  • Context that should be injected at certain points
  • Automation needs at session start/end or tool use

Clarify if Needed

If no clear policy need emerges from the conversation, clarify:

  • What event should trigger this hook? (e.g. PreToolUse, SessionStart, Stop)
  • Should it block, warn, or inject context?
  • Does it need a companion script?

Iterate

  1. Draft the hook JSON (and any scripts) and save them.
  2. Identify the most ambiguous or weak parts and ask about those.
  3. Once finalized, summarize what the hook enforces, suggest ways to test it, and propose related customizations to create next.

Remember to follow the agent-customization guidelines to create highly effective hooks.

Expand your agent's capabilities with these related and highly-rated skills.

microsoft/vscode

component-fixtures

Use when creating or updating component fixtures for screenshot testing, or when designing UI components to be fixture-friendly. Covers fixture file structure, theming, service setup, CSS scoping, async rendering, and common pitfalls.

183,714 39,125
Explore
microsoft/vscode

memory-leak-audit

Audit code for memory leaks and disposable issues. Use when reviewing event listeners, DOM handlers, lifecycle callbacks, or fixing leak reports. Covers addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose patterns.

183,714 39,125
Explore
microsoft/vscode

fix-ci-failures

Investigate and fix CI failures on a pull request. Use when CI checks fail on a PR branch — covers finding the PR, identifying failed checks, downloading logs and artifacts, extracting the failure cause, and iterating on a fix. Requires the `gh` CLI.

183,714 39,125
Explore
microsoft/vscode

azure-pipelines

Use when validating Azure DevOps pipeline changes for the VS Code build. Covers queueing builds, checking build status, viewing logs, and iterating on pipeline YAML changes without waiting for full CI runs.

183,714 39,125
Explore
microsoft/vscode

add-policy

Use when adding, modifying, or reviewing VS Code configuration policies. Covers the full policy lifecycle from registration to export to platform-specific artifacts. Run on ANY change that adds a `policy:` field to a configuration property.

183,714 39,125
Explore
microsoft/vscode

chat-customizations-editor

Use when working on the Chat Customizations editor — the management UI for agents, skills, instructions, hooks, prompts, MCP servers, and plugins.

183,714 39,125
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results