بنقرة واحدة
gateguard
强制事实的门控,阻止编辑/写入/Bash(包括MultiEdit),并要求在允许操作之前进行具体调查(导入器、数据模式、用户指令)。与无门控代理相比,可测量地将输出质量提高2.25分。
القائمة
强制事实的门控,阻止编辑/写入/Bash(包括MultiEdit),并要求在允许操作之前进行具体调查(导入器、数据模式、用户指令)。与无门控代理相比,可测量地将输出质量提高2.25分。
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination.
Orchestrate building a brand-new feature end to end — research, plan, TDD implementation, review, and gated commit — by delegating each phase to the matching ECC agent. Use when adding a capability that does not exist yet.
Orchestrate bootstrapping a working MVP from a design or spec document — ingest the doc, plan thin vertical slices, scaffold the first end-to-end slice, then TDD-implement, review, and gated commit. Use to turn an SDD/PRD into a running starting point.
Orchestrate altering an existing, working feature to new desired behavior — update its tests to the new spec, change the implementation to match, review, and gated commit. Use when behavior is not broken but should be different.
Orchestrate fixing a bug — reproduce it as a failing regression test, fix to green, review, and gated commit — by delegating each phase to the matching ECC agent. Use when existing behavior is broken or wrong.
Shared orchestration engine for the orch-* skill family. Defines the gated Research-Plan-TDD-Review-Commit pipeline, the size classifier, the agent map, and the two human gates that the orch-* operation skills delegate to. Not usually invoked directly.
| name | gateguard |
| description | 强制事实的门控,阻止编辑/写入/Bash(包括MultiEdit),并要求在允许操作之前进行具体调查(导入器、数据模式、用户指令)。与无门控代理相比,可测量地将输出质量提高2.25分。 |
| origin | community |
一个 PreToolUse 钩子,强制 Claude 在编辑前进行调查。不同于自我评估("你确定吗?"),它要求具体的事实。调查行为本身创造了自我评估永远无法带来的认知。
LLM 的自我评估不起作用。问"你是否违反了任何策略?"答案永远是"没有"。这已通过实验验证。
但问"列出所有导入此模块的文件"会迫使 LLM 运行 Grep 和 Read。调查本身创造了改变输出的上下文。
三阶段门控:
1. DENY — 阻止首次编辑/写入/Bash 尝试
2. FORCE — 明确告知模型需要收集哪些事实
3. ALLOW — 在事实呈现后允许重试
没有竞争对手能同时做到这三步。大多数止步于拒绝。
两个独立的 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 |
两个代理生成的代码都能运行并通过测试。区别在于设计深度。
多编辑的处理方式相同——批次中的每个文件都单独进行门控。
在编辑 {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。检查数据结构(使用脱敏值)可以防止这类错误。.gateguard.yml 忽略 .venv/、node_modules/、.git/ 等路径。safety-guard — 运行时安全检查(互补,不重叠)code-reviewer — 编辑后审查(GateGuard 是编辑前调查)