agentleFS
L1veSongL1veSong/Canon-Mnemonic-Guard/canon-mnemonic-guard-dashboard/SKILL.md

canon-mnemonic-guard-dashboard

Skill2 starsChanged 25 days agoMITView on GitHub

Use when the user says "dashboard", "仪表盘", "!dashboard", or wants to view/manage Canon-Mnemonic-Guard rules, config, or companion skills. Launches a local web dashboard at localhost:8765 with rule browsing, config management, companion skill monitoring, trend charts, ZIP export, batch operations, and type conversion.

  • Installs packages

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use patch for code edits, NEVER sed for JS insertion (sed eats closing braces, nests functions inside applyLang).

    line 52
  2. Very specific:

    If broken, roll back to .bak — don't debug forward into corrupted code.

    line 55
  3. Very specific:

    All new i18n strings need BOTH zh AND en entries.

    line 59

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Canon-Mnemonic-Guard Dashboard

Web dashboard for Canon-Mnemonic-Guard. Single-file Python HTTP server with embedded HTML/CSS/JS. Zero external web dependencies.

Quick Start

pip install pyyaml
python3 server.py
# http://localhost:8765

Or cmg dashboard or !dashboard in Hermes.

Features

Rules Tab — 77+ rules searchable, filterable (ban/gap/lazy/meta), sortable. Expand rows for metadata. Edit keywords/description/type via modal. Delete single or batch.

Engine Config — 17 hook toggles + intercept notice + auto-recommend master switch. Companion skills list with real-time install status (✓/✗). Per-module save buttons.

Trend Chart — 30-day intercept bar chart below stats cards. Shows empty state when no recent data.

Export — Download all rules as ZIP (button in toolbar).

Batch Operations — Checkbox select + select-all + batch delete.

Add Rule — Form with type selector (ban/gap/lazy/meta).

Theme & i18n — Dark/light with system detection. Full zh/en coverage.

Virtual Scroll — Table limited to 600px height with sticky header. Only visible rows rendered.

Architecture

Single-file server.py: HTTP server + HTML template + CSS + JS. API endpoints serve JSON to the frontend JS. Rules read/write directly to ~/.hermes/self-reflection/rules/. Config deep-merges to ~/.hermes/config.yaml.

Development Rules

  1. Use patch for code edits, NEVER sed for JS insertion (sed eats closing braces, nests functions inside applyLang).
  2. Backup before every feature — cp server.py server.py.bak{N} before each change.
  3. One feature at a time; test each before continuing.
  4. If broken, roll back to .bak — don't debug forward into corrupted code.
  5. JS in Python ''' strings: use ' for single quotes, never \'.
  6. Virtual scroll + DOM rebuild resets state — use data-driven tracking (selectedIds object), never DOM-based selection (querySelectorAll('.row-cb:checked')).
  7. table-layout:fixed + new columns breaks layout — consolidate into existing columns.
  8. All new i18n strings need BOTH zh AND en entries.
  9. 🔴 replace_all: true can eat unrelated CSS — when the same selector pattern appears twice (.export-btn { ... } duplicated), replace_all replaces BOTH including the wrong one. Always use unique surrounding context.
  10. <label> causes click propagation — wrapping buttons in <label> causes sibling button handlers to fire. Use <span> for neutral containers.
  11. CSS transitions break on DOM rebuild — renderRules() does innerHTML = html which destroys in-progress transitions. Schedule DOM cleanup AFTER transition completes (use setTimeout matching transition duration). Fade-out → wait → then rebuild.
  12. Companion toggles are read-only — per-skill enable/disable toggles were removed in v1.0.1 because cmg-guard plugin never reads companion_skills from config.yaml. The Dashboard's toggles had no effect on actual behavior. The companion list now shows only install status (✓/✗).
  13. 🔴 硬编码版本号/配置 key 必须自适应 — 不要写死 v5.6.0 或 'cmg_guard'。版本从 CMG SKILL.md frontmatter 读取,配置 key 从 sentinel plugin.yaml 自动检测。用 CMG_VERSION = _cmg_version() 和 SENTINEL_KEY = _sentinel_config_key() 在服务启动时注入 HTML 模板。
  14. 🔴 Canvas 必须 devicePixelRatio 缩放 — Retina 屏上 Canvas 默认分辨率极糊。canvas.width = w * dpr; canvas.height = h * dpr; canvas.style.width = w + 'px'; canvas.style.height = h + 'px'; ctx.scale(dpr, dpr)。
  15. 🔴 JS 动态 textContent 覆写会绕过 i18n — toggleBatchMode() 之类的函数用 textContent = '☐ 批量' 绕过 applyLang()。所有动态按钮文本必须用 t('key')。
  16. 🔴 naive datetime vs UTC-aware 导致静默故障 — datetime.now(timezone.utc) 与 datetime.fromisoformat(ts) (naive) 相减抛 TypeError,被 except: pass 吞掉。必须 dt.replace(tzinfo=timezone.utc) 统一时区后再相减。
  17. 🔴 execute_code 多次调用会互踩 — 每次 execute_code 是独立沙箱,重复 read→modify→write 同一个文件会互相覆盖。改同一文件时必须在一次 execute_code 中完成所有修改,或在每次修改前重新 read_file。

Companion Detection

Scans ~/.hermes/skills/, ~/.claude/skills/, ~/.agents/skills/, ~/.openclaw/skills/, ~/.codex/skills/, and ~/.hermes/plugins/. Matches by name: regex in SKILL.md frontmatter (never YAML-parse to avoid crashes).

Dependencies

Python 3.7+, PyYAML.

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.