create-hook

作成者: microsoft

ポリシーを適用したり、エージェントのライフサイクルイベントを自動化するためのフック(.json)を作成します。

npx skills add https://github.com/microsoft/vscode --skill create-hook

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?

Path Conventions

  • Hook commands and companion scripts run with cwd defaulting to the workspace root (when a workspace folder is available); otherwise cwd falls back to the user home directory. Relative paths resolve from cwd. Absolute paths are fine when intentional — just be deliberate about which you use.
  • Do not use environment variables for pathing. The only exception is plugin-provided environment variables in hooks shipped as part of an agent plugin; never use environment variables for pathing outside of a plugin context.

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.

microsoftのその他のスキル

oss-growth
microsoft
OSS成長ハッカーのペルソナ
official
accessibility-aria-expert
microsoft
React/Fluent UIのWebビューにおけるアクセシビリティ問題を検出・修正します。スクリーンリーダー互換性のコードレビュー時、ARIAラベルの修正時、および…の確認時に使用します。
official
generate-canvas-app
microsoft
[DEPRECATED — 代わりに canvas-app を使用してください] 完全なPower Appsキャンバスアプリを生成します。
official
django
microsoft
Djangoウェブ開発のベストプラクティス(モデル、ビュー、テンプレート、テストを含む)
official
github-issue-creator
microsoft
生のメモ、エラーログ、音声入力、スクリーンショットを、簡潔なGitHub Flavored MarkdownのIssueレポートに変換します。ユーザーがバグ情報やエラーを貼り付けた際に使用します。
official
python-package-management
microsoft
依存関係管理にuvを使用し、タスク自動化にpoethepoetを使用します。
official
runtime-validation
microsoft
移行アプリケーションのランタイム検証 — テスト戦略(計画フェーズ)とテスト実行(検証フェーズ)をカバー:起動検証、…
official
azure-postgres-ts
microsoft
pg(node-postgres)パッケージを使用してAzure Database for PostgreSQL Flexible Serverに接続し、パスワード認証とMicrosoft Entra ID(パスワードレス)認証をサポートします。
official