Skip to content
Back to skills

Create Hook

ASecurity

创建事件钩子。识别运行环境后按钩子 schema 注册指定行为。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 16, 2026
ai-agentsjavascriptpythonjavashellbashdocumentation

Works with

  • cursor

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 16, 2026

npx -y skills add 0mlkrizzz655335v/claude-skills-zh --skill create-hook --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Create Hook?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Create Hook
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/0mlkrizzz655335v-create-hook/badge)](https://www.skillsdirectory.com/skills/0mlkrizzz655335v-create-hook)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: create-hook
description: "创建事件钩子。识别运行环境后按钩子 schema 注册指定行为。"
---


# Create Hooks

Create or update the event hook the user requested. Resolve the target agent/editor and the hook schema it actually supports before writing configuration; a shared product name alone does not establish the config path, event names, or script working directory.

Inspect existing project/user hook configuration, the relevant runtime help or installed schema, and current official documentation as needed. The supplied [hooks reference](references/hooks-format.md) describes the `.cursor/hooks.json` runtime: read it only if that is the confirmed target. For another runtime, use its documented format rather than copying event names into a guessed path.

Infer scope, event, filtering, and behavior from the request. Ask only for an unresolved decision that materially affects the behavior. Preserve unrelated hooks and do not add network, approval, or denial policies the user did not request.

## Implementation and verification

- Choose the narrowest supported event and match only the intended actions.
- Use an interpreter available to the actual hook process. On Windows, use an explicit supported command such as PowerShell or Python when appropriate; do not assume Bash, shebang execution, or `chmod` semantics.
- Read and write only the event's documented JSON fields. Keep diagnostic output separate from protocol stdout and redact credentials.
- Make failure behavior match the requested purpose. An audit-only hook should not accidentally become an enforcement hook.
- Back up the existing configuration before changing it and validate syntax and script behavior with representative inputs.
- Verify the live hook is loaded and fires for the relevant event when the environment allows it. If only the file and script were checked, state that runtime acceptance remains unverified.

Keep matchers simple; test JavaScript-style regexes for the `.cursor` runtime rather than using POSIX character classes. Any end-to-end test must stay within the user-authorized side effects.

Files in this skill

  • SKILL.md2.1 KB
  • references/hooks-format.md6.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.