在执行修改或命令前强制事实核查,先调查上下文再放行操作以提升质量。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "gateguard" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/gateguard/SKILL.md 2. 保存为 ~/.claude/skills/gateguard/SKILL.md 3. 装好后重载技能,告诉我可以用了
启用 gateguard,在修改这个仓库前先调查相关导入链、数据结构、配置来源和我的真实需求;只有在你给出明确发现与风险后,才允许执行 Edit 或 MultiEdit。
先输出调查结论、影响范围与潜在风险,再在条件满足后进入具体修改步骤。
使用 gateguard,在运行任何 Bash 命令前先确认项目类型、依赖管理方式、环境变量、数据库模式以及用户目标;如果信息不足,先提问或继续调查,不要直接执行。
得到一份执行前核查清单与缺失信息说明,避免基于错误假设运行命令。
让 gateguard 审核这项写作任务:在生成文档前,先检查现有资料、术语定义、目标读者和格式要求;如果缺少事实依据或用户指令不完整,就暂停 Write 并说明原因。
先获得信息缺口和澄清建议,确认依据充分后再输出文档草稿。
A PreToolUse hook that forces Claude to investigate before editing. Instead of self-evaluation ("are you sure?"), it demands concrete facts. The act of investigation creates awareness that self-evaluation never did.
LLM self-evaluation doesn't work. Ask "did you violate any policies?" and the answer is always "no." This is verified experimentally.
But asking "list every file that imports this module" forces the LLM to run Grep and Read. The investigation itself creates context that changes the output.
Three-stage gate:
1. DENY — block the first Edit/Write/Bash attempt
2. FORCE — tell the model exactly which facts to gather
3. ALLOW — permit retry after facts are presented
No competitor does all three. Most stop at deny.
Two independent A/B tests, identical agents, same task:
| Task | Gated | Ungated | Gap |
|---|---|---|---|
| Analytics module | 8.0/10 | 6.5/10 | +1.5 |
| Webhook validator | 10.0/10 | 7.0/10 | +3.0 |
| Average | 9.0 | 6.75 | +2.25 |
Both agents produce code that runs and passes tests. The difference is design depth.
MultiEdit is handled identically — each file in the batch is gated individually.
Before editing {file_path}, present these facts:
1. List ALL files that import/require this file (use Grep)
2. List the public functions/classes affected by this change
3. If this file reads/writes data files, show field names, structure,
and date format (use redacted or synthetic values, not raw production data)
4. Quote the user's current instruction verbatim
Before creating {file_path}, present these facts:
1. Name the file(s) and line(s) that will call this new file
2. Confirm no existing file serves the same purpose (use Glob)
3. If this file reads/writes data files, show field names, structure,
and date format (use redacted or synthetic values, not raw production data)
4. Quote the user's current instruction verbatim
Triggers on: rm -rf, git reset --hard, git push --force, drop table, etc.
1. List all files/data this command will modify or delete
2. Write a one-line rollback procedure
3. Quote the user's current instruction verbatim
1. The current user request in one sentence
2. What this specific command verifies or produces
The hook at scripts/hooks/gateguard-fact-force.js is included in this plugin. Enable it via hooks.json.
If GateGuard blocks setup or repair work, start the session with
ECC_GATEGUARD=off. For hook-level control, keep using
ECC_DISABLED_HOOKS with the GateGuard hook ID.
pip install gateguard-ai
gateguard init
This adds .gateguard.yml for per-project configuration (custom messages, ignore paths, gate toggles).
%Y/%m/%d %H:%M. Checking data structure (with redacted values) prevents this entire class of bugs.…
帮助你为 Spring Boot 项目实施测试驱动开发,覆盖新增、修复与重构场景
帮助团队编排多代理协作流程,管理任务归属、看板流转与交接控制。
在每次编辑代码时自动格式化、检查并智能修复质量问题
通过 fal.ai 一站式生成图片、视频与音频内容,满足多模态创作需求
提供地道 Go 语言模式与最佳实践,帮助构建健壮高效且易维护的应用
帮助用户高效整理邮箱、起草核验并安全发送邮件与跟进。
为 AI 代理输出提供确定性校验、独立复核与可追溯凭证,降低误报完成风险。
为 AI 代理添加事前拦截规则,防止重复已知错误并提升执行可靠性。
为编程代理提供代码、测试与文档的质量守卫,拦截常见 AI 失误。
为 AI 代理加入人工审核与决策把关的开源审查层
帮助代理为 Bright Data 抓取器修复建立基于证据的审批闭环
为生产环境操作和自主代理执行提供破坏性行为防护与风险拦截。