block-no-verify-hook

仓库创建 2025年7月25日最近提交 5 天前SkillHot 收录 21 天前
▸ 精选理由

增强代理执行时的提交质量与签名保护,防止自动化跳过校验。

这个 Skill 做什么

配置 PreToolUse 钩子阻止使用 --no-verify 等绕过提交检查的标志。

在 PreToolUse 阶段拦截并阻止像 --no-verify 这样的绕过标志,确保 AI agent 无法跳过 pre-commit hooks、GPG 签名或其他提交检查。适合在用 Claude Code 等自动化工具并强制提交质量门时部署,避免自动化破坏质量流程。特点是把绕过手段在工具执行前技术性阻断,把代码质量规则从政策变成可执行的防护。

▸ 展开 SKILL.md 英文原文

Configure a PreToolUse hook to prevent AI agents from skipping git pre-commit hooks with --no-verify and other bypass flags. Use when setting up Claude Code projects that enforce commit quality gates.

开发编程提交钩子安全防绕过PreToolUsegitClaude CodeCodex
3.8w
Stars
4.1k
Forks
40
仓库内 Skill
+713
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/wshobson/agents/main/plugins/block-no-verify/skills/block-no-verify-hook/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/wshobson/agents/main/plugins/block-no-verify/skills/block-no-verify-hook/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Block No-Verify Hook

PreToolUse hook configuration that intercepts and blocks bypass-flag usage before execution, ensuring AI agents cannot skip pre-commit hooks, GPG signing, or other git safety mechanisms.

## Overview

AI coding agents (Claude Code, Codex, etc.) can run shell commands with flags like `--no-verify` that bypass pre-commit hooks. This defeats the purpose of linting, formatting, testing, and security checks configured in pre-commit hooks. The block-no-verify hook adds a PreToolUse guard that rejects any tool call containing bypass flags before execution.

## Problem

When AI agents commit code, they may use bypass flags to avoid hook failures:

```bash
# These commands ski
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有