一键导入
create-hook
Create a hook (.json) to enforce policy or automate agent lifecycle events.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a hook (.json) to enforce policy or automate agent lifecycle events.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Agents window architecture — covers the agents-first app, layering, folder structure, chat widget, menus, contributions, entry points, and development guidelines. Use when implementing features or fixing issues in the Agents window.
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.
Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.
Use when running VS Code smoke tests or working on smoke-test CI steps. Covers npm run smoketest / smoketest-no-compile, grep filtering tests, and a temporary repeat-loop technique for tracking down flaky smoke tests in CI.
Use when working on the Chat Customizations editor — the management UI for agents, skills, instructions, hooks, prompts, MCP servers, and plugins.
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.
| name | create-hook |
| description | Create a hook (.json) to enforce policy or automate agent lifecycle events. |
| argument-hint | What should be enforced or automated? |
| disable-model-invocation | true |
Related skill: agent-customization. Load and follow hooks.md for template and principles.
Guide the user to create a hook in .github/hooks/.
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:
If no clear policy need emerges from the conversation, clarify:
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.Remember to follow the agent-customization guidelines to create highly effective hooks.