agentleFS
L1veSongL1veSong/Canon-Mnemonic-Guard/guard/SKILL.md

guard

Skill2 starsChanged 24 days agoMITView on GitHub

三省引擎(Canon-Mnemonic-Guard)护栏线 (Guard) — 规则执行器。读取 Canon 规则库,执行五层前置拦截。Hermes 平台搭配 cmg-guard 插件实现内核级硬拦截,其他平台靠 Skill 层自觉。v4.8.3 文档精简。

52 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use unfreeze, plan-tune and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ayudaySkill

    unfreeze

    Clear the freeze boundary set by /freeze, allowing edits to all directories again. Use when you want to widen edit scope without ending the session. Use when asked to "unfreeze", "unlock edits", "remove freeze", or "allow all edits".

    Also in 24 projects that use this

  • ShreyRaviSkill

    plan-tune

    Self-tuning question sensitivity + developer psychographic for gstack (v1: observational). Review which AskUserQuestion prompts fire across gstack skills, set per-question preferences (never-ask / always-ask / ask-only-for-one-way), inspect the dual-track profile (what you declared vs what your behavior suggests), and enable/disable question tuning. Conversational interface — no CLI syntax required.

    Also in 9 projects that use this

  • Saqlain-811Skill

    ios-clean

    Remove the DebugBridge SPM package and all #if DEBUG wiring from an iOS app. (gstack)

    Also in 5 projects that use this

  • Saqlain-811Skill

    ios-fix

    Autonomous iOS bug fixer. (gstack)

    Also in 5 projects that use this

  • seek888Skill

    open-gstack-browser

    Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in. Opens a visible browser window where you can watch every action in real time. The sidebar shows a live activity feed and chat. Anti-bot stealth built in. Use when asked to "open gstack browser", "launch browser", "connect chrome", "open chrome", "real browser", "launch chrome", "side panel", or "control my browser". Voice triggers (speech-to-text aliases): "show me the browser".

    Also in 9 projects that use this

  • ayudaySkill

    setup-deploy

    Configure deployment settings for /land-and-deploy. Detects your deploy platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom), production URL, health check endpoints, and deploy status commands. Writes the configuration to CLAUDE.md so all future deploys are automatic. Use when: "setup deploy", "configure deployment", "set up land-and-deploy", "how do I deploy with gstack", "add deploy config".

    Also in 17 projects that use this

  • +1 more from Saqlain-811

The file

Files
SKILL.md

Guard 护栏线 v4.8.3

角色: guard | 阶段: pre_action | 职责: 读取 Canon 规则库,执行拦截 Hermes 用户搭配 cmg-guard 插件获得内核级硬拦截;其他平台通过 Skill 层自觉遵守。


能力

拦截层检查内容Hermes 硬拦截其他平台
Ban精确匹配规则关键词✅ 插件Skill 自觉
Fabrication防幻觉声称("已创建/已验证")✅ 插件Skill 自觉
StepCompleteness防跳步骤(链接未读/文件未校验)✅ 插件Skill 自觉
SkillLoad防偷懒(领域 Skill 未加载)❌Skill 自觉
Clarify防瞎猜(多选项未 clarify)❌Skill 自觉

注意:SkillLoad 和 Clarify 需要语义理解,正则做不到,只能在 Skill 层引导。其余三层 cmg-guard 插件全包。

sentinel 插件(Hermes 专属;旧名 cmg-guard)

配套插件 sentinel(旧名 cmg-guard)提供内核级硬拦截,AI 无法跳过:

Hook检查内容
pre_tool_call直接 patch/write SKILL.md → 阻断,要求先加载 authoring。v1.3.2: 读写感知——read_file/grep 放行,sed/>/write_file 拦截
pre_llm_call哨兵扫描 + 步骤完整性 + 黑名单
post_llm_call任务完成证据校验 + 外部来源主张验证
transform_llm_output关键词黑名单替换

17 个 hook 全阶段覆盖,4 个核心默认开启,其余按需配置。

安装(Hermes)

# Skill 层
cp -r guard ~/.hermes/skills/software-development/

# Plugin 层(硬拦截)
cp -r cmg-guard ~/.hermes/plugins/

# 一键配置
python3 ~/.hermes/skills/software-development/canon-mnemonic-guard/scripts/init.py

非 Hermes 平台:只复制 Skill 目录,Plugin 层不可用,依赖 AI 自觉遵守规则。

常见坑点

  1. Guard 不会自动加载 — Hermes 技能系统靠任务匹配。需要 SOUL 激活标记或手动 /skill guard。
  2. 不要给模糊结论 — 「应该已激活」本身就会被拦截。验证到确定为止。
  3. intercept_log 需要有效时间戳 — 手工填充会导致效能分析失败。
  4. 输出层拦截不覆盖执行层偷懒 — AI 跳过中间步骤不产生违规关键词→拦截器不触发。这是架构边界,非 Bug。
  5. Skill 层规则不是硬拦截 — 非 Hermes 平台上 Guard 完全靠 AI 自觉。要强制必须用 Plugin。
  6. cmg-guard 插件在非 CLI 平台需特殊配置 — Desktop/Web/API 没有 AI 自我修正循环,transform_llm_output/pre_llm_call/post_llm_call 三个钩子会导致输出死锁。Desktop 端必须关掉这三项,只保留 pre_tool_call: true。详见 CMG 外观层 references/desktop-compatibility.md。
  7. cmg-guard 代码变更后必须重启验证 — 不能凭感觉说「应该生效了」。需逐项 grep agent.log + 统计规则数 + 确认钩子配置。详见 CMG 外观层 references/desktop-compatibility.md 的「重启验证清单」。
  8. 只读命令也会被 pre_tool_call 误拦 — 判据是「命令串里有没有 SKILL.md」,不是「有没有写操作」。grep <path>/SKILL.md、cat、sed -n '1,20p' 这类纯读命令一样被阻断并返回 [CMG-GATE] 禁止通过终端写入 skill 文件。正确应对:改用 read_file / search_files 工具读,不要在终端换写法重试(重试只会再撞一次)。要读第三方包内的文件同理——用 read_file 而不是 shell。

参考文件

  • CHANGELOG.md — 完整版本历史
  • README.md — 快速上手
  • CMG 外观层 — 三线协作全貌

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.