Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/skymanbp/cc-enforcer/sync-gategit clone --depth 1 https://github.com/skymanbp/cc-enforcerWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00053 | $0.01333 |
| Opus 5 | $0.00026 | $0.00666 |
| Sonnet 5 | $0.00011 | $0.00267 |
| Haiku 4.5 | $0.00005 | $0.00133 |
Grade A, and why
sync-gate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/cc-enforcer:sync-gate
rule 12 的被动半区由
.claude/cc-enforcer/sync-gate.toml驱动:某组的whenglob 命中了本会话编辑过的文件,而require侧一个都没动 → Stop layer (i) 拦下完成声明(除非回复里有同步核对:/sync-check:标记)。 本命令调用hooks/scripts/manage_sync_gate.py。 机制说明见rules/12-repo-wide-sync.md。
为什么必须有 check
sync_gate.load() 是故意 failing-open 的:配置解析失败、某个组缺
when/require、某个 glob 打不中任何文件 —— 这些情况下它都不报错,只是
静默地不再守护,外加一行没人看的 stderr。
后果是:一道你以为在守着、其实早就失效的门,比没有门更坏,因为你不会再去
看它。check 就是唯一能戳破这层的东西。
子命令
| 子命令 | 作用 |
|---|---|
check |
打印 loader 实际解析出的组 + 被丢弃的组(写在文件里但 loader 不认)+ 打不中任何文件的 glob。有任何问题 → 退出码 1,因此可以直接进 CI。 |
list |
只打印实际加载的组(check 的安静版)。 |
init |
生成带注释的模板(0 个组)。已存在则拒绝覆盖。 |
add |
追加一组,写前双重校验(见下)。 |
remove |
按名字删一组。 |
path |
打印解析到的配置路径。 |
你(receiving agent)要做的
python "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/manage_sync_gate.py" check
python "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/manage_sync_gate.py" init
python "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/manage_sync_gate.py" \
add rules-fanout --when 'rules/*.md' --require 'docs/RULES.md' \
--note '改规则要同步索引'
python "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/manage_sync_gate.py" remove rules-fanout
参数:
--when GLOB/--require GLOB:可重复。对项目相对路径做 fnmatch,*跨路径分隔符(所以rules/*.md也覆盖rules/zh/)。--all:mode = "all",每一个 require glob 都必须有编辑命中。用于 锁步不变量(例:plugin.json改了,marketplace.json与CHANGELOG.md必须双双跟上——只跟一个正是 v0.22.1 的翻车形态)。不加则是 any-of。--note:为什么这几个文件必须一起动。会出现在 layer (i) 的拦截理由里, 所以写给"三个月后的自己"看。
写入契约
add / remove 会重写整个文件,落盘前过两道:
- 能不能解析回来(
tomlio.dumps_check)—— 序列化 bug 不许把配置写坏。 - loader 认不认(用真正的
sync_gate.load_file回读)—— 一个require = []的组是合法 TOML,但会被 loader 静默丢弃。只做第 1 道的话,CLI 会报告 "已添加",而那一组什么也不守。任何一组回读不到 → 拒写并原样还原文件。
写入目标由 CLAUDE_PROJECT_DIR → 带 .git/.claude 标记的 cwd 确定性解析,
不会去搜索"哪里已经有一个配置文件"。没有 --global:glob 是仓库相对的,
一个组离开它的仓库就没有意义。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 81 lines · 53 tokens per session scan A 0cb33eb6abc1
sync-gate is a command published in the GitHub repository skymanbp/cc-enforcer (5 stars, last pushed 7d ago), licensed MIT. It adds 53 tokens to every session and 1,333 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
brooks-audit
Run a Brooks-Lint architecture audit.
todo
The quality-gated task list: tasks with real descriptions, testable acceptance criteria, and evidence — a task only closes when the controller agrees it is done.
release
The pre-tag controller: version sync, changelog, clean tree, gate, and suite — every failure listed, the tag printed, never run.
security
The security pass: secrets (blocking), SAST, dependency vulns — plus the index's entry points to review from.
git
The pre-finish status: branch, hygiene findings, message checks, workflow lint, template state.
init
Install the formatters this repository needs, with every command visible before it runs.