用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/microsoft/amplifier-module-tool-skills --skill skill-with-hooks命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | skill-with-hooks |
| description | Example skill demonstrating embedded hooks for validation and logging |
| version | 1.0.0 |
| license | MIT |
| hooks | {"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"./hooks/validate-bash.sh","timeout":10}]},{"matcher":".*","hooks":[{"type":"command","command":"./hooks/log-tool-use.sh","timeout":5}]}],"PostToolUse":[{"matcher":".*","hooks":[{"type":"command","command":"./hooks/log-tool-result.sh","timeout":5}]}]} |
This is an example skill that demonstrates how to embed Claude Code-compatible hooks directly in a skill's frontmatter.
When this skill is loaded, its hooks become active for the session:
The hooks reference scripts in the ./hooks/ directory relative to this skill:
validate-bash.sh - Checks bash commands for dangerous patternslog-tool-use.sh - Logs tool name and parameterslog-tool-result.sh - Logs tool execution resultsLoad this skill to activate its hooks:
load_skill(skill_name="skill-with-hooks")
The hooks will remain active until the session ends.
This skill is used to validate the skill-scoped hooks integration between
amplifier-module-tool-skills and amplifier-module-hooks-shell.