设置 Claude Code 钩子,在危险 Git 命令(push、reset --hard、clean、branch -D 等)执行前将其拦截。当用户想要防止破坏性 Git 操作、添加 Git 安全钩子或在 Claude Code 中阻止 git push/reset 时使用。
$npx -y skills add devcxl/mattpocock-skills-zh --skill git-guardrails-claude-codeInstalls into the current project.
Run `npx skills use "https://github.com/devcxl/mattpocock-skills-zh" --skill "devcxl/mattpocock-skills-zh/git-guardrails-claude-code"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/devcxl/mattpocock-skills-zh" that are relevant to the current task. Run `npx skills add "https://github.com/devcxl/mattpocock-skills-zh"` and select the relevant skills, then follow their instructions.