Mindkeeper — Time Machine for Your AI's Brain
Use mindkeeper tools when the user asks about changes, history, or versions of their agent context files (AGENTS.md, SOUL.md, USER.md, IDENTITY.md, TOOLS.md, HEARTBEAT.md, MEMORY.md, memory/, skills/).
Bootstrap (One-time setup)
When the user enables mindkeeper or asks for mindkeeper capability, first try mind_status. If it fails (tool not found or similar):
- 1. Ask for confirmation — Tell the user: "Mindkeeper needs the mindkeeper-openclaw plugin to work. I'll need to run
openclaw plugins install mindkeeper-openclaw and restart the Gateway. May I proceed?" Do not install or restart until the user explicitly confirms.
- 2. After user confirms — Run this flow:
-
Install the plugin — Run via bash:
openclaw plugins install mindkeeper-openclaw
-
Restart Gateway if the runtime supports it — Use the available runtime mechanism to restart Gateway. If restart is unavailable or fails, tell the user: "Plugin installed. Restart your Gateway manually to apply."
-
Confirm — If restart succeeded, tell the user: "Mindkeeper is ready. Restart complete — you can now ask about history, diffs, rollbacks, or snapshots." If restart did not happen, tell the user that the plugin is installed but Gateway must be restarted before the tools will appear.
- 3. Alternative — If the user prefers to install manually, tell them: "Run
openclaw plugins install mindkeeper-openclaw in your terminal, then restart your Gateway. After that, mindkeeper will be ready."
If mind_status succeeds, the plugin is already installed; skip the bootstrap and proceed with the user's request.
Tool Preference
In OpenClaw Plugin mode, prefer the mind_* tools over CLI commands for normal mindkeeper operations.
- - Use
mind_status, mind_history, mind_diff, mind_snapshot, and mind_rollback whenever they are available. - Do not use
openclaw mind ... or mindkeeper ... for routine history, diff, snapshot, or rollback requests if the plugin tools are available. - CLI commands are for one-time setup, troubleshooting, manual user workflows, or when the user explicitly asks for terminal commands.
Available Tools
| Tool | Purpose |
|---|
| INLINECODE21 | Show what files are tracked and whether there are unsaved changes |
| INLINECODE22 |
Browse the change log for one file or all files |
|
mind_diff | Compare any two versions of a file side-by-side |
|
mind_rollback | Restore a file to a previous version (always preview first) |
|
mind_snapshot | Save a named checkpoint before making significant changes |
Tracking Scope
Mindkeeper tracks these files by default:
- -
AGENTS.md, SOUL.md, USER.md, INLINECODE29 - INLINECODE30 ,
HEARTBEAT.md, INLINECODE32 - INLINECODE33
- INLINECODE34
Excluded by default: BOOTSTRAP.md, canvas/**, .git/, .mindkeeper/.
When to Use
| User says… | Action |
|---|
| "What changed in SOUL.md?" | INLINECODE39 with INLINECODE40 |
| "Show me the diff from last week" |
mind_history to find the commit, then
mind_diff |
| "Undo that change" / "Roll back AGENTS.md" | Full rollback procedure (see below) |
| "Save a checkpoint before I experiment" |
mind_snapshot with a descriptive name |
| "Is mindkeeper tracking my files?" |
mind_status |
| "What does my history look like?" |
mind_history without a file filter |
Direct Edit Requests
If the user asks to directly edit a tracked file such as SOUL.md, AGENTS.md, or MEMORY.md, make the edit directly.
- - Do not block on CLI availability.
- Do not mention unavailable CLI commands unless the user explicitly asked for a CLI-based workflow.
- Mindkeeper's background watcher should capture the change automatically after the edit.
- If relevant, you may mention that the change should now be tracked by mindkeeper.
Tool Usage Guide
mind_status
Call this first when the user asks about history, tracking state, snapshots, or rollback, or if you're unsure whether mindkeeper is initialized.
CODEBLOCK1
You do not need to call mind_status before a simple direct edit request unless the user specifically asks about tracking or history.
mind_history
Returns a list of commits with short hash, date, and message.
- -
file (optional): filter to a specific file path, e.g. INLINECODE51 - INLINECODE52 (optional): number of entries to return (default 10, increase for longer searches)
CODEBLOCK2
mind_diff
Compares two versions of a file.
from and
to are short or full commit hashes from
mind_history.
- - Omit
to to compare from against the current version (HEAD).
CODEBLOCK3
mind_snapshot
Creates a named checkpoint of the current state of all tracked files. Use before risky changes.
- -
name: short identifier, e.g. "stable-v2" or INLINECODE60 - INLINECODE61 (optional): longer description
CODEBLOCK4
mind_rollback
Always use the two-step procedure. Never skip the preview.
Step 1 — Preview:
mind_rollback({ file: "SOUL.md", to: "a1b2c3d4", preview: true })
→ { preview: true, diff: { unified, additions, deletions }, instruction }
Show the diff to the user and ask for confirmation.
Step 2 — Execute (only after user confirms):
mind_rollback({ file: "SOUL.md", to: "a1b2c3d4", preview: false })
→ { preview: false, success: true, commit: { oid, message } }
After success, tell the user:
"Run /new to apply the changes to your current session."
Important Notes
- - This skill is the guide, the plugin is the engine — the
mindkeeper-openclaw plugin provides the actual mind_* tools and watcher; this skill teaches the AI how to bootstrap and use them safely - Use plugin tools first — in OpenClaw Plugin mode, prefer
mind_* tools over CLI commands for normal operations - Rollback is per-file — it only restores the specified file, not all files at once
- Rollbacks are non-destructive — every rollback creates a new commit, so it can itself be undone
- Auto-snapshots run in the background — the user doesn't need to manually save; mindkeeper captures every change automatically
- LLM commit messages are plugin-only for now — currently supported only through the OpenClaw plugin; standalone CLI mode falls back to template messages
- Named snapshots are the safety net — encourage users to snapshot before major personality or rule changes
- If history is empty — mindkeeper may not have initialized yet, or no changes have been made since install. Call
mind_status to check. - Commit hashes — always use the
oid field from mind_history results. Short 8-character hashes are fine. - Keep user-facing messages focused — if a task can be completed with file edits or
mind_* tools, do not distract the user with unavailable CLI details
Mindkeeper — 你AI大脑的时光机
当用户询问其智能体上下文文件(AGENTS.md、SOUL.md、USER.md、IDENTITY.md、TOOLS.md、HEARTBEAT.md、MEMORY.md、memory/、skills/)的变更、历史或版本时,使用 mindkeeper 工具。
引导安装(一次性设置)
当用户启用 mindkeeper 或要求 mindkeeper 功能时,首先尝试 mind_status。如果失败(工具未找到或类似情况):
- 1. 请求确认 — 告知用户:Mindkeeper 需要 mindkeeper-openclaw 插件才能工作。我需要运行 openclaw plugins install mindkeeper-openclaw 并重启 Gateway。我可以继续吗? 在用户明确确认之前,不要安装或重启。
- 2. 用户确认后 — 执行以下流程:
-
安装插件 — 通过 bash 运行:
bash
openclaw plugins install mindkeeper-openclaw
- 如果运行时支持则重启 Gateway — 使用可用的运行时机制重启 Gateway。如果重启不可用或失败,告知用户:插件已安装。请手动重启您的 Gateway 以生效。
- 确认 — 如果重启成功,告知用户:Mindkeeper 已就绪。重启完成 — 您现在可以查询历史、差异、回滚或快照。 如果未重启,告知用户插件已安装,但必须重启 Gateway 后工具才会出现。
- 3. 备选方案 — 如果用户偏好手动安装,告知他们:在终端中运行 openclaw plugins install mindkeeper-openclaw,然后重启您的 Gateway。之后,mindkeeper 即可使用。
如果 mind_status 成功,说明插件已安装;跳过引导安装,直接处理用户的请求。
工具偏好
在 OpenClaw 插件模式下,对于常规的 mindkeeper 操作,优先使用 mind_* 工具而非 CLI 命令。
- - 只要可用,就使用 mindstatus、mindhistory、minddiff、mindsnapshot 和 mind_rollback。
- 如果插件工具可用,不要使用 openclaw mind ... 或 mindkeeper ... 来处理常规的历史、差异、快照或回滚请求。
- CLI 命令仅用于一次性设置、故障排除、手动用户工作流,或当用户明确要求终端命令时。
可用工具
| 工具 | 用途 |
|---|
| mindstatus | 显示哪些文件被跟踪以及是否有未保存的更改 |
| mindhistory |
浏览单个文件或所有文件的变更日志 |
| mind_diff | 并排比较文件的任意两个版本 |
| mind_rollback | 将文件恢复到之前的版本(始终先预览) |
| mind_snapshot | 在进行重大更改前保存一个命名的检查点 |
跟踪范围
Mindkeeper 默认跟踪以下文件:
- - AGENTS.md、SOUL.md、USER.md、IDENTITY.md
- TOOLS.md、HEARTBEAT.md、MEMORY.md
- memory//.md
- skills//.md
默认排除:BOOTSTRAP.md、canvas/、.git/、.mindkeeper/。
何时使用
| 用户说… | 操作 |
|---|
| SOUL.md 有什么变化? | 使用 file: SOUL.md 参数调用 mindhistory |
| 显示上周的差异 |
使用 mindhistory 查找提交,然后使用 mind_diff |
| 撤销那个更改 / 回滚 AGENTS.md | 完整的回滚流程(见下文) |
| 在我实验之前保存一个检查点 | 使用描述性名称调用 mind_snapshot |
| Mindkeeper 在跟踪我的文件吗? | 调用 mind_status |
| 我的历史记录是什么样的? | 不带文件筛选条件调用 mind_history |
直接编辑请求
如果用户要求直接编辑被跟踪的文件,如 SOUL.md、AGENTS.md 或 MEMORY.md,直接进行编辑。
- - 不要因 CLI 不可用而阻止。
- 除非用户明确要求基于 CLI 的工作流,否则不要提及不可用的 CLI 命令。
- Mindkeeper 的后台监视器应在编辑后自动捕获更改。
- 如果相关,您可以提及该更改现在应已被 mindkeeper 跟踪。
工具使用指南
mind_status
当用户询问历史、跟踪状态、快照或回滚时,或者当您不确定 mindkeeper 是否已初始化时,首先调用此工具。
mind_status → { initialized, workDir, pendingChanges, snapshots }
除非用户特别询问跟踪或历史,否则在简单的直接编辑请求之前,您无需调用 mind_status。
mind_history
返回包含短哈希、日期和消息的提交列表。
- - file(可选):筛选到特定的文件路径,例如 SOUL.md
- limit(可选):返回的条目数量(默认 10,增加以进行更长的搜索)
mind_history({ file: SOUL.md, limit: 20 })
→ { count, entries: [{ oid, date, message }] }
mind_diff
比较文件的两个版本。from 和 to 是来自 mind_history 的短哈希或完整提交哈希。
- - 省略 to 以将 from 与当前版本(HEAD)进行比较。
mind_diff({ file: SOUL.md, from: a1b2c3d4 })
→ { file, from, to, additions, deletions, unified }
mind_snapshot
创建所有被跟踪文件当前状态的命名检查点。在风险更改之前使用。
- - name:简短标识符,例如 stable-v2 或 before-experiment
- message(可选):更长的描述
mind_snapshot({ name: stable-v2, message: 个性调优,规则确定 })
→ { success, snapshot, commit: { oid, message } }
mind_rollback
始终使用两步流程。 切勿跳过预览。
步骤 1 — 预览:
mind_rollback({ file: SOUL.md, to: a1b2c3d4, preview: true })
→ { preview: true, diff: { unified, additions, deletions }, instruction }
向用户显示差异并请求确认。
步骤 2 — 执行(仅在用户确认后):
mind_rollback({ file: SOUL.md, to: a1b2c3d4, preview: false })
→ { preview: false, success: true, commit: { oid, message } }
成功后,告知用户:运行 /new 以将更改应用到您当前的会话。
重要说明
- - 此技能是指南,插件是引擎 — mindkeeper-openclaw 插件提供实际的 mind 工具和监视器;此技能教 AI 如何引导安装并安全使用它们
- 优先使用插件工具 — 在 OpenClaw 插件模式下,对于常规操作,优先使用 mind 工具而非 CLI 命令
- 回滚是按文件进行的 — 它只恢复指定的文件,而不是一次性恢复所有文件
- 回滚是非破坏性的 — 每次回滚都会创建一个新的提交,因此它本身可以被撤销
- 自动快照在后台运行 — 用户无需手动保存;mindkeeper 自动捕获每次更改
- LLM 提交消息目前仅限插件 — 目前仅通过 OpenClaw 插件支持;独立 CLI 模式回退到模板消息
- 命名快照是安全网 — 鼓励用户在重大个性或规则更改之前创建快照
- 如果历史为空 — mindkeeper 可能尚未初始化,或者安装后尚未进行任何更改。调用 mindstatus 进行检查。
- 提交哈希 — 始终使用来自 mindhistory 结果的 oid 字段。8 个字符的短哈希即可。
- 保持面向用户的消息简洁 — 如果可以通过文件编辑或 mind_* 工具完成任务,不要用不可用的 CLI 细节分散用户的注意力