npx skills add ...
npx skills add microsoft/vscode --skill create-hook
npx skills add microsoft/vscode --skill create-hook
Create a hook (.json) to enforce policy or automate agent lifecycle events.
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.