Defragmenter
/install defragmenter
\r \r
Defragmenter\r
\r
defragmenter is a structural reorganization skill for OpenClaw workspaces.\r
\r
It does not behave like a cleaner, trash collector, or memory compressor.\r
It does not delete information.\r
\r
Its job is to find knowledge that already exists, but is fragmented across the wrong places, and reassemble it into the correct structural locations.\r
\r
What It Does\r
\r Defragmenter looks for situations like:\r
- logic living inside a cron message instead of a flow file\r
- operational facts existing in chat or notes but not in
CONTAINER_STATE.md\r - preferences mentioned in conversation but not recorded in the right preference file\r
- workflow rules spread across multiple files without a clear source of truth\r
- facts that exist, but are not assembled into one coherent working structure\r \r Then, after user confirmation, it:\r
- copies or rewrites that knowledge into the proper file (from the Allowed Targets list only)\r
- preserves the existing information rather than deleting it\r
- makes the workspace more structurally coherent\r \r
Core Principle\r
\r Reorganize, not destroy.\r \r Defragmenter may:\r
- move logic to the correct file\r
- duplicate essential context into the correct source-of-truth file\r
- rewrite instructions into a cleaner structure\r
- connect fragmented pieces of working knowledge\r \r Defragmenter does not:\r
- delete source material by default\r
- prune history\r
- compress memory for brevity\r
- behave like a cleanup/trash skill\r \r
Typical Use Cases\r
\r Use this skill when:\r
- the workspace feels architecturally messy\r
- the right information exists, but in the wrong place\r
- a workflow is half in chat, half in cron, half in files\r
- operational state has drifted away from documentation\r
- multiple files describe the same process, but no file is the clear source of truth\r \r
Examples\r
\r
Example 1: Cron logic is too smart\r
A cron message contains detailed workflow logic.\r \r Defragmenter should:\r
- extract that logic into a flow file\r
- reduce the cron to a simple trigger\r
- preserve the intent without deleting history\r \r
Example 2: Operational facts are stranded\r
A container repair decision exists in chat or daily notes, but not in CONTAINER_STATE.md.\r
\r
Defragmenter should:\r
- rewrite the important fact into
CONTAINER_STATE.md\r - add or update restore instructions if appropriate\r \r
Example 3: Preferences are scattered\r
Food, browser, or workflow preferences exist in conversation history but not in their proper file.\r \r Defragmenter should:\r
- gather them into the correct preference/source-of-truth file\r \r
Allowed Targets\r
\r Defragmenter may only reorganize knowledge into files within the current workspace that match these patterns:\r
MEMORY.md\rmemory/*.md\rCONTAINER_STATE.md\rflows/*.md\r- preference files within the current workspace root\r \r Defragmenter must not modify:\r
- Any file under
skills/or anySKILL.mdfile (including its own)\r - Shell scripts, executables, or files outside the workspace root\r
.env, credentials, or configuration files not listed above\r- Any file belonging to another skill's directory\r \r
Output Style\r
\r First, return a dry-run structural report for user review:\r \r
Defragmentation scan complete. Proposed changes:\r
- MOVE workflow logic from cron text → flows/deploy.md\r
- COPY operational facts → CONTAINER_STATE.md\r
- COPY scattered preference rules → preferences.md\r
- No deletions proposed\r
\r
Awaiting confirmation to apply.\r
```\r
\r
After the user approves, apply changes and return a confirmation report.\r
\r
## Safety\r
\r
- **Dry-run by default.** When invoked, Defragmenter first produces a proposed change list (files to modify, what will be added/moved) without making any changes. Changes are only applied after the user confirms.\r
- **Confirmation required.** Every file write must be presented to the user for approval before execution. Do not batch-apply changes silently.\r
- **Read-only scan first.** Always begin by scanning and reporting what fragmentation was found. Never jump straight to writing files.\r
- **No deletions.** Defragmenter must not delete content from source files, even if the content has been copied to its correct location. The user may choose to clean up sources separately.\r
\r
## Rules\r
\r
- Prefer creating a clear source of truth\r
- Preserve information rather than deleting it\r
- Structural coherence matters more than brevity\r
- If something is already in the right place, leave it alone\r
- Make minimal, high-value reorganizations\r
- **Only write to files listed in the Allowed Targets section above**\r
- **Never modify skill definitions, SKILL.md files, or files outside the workspace**\r
- **Always present a dry-run summary and wait for user approval before writing any file**\r
\r
## Design Goal\r
\r
Defragmenter exists to restore structural coherence across workspace knowledge.\r
\r
It is focused on placement, source-of-truth repair, and reassembly of fragmented context across files and layers.\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install defragmenter - 安装完成后,直接呼叫该 Skill 的名称或使用
/defragmenter触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Defragmenter 是什么?
Structural knowledge defragmentation for OpenClaw workspaces. Finds information, rules, and operational facts that are spread across the wrong files or embed... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 122 次。
如何安装 Defragmenter?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install defragmenter」即可一键安装,无需额外配置。
Defragmenter 是免费的吗?
是的,Defragmenter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Defragmenter 支持哪些平台?
Defragmenter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Defragmenter?
由 Ivan Balukov(@balukov)开发并维护,当前版本 v1.0.1。