Forces fact-based investigation (importers, data schemas, user instructions) before allowing Edit/Write/Bash operations. Measured +2.25 quality improvement over no-gate agents.
How this skill is triggered — by the user, by Claude, or both
Slash command
/everything-claude-code:gateguardThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
一个 PreToolUse 钩子,强制 Claude 在编辑前进行调查。它不使用自我评估("你确定吗?"),而是要求具体事实。调查行为本身创造了自我评估永远无法产生的认知。
一个 PreToolUse 钩子,强制 Claude 在编辑前进行调查。它不使用自我评估("你确定吗?"),而是要求具体事实。调查行为本身创造了自我评估永远无法产生的认知。
LLM 自我评估不起作用。问"你违反了什么策略吗?"答案总是"没有"。这已被实验验证。
但问"列出每个导入此模块的文件"会强制 LLM 运行 Grep 和 Read。调查本身创建了改变输出的上下文。
三阶段门控:
1. 拒绝 — 阻止第一次 Edit/Write/Bash 尝试
2. 强制 — 告诉模型确切要收集哪些事实
3. 允许 — 在事实呈现后允许重试
没有竞品同时做到这三点。大多数止步于拒绝。
两次独立 A/B 测试,相同智能体,相同任务:
| 任务 | 门控 | 无门控 | 差距 |
|---|---|---|---|
| 分析模块 | 8.0/10 | 6.5/10 | +1.5 |
| Webhook 验证器 | 10.0/10 | 7.0/10 | +3.0 |
| 平均 | 9.0 | 6.75 | +2.25 |
两个智能体都产生了能运行并通过测试的代码。差异在于设计深度。
MultiEdit 被相同处理——批次中的每个文件单独门控。
在编辑 {file_path} 之前,请提供以下事实:
1. 列出所有导入/引用此文件的文件(使用 Grep)
2. 列出受此更改影响的公共函数/类
3. 如果此文件读/写数据文件,显示字段名称、结构和日期格式
(使用脱敏或合成值,而非原始生产数据)
4. 原样引用用户当前的指令
在创建 {file_path} 之前,请提供以下事实:
1. 命名将调用此新文件的文件名和行号
2. 确认没有现有文件提供相同功能(使用 Glob)
3. 如果此文件读/写数据文件,显示字段名称、结构和日期格式
(使用脱敏或合成值,而非原始生产数据)
4. 原样引用用户当前的指令
触发条件:rm -rf、git reset --hard、git push --force、drop table 等。
1. 列出此命令将修改或删除的所有文件/数据
2. 写一个一行回滚步骤
3. 原样引用用户当前的指令
1. 当前用户请求一句话描述
2. 这个特定命令验证或产生什么
此插件包含 scripts/hooks/gateguard-fact-force.js 钩子。通过 hooks.json 启用它。
如果 GateGuard 阻止了设置或修复工作,使用 ECC_GATEGUARD=off 启动会话。对于钩子级别的控制,继续使用 ECC_DISABLED_HOOKS 配合 GateGuard 钩子 ID。
pip install gateguard-ai
gateguard init
这会添加 .gateguard.yml 用于项目级配置(自定义消息、忽略路径、门控开关)。
%Y/%m/%d %H:%M。检查数据结构(使用脱敏值)可防止整类 bug。.gateguard.yml 忽略 .venv/、node_modules/、.git/ 等路径。safety-guard — 运行时安全检查(互补,不重叠)code-reviewer — 编辑后审查(GateGuard 是编辑前调查)npx claudepluginhub aaione/everything-claude-code-zhBlocks Edit/Write/Bash actions until Claude investigates importers, data schemas, and user instructions. Improves output quality by forcing concrete facts before edits.
Blocks destructive Bash commands like rm -rf, DROP TABLE, git force-push, reset --hard, and restricts file edits to a specific directory. Use for protection on critical systems.
Creates AI-powered quality gates using Claude Code prompt hooks to validate commit messages, code patterns, and conventions before allowing operations.