用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/g-zenr/relay-api --skill setup-hooks命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | setup-hooks |
| description | Configure Claude Code hooks for automated validation on file edits and commits |
| disable-model-invocation | true |
Set up Claude Code hooks for the project.
Hooks enforce coding standards automatically — they run scripts at specific points in Claude's workflow. Unlike CLAUDE.md instructions (advisory), hooks are deterministic and guarantee the action happens.
Event: PostToolUse on Write and Edit tools
Purpose: Catch syntax errors immediately after writing/editing Python files
Command: Run the syntax validation command (see stack concepts in project config) — fails if syntax is broken
Event: PostToolUse on Write and Edit tools
Purpose: Enforce the future annotations pattern (see stack concepts) in source files under the source root
Command: Check if the file is under the source root, then verify the annotations pattern exists
Event: PostToolUse on Write and Edit tools
Purpose: Run tests after modifying source or test files to catch regressions immediately
Command: Run the test command (see project config)
Note: Only trigger on source code file edits, not README or config files
Write the hooks to .claude/settings.json using this structure:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "<shell command here>"
}
]
}
]
}
}
.claude/settings.json for project hooks (shared via git).claude/settings.local.json for personal hooks (gitignored)After setup, test by editing a file and confirming the hook runs.