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
In this repository4 other files it gives its agents.
- canon-mnemonic-guardSkill
- canonSkill
- guardSkill
- mnemonicSkill
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
- Very specific: line 52
Use patch for code edits, NEVER sed for JS insertion (sed eats closing braces, nests functions inside applyLang).
- Very specific: line 55
If broken, roll back to .bak — don't debug forward into corrupted code.
- Very specific: line 59
All new i18n strings need BOTH zh AND en entries.
≈ “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.
Files
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:8765Or 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
- Use
patchfor code edits, NEVERsedfor JS insertion (sed eats closing braces, nests functions inside applyLang). - Backup before every feature —
cp server.py server.py.bak{N}before each change. - One feature at a time; test each before continuing.
- If broken, roll back to
.bak— don't debug forward into corrupted code. - JS in Python
'''strings: use'for single quotes, never\'. - Virtual scroll + DOM rebuild resets state — use data-driven tracking (
selectedIdsobject), never DOM-based selection (querySelectorAll('.row-cb:checked')). table-layout:fixed+ new columns breaks layout — consolidate into existing columns.- All new i18n strings need BOTH
zhANDenentries. - 🔴
replace_all: truecan 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. <label>causes click propagation — wrapping buttons in<label>causes sibling button handlers to fire. Use<span>for neutral containers.- CSS transitions break on DOM rebuild —
renderRules()doesinnerHTML = htmlwhich destroys in-progress transitions. Schedule DOM cleanup AFTER transition completes (usesetTimeoutmatching transition duration). Fade-out → wait → then rebuild. - Companion toggles are read-only — per-skill enable/disable toggles were removed in v1.0.1 because cmg-guard plugin never reads
companion_skillsfrom config.yaml. The Dashboard's toggles had no effect on actual behavior. The companion list now shows only install status (✓/✗). - 🔴 硬编码版本号/配置 key 必须自适应 — 不要写死
v5.6.0或'cmg_guard'。版本从 CMG SKILL.md frontmatter 读取,配置 key 从 sentinel plugin.yaml 自动检测。用CMG_VERSION = _cmg_version()和SENTINEL_KEY = _sentinel_config_key()在服务启动时注入 HTML 模板。 - 🔴 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)。 - 🔴 JS 动态 textContent 覆写会绕过 i18n —
toggleBatchMode()之类的函数用textContent = '☐ 批量'绕过applyLang()。所有动态按钮文本必须用t('key')。 - 🔴 naive datetime vs UTC-aware 导致静默故障 —
datetime.now(timezone.utc)与datetime.fromisoformat(ts)(naive) 相减抛 TypeError,被except: pass吞掉。必须dt.replace(tzinfo=timezone.utc)统一时区后再相减。 - 🔴 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.
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
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.

