在执行修改或命令前强制事实核查,先调查上下文再放行操作以提升质量。
复制安装指令,让 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.…
帮助用户编写、配置与优化 Hookify 规则及语法模式。
用于核查营收、定价、退款与团队计费真相,快速给出证据化结论。
为 KMP 项目提供 Compose 多平台界面架构、导航、主题与性能实践。
帮助团队为医疗应用设计符合PHI/PII要求的数据安全与合规方案
通过逐步细化检索上下文,提升子代理任务理解与结果质量。
帮助你设计与优化 Spring Boot 后端架构、接口与服务实现。
为 AI 代理加入人工审批关卡,在执行前可批准、修改或拒绝操作。
发送消息前检测韩语语境中的承诺与日程冲突,降低沟通失误风险。
为生产环境操作和自主代理执行提供破坏性行为防护与风险拦截。
在执行操作前核验网址、收款方和消息可信度并给出红黄绿结论
为智能体操作生成抗篡改、后量子安全的签名回执,并支持离线验证。
通过统一高速 API 路由海量大模型并集成安全护栏能力。