[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EXCQ62KCKV6PV1JDRXKJ6E":3,"skill-same:01M7EXCQ62KCKV6PV1JDRXKJ6E":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7EXCQ62KCKV6PV1JDRXKJ6E","block-no-verify-hook",null,"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.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fblock-no-verify-hook\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: block-no-verify-hook\ndescription: 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.\n---\n\n# Block No-Verify Hook\n\nPreToolUse 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.\n\n## Overview\n\nAI 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.\n\n## Problem\n\nWhen AI agents commit code, they may use bypass flags to avoid hook failures:\n\n```bash\n# These commands skip pre-commit hooks entirely\ngit commit --no-verify -m \"quick fix\"\ngit push --no-verify\ngit commit --no-gpg-sign -m \"unsigned commit\"\ngit merge --no-verify feature-branch\n```\n\nThis allows:\n- Unformatted code to enter the repository\n- Linting errors to bypass checks\n- Security scanning to be skipped\n- Unsigned commits to bypass signing policies\n- Test suites to be circumvented\n\n## Solution\n\nAdd a `PreToolUse` hook to `.claude\u002Fsettings.json` that inspects every Bash tool call and blocks commands containing bypass flags.\n\n### Configuration\n\nAdd the following to your project's `.claude\u002Fsettings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign)'; then echo 'BLOCKED: --no-verify and --no-gpg-sign flags are not allowed. Run the commit without bypass flags so that pre-commit hooks execute properly.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\n```\n\n### How It Works\n\n1. **Matcher**: The hook targets only `Bash` tool calls, so it does not interfere with other tools (Read, Edit, Grep, etc.).\n2. **Inspection**: The `$TOOL_INPUT` environment variable contains the full command the agent is about to execute. The hook uses `printf` to safely pass input (avoiding `echo` pitfalls with special characters) and checks for `--no-verify` or `--no-gpg-sign` flags only when preceded by a `git` command.\n3. **Blocking**: If a bypass flag is found in a git command, the hook exits with code 2 and prints an error message. Exit code 2 signals Claude Code to reject the tool call entirely.\n4. **Pass-through**: If no bypass flag is found, the hook exits with code 0 and the command executes normally.\n\n### Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| 0 | Allow the tool call to proceed |\n| 1 | Error (tool call still proceeds, warning shown) |\n| 2 | Block the tool call entirely |\n\n## Blocked Flags\n\n| Flag | Purpose | Why Blocked |\n|------|---------|-------------|\n| `--no-verify` | Skips pre-commit and commit-msg hooks | Bypasses linting, formatting, testing, security checks |\n| `--no-gpg-sign` | Skips GPG commit signing | Bypasses commit signing policy |\n\n## Installation\n\n### Per-Project Setup\n\nCreate or update `.claude\u002Fsettings.json` in your project root:\n\n```bash\nmkdir -p .claude\ncat > .claude\u002Fsettings.json \u003C\u003C 'EOF'\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign)'; then echo 'BLOCKED: --no-verify and --no-gpg-sign flags are not allowed. Run the commit without bypass flags so that pre-commit hooks execute properly.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\nEOF\n```\n\n### Global Setup\n\nTo enforce across all projects, add to `~\u002F.claude\u002Fsettings.json`:\n\n```bash\nmkdir -p ~\u002F.claude\ncat > ~\u002F.claude\u002Fsettings.json \u003C\u003C 'EOF'\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign)'; then echo 'BLOCKED: --no-verify and --no-gpg-sign flags are not allowed. Run the commit without bypass flags so that pre-commit hooks execute properly.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\nEOF\n```\n\n## Verification\n\nTest that the hook blocks bypass flags:\n\n```bash\n# This should be blocked by the hook:\ngit commit --no-verify -m \"test\"\n\n# This should succeed normally:\ngit commit -m \"test\"\n```\n\n## Extending the Hook\n\n### Adding More Blocked Flags\n\nTo block additional flags (e.g., `--force`), extend the grep pattern:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign|force-with-lease|force)'; then echo 'BLOCKED: Bypass flags are not allowed.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\n```\n\n### Combining with Other Hooks\n\nThe block-no-verify hook works alongside other PreToolUse hooks:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign)'; then echo 'BLOCKED: Bypass flags not allowed.' >&2; exit 2; fi\"\n        }\n      },\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE 'rm\\\\s+-rf\\\\s+\u002F'; then echo 'BLOCKED: Dangerous rm command.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\n```\n\n## Best Practices\n\n1. **Commit the settings file** -- Add `.claude\u002Fsettings.json` to version control so all team members benefit from the hook.\n2. **Document in onboarding** -- Mention the hook in your project's contributing guide so developers understand why bypass flags are blocked.\n3. **Pair with pre-commit hooks** -- The block-no-verify hook ensures pre-commit hooks run; make sure you have meaningful pre-commit hooks configured.\n4. **Test after setup** -- Verify the hook works by intentionally triggering it in a test commit.\n","# Block No-Verify Hook\n\nPreToolUse 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.\n\n## Overview\n\nAI 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.\n\n## Problem\n\nWhen AI agents commit code, they may use bypass flags to avoid hook failures:\n\n```bash\n# These commands skip pre-commit hooks entirely\ngit commit --no-verify -m \"quick fix\"\ngit push --no-verify\ngit commit --no-gpg-sign -m \"unsigned commit\"\ngit merge --no-verify feature-branch\n```\n\nThis allows:\n- Unformatted code to enter the repository\n- Linting errors to bypass checks\n- Security scanning to be skipped\n- Unsigned commits to bypass signing policies\n- Test suites to be circumvented\n\n## Solution\n\nAdd a `PreToolUse` hook to `.claude\u002Fsettings.json` that inspects every Bash tool call and blocks commands containing bypass flags.\n\n### Configuration\n\nAdd the following to your project's `.claude\u002Fsettings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign)'; then echo 'BLOCKED: --no-verify and --no-gpg-sign flags are not allowed. Run the commit without bypass flags so that pre-commit hooks execute properly.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\n```\n\n### How It Works\n\n1. **Matcher**: The hook targets only `Bash` tool calls, so it does not interfere with other tools (Read, Edit, Grep, etc.).\n2. **Inspection**: The `$TOOL_INPUT` environment variable contains the full command the agent is about to execute. The hook uses `printf` to safely pass input (avoiding `echo` pitfalls with special characters) and checks for `--no-verify` or `--no-gpg-sign` flags only when preceded by a `git` command.\n3. **Blocking**: If a bypass flag is found in a git command, the hook exits with code 2 and prints an error message. Exit code 2 signals Claude Code to reject the tool call entirely.\n4. **Pass-through**: If no bypass flag is found, the hook exits with code 0 and the command executes normally.\n\n### Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| 0 | Allow the tool call to proceed |\n| 1 | Error (tool call still proceeds, warning shown) |\n| 2 | Block the tool call entirely |\n\n## Blocked Flags\n\n| Flag | Purpose | Why Blocked |\n|------|---------|-------------|\n| `--no-verify` | Skips pre-commit and commit-msg hooks | Bypasses linting, formatting, testing, security checks |\n| `--no-gpg-sign` | Skips GPG commit signing | Bypasses commit signing policy |\n\n## Installation\n\n### Per-Project Setup\n\nCreate or update `.claude\u002Fsettings.json` in your project root:\n\n```bash\nmkdir -p .claude\ncat > .claude\u002Fsettings.json \u003C\u003C 'EOF'\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign)'; then echo 'BLOCKED: --no-verify and --no-gpg-sign flags are not allowed. Run the commit without bypass flags so that pre-commit hooks execute properly.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\nEOF\n```\n\n### Global Setup\n\nTo enforce across all projects, add to `~\u002F.claude\u002Fsettings.json`:\n\n```bash\nmkdir -p ~\u002F.claude\ncat > ~\u002F.claude\u002Fsettings.json \u003C\u003C 'EOF'\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign)'; then echo 'BLOCKED: --no-verify and --no-gpg-sign flags are not allowed. Run the commit without bypass flags so that pre-commit hooks execute properly.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\nEOF\n```\n\n## Verification\n\nTest that the hook blocks bypass flags:\n\n```bash\n# This should be blocked by the hook:\ngit commit --no-verify -m \"test\"\n\n# This should succeed normally:\ngit commit -m \"test\"\n```\n\n## Extending the Hook\n\n### Adding More Blocked Flags\n\nTo block additional flags (e.g., `--force`), extend the grep pattern:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign|force-with-lease|force)'; then echo 'BLOCKED: Bypass flags are not allowed.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\n```\n\n### Combining with Other Hooks\n\nThe block-no-verify hook works alongside other PreToolUse hooks:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE '(^|&&|;|\\\\|)\\\\s*git\\\\s+.*--(no-verify|no-gpg-sign)'; then echo 'BLOCKED: Bypass flags not allowed.' >&2; exit 2; fi\"\n        }\n      },\n      {\n        \"matcher\": \"Bash\",\n        \"hook\": {\n          \"type\": \"command\",\n          \"command\": \"if printf '%s' \\\"$TOOL_INPUT\\\" | grep -qE 'rm\\\\s+-rf\\\\s+\u002F'; then echo 'BLOCKED: Dangerous rm command.' >&2; exit 2; fi\"\n        }\n      }\n    ]\n  }\n}\n```\n\n## Best Practices\n\n1. **Commit the settings file** -- Add `.claude\u002Fsettings.json` to version control so all team members benefit from the hook.\n2. **Document in onboarding** -- Mention the hook in your project's contributing guide so developers understand why bypass flags are blocked.\n3. **Pair with pre-commit hooks** -- The block-no-verify hook ensures pre-commit hooks run; make sure you have meaningful pre-commit hooks configured.\n4. **Test after setup** -- Verify the hook works by intentionally triggering it in a test commit.\n",{"name":5,"description":7},"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Fblock-no-verify-hook",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill block-no-verify-hook",{"tool":38,"command":39},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill block-no-verify-hook",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill block-no-verify-hook","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fblock-no-verify-hook\u002FSKILL.md",true,[],[47,55,60,67,74,81],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":54},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":56,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":54},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":54},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":54},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":54},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":54},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]