← 返回 Skills 市场
casperkwok

memory-doctor

作者 Casper · GitHub ↗ · v0.1.2 · MIT-0
cross-platform ✓ 安全检测通过
38
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install memory-doctor
功能描述
Keep an LLM agent's long-term memory healthy — the cure for context rot. Use when a memory store exists and the user wants to check or tidy it ("记忆体检", "整理记忆...
使用说明 (SKILL.md)

memory-doctor — keep agent memory healthy

Memory skills write memory; almost none maintain it. Over time a store grows long, contradicts itself, sprouts dead links, and its index drifts — the agent then burns tokens parsing stale history instead of acting. That is context rot. This skill governs an existing store; it does not produce memory.

Producers write, memory-doctor keeps it alive. Complements memory skills, doesn't replace them. Source & issues: \x3Chttps://github.com/casperkwok/memory-doctor>

When to use

  • A memory store exists (a MEMORY.md + *.md notes, or a *.mneme file) and the user wants to check or clean it: "记忆体检 / 整理记忆 / memory health / cleanup / dedup / fix the index".
  • Memory has clearly grown long, repetitive, or the index no longer matches the files.

How to run (zero deps, Python ≥ 3.9)

# read-only — safe anytime; print the health card first
python scripts/curate.py report --dir \x3Cmemory-dir>

# auto-memory only: preview then apply the index reconciliation (snapshots first)
python scripts/curate.py lint --dir \x3Cmemory-dir>
python scripts/curate.py lint --dir \x3Cmemory-dir> --fix

# revert the last write
python scripts/curate.py undo --dir \x3Cmemory-dir>

The format is auto-detected (*.mneme present → mneme, else auto-memory); override with --format auto-memory|mneme.

What the report checks

  • dead links, stale notes, oversized files, lexical duplicate candidates, and a freshness score (per-type exponential decay).
  • auto-memory: index drift (MEMORY.md vs files) and orphans (no inbound link, unindexed).
  • mneme: history cells (superseded/retired/proposed) excluded from active health, and supersede back-link symmetry; freshness uses each cell's seen date.

What it fixes (v0.1 — deterministic & reversible only)

  • Index reconciliation (auto-memory): add missing MEMORY.md entries, drop dangling ones, preserving your hand-written hooks. A full-directory snapshot is taken first; undo reverts.
  • mneme's spine is derived, so there is no index to reconcile — use report.

Semantic fixes that need a model — true duplicate merge, contradiction reconcile, oversized compaction — are flagged in v0.1 and resolved in v0.2 (no embeddings; manual-apply, snapshot-backed). Never auto-edit memory content on the user's behalf without confirmation.

Safety

Every write snapshots the whole directory to .memory-doctor/snapshots/\x3Cts>/ and logs to .memory-doctor/changelog.md; undo restores it. v0.1 only ever rewrites the index file.

Optional: a read-only health nudge

hooks/health_nudge.py (in the repo) can be wired to a Claude Code SessionStart hook to print a one-line nudge when health drops. It is read-only and never edits anything. Opt-in.

安全使用建议
Install only if you are comfortable letting it read a chosen memory directory. Run report and lint first, review the dry-run output, and use --fix only when you want MEMORY.md rewritten. Keep your own backup for important memory stores because the bundled snapshot is not a full recursive directory backup.
能力评估
Purpose & Capability
The skill's stated purpose is to report on and tidy an existing agent memory store, and the code matches that purpose: it reads local markdown or mneme memory files, reports health issues, and can reconcile the auto-memory MEMORY.md index.
Instruction Scope
The instructions distinguish read-only report, dry-run lint, explicit lint --fix, and undo. The artifact does not instruct automatic execution or hidden edits, and it says memory content should not be auto-edited without confirmation.
Install Mechanism
The package bundles executable Python scripts with no external dependencies or install-time execution. Metadata does not declare file read/write permissions, but the SKILL.md run commands disclose local file reads and writes.
Credentials
Access is limited by the user-supplied --dir path and is proportionate for memory-store maintenance. The code shows no network calls, credential handling, subprocess execution, or external API use.
Persistence & Privilege
When explicitly run with --fix or undo, the tool writes inside the chosen memory directory by updating MEMORY.md and creating .memory-doctor snapshots/changelog. The docs overstate snapshot scope as whole-directory; implementation snapshots top-level .md files, which is enough for the current MEMORY.md rewrite but should be documented more precisely.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install memory-doctor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /memory-doctor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.2
v0.1.2 — rename working dir to .memory-doctor/ and remove residual 'curator' wording (branding consistency). No functional change.
v0.1.1
v0.1.1 — fix repo URL to github.com/casperkwok/memory-doctor (project renamed from memory-curator for consistent branding). No functional change.
v0.1.0
v0.1.0 — first release. Read-only health report + safe, reversible MEMORY.md index reconciliation (snapshot/undo). Two formats auto-detected: Claude Code auto-memory and mneme (.mneme). Zero dependencies, zero LLM. Semantic merge/reconcile/compact flagged now, resolved in v0.2.
元数据
Slug memory-doctor
版本 0.1.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

memory-doctor 是什么?

Keep an LLM agent's long-term memory healthy — the cure for context rot. Use when a memory store exists and the user wants to check or tidy it ("记忆体检", "整理记忆... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 38 次。

如何安装 memory-doctor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install memory-doctor」即可一键安装,无需额外配置。

memory-doctor 是免费的吗?

是的,memory-doctor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

memory-doctor 支持哪些平台?

memory-doctor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 memory-doctor?

由 Casper(@casperkwok)开发并维护,当前版本 v0.1.2。

💬 留言讨论