defragmenter

Structural knowledge defragmentation for OpenClaw workspaces. Finds information, rules, and operational facts that are spread across the wrong files or embedded in the wrong layer, then rewrites them into the proper files without deleting source material. Use when the workspace feels fragmented, logic is embedded in cron/jobs instead of flow files, preferences are scattered, or facts exist but are not assembled into one coherent working structure.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "defragmenter" with this command: npx skills add balukov/defragmenter

Defragmenter

defragmenter is a structural reorganization skill for OpenClaw workspaces.

It does not behave like a cleaner, trash collector, or memory compressor. It does not delete information.

Its job is to find knowledge that already exists, but is fragmented across the wrong places, and reassemble it into the correct structural locations.

What It Does

Defragmenter looks for situations like:

  • logic living inside a cron message instead of a flow file
  • operational facts existing in chat or notes but not in CONTAINER_STATE.md
  • preferences mentioned in conversation but not recorded in the right preference file
  • workflow rules spread across multiple files without a clear source of truth
  • facts that exist, but are not assembled into one coherent working structure

Then, after user confirmation, it:

  • copies or rewrites that knowledge into the proper file (from the Allowed Targets list only)
  • preserves the existing information rather than deleting it
  • makes the workspace more structurally coherent

Core Principle

Reorganize, not destroy.

Defragmenter may:

  • move logic to the correct file
  • duplicate essential context into the correct source-of-truth file
  • rewrite instructions into a cleaner structure
  • connect fragmented pieces of working knowledge

Defragmenter does not:

  • delete source material by default
  • prune history
  • compress memory for brevity
  • behave like a cleanup/trash skill

Typical Use Cases

Use this skill when:

  • the workspace feels architecturally messy
  • the right information exists, but in the wrong place
  • a workflow is half in chat, half in cron, half in files
  • operational state has drifted away from documentation
  • multiple files describe the same process, but no file is the clear source of truth

Examples

Example 1: Cron logic is too smart

A cron message contains detailed workflow logic.

Defragmenter should:

  • extract that logic into a flow file
  • reduce the cron to a simple trigger
  • preserve the intent without deleting history

Example 2: Operational facts are stranded

A container repair decision exists in chat or daily notes, but not in CONTAINER_STATE.md.

Defragmenter should:

  • rewrite the important fact into CONTAINER_STATE.md
  • add or update restore instructions if appropriate

Example 3: Preferences are scattered

Food, browser, or workflow preferences exist in conversation history but not in their proper file.

Defragmenter should:

  • gather them into the correct preference/source-of-truth file

Allowed Targets

Defragmenter may only reorganize knowledge into files within the current workspace that match these patterns:

  • MEMORY.md
  • memory/*.md
  • CONTAINER_STATE.md
  • flows/*.md
  • preference files within the current workspace root

Defragmenter must not modify:

  • Any file under skills/ or any SKILL.md file (including its own)
  • Shell scripts, executables, or files outside the workspace root
  • .env, credentials, or configuration files not listed above
  • Any file belonging to another skill's directory

Output Style

First, return a dry-run structural report for user review:

Defragmentation scan complete. Proposed changes:
- MOVE workflow logic from cron text → flows/deploy.md
- COPY operational facts → CONTAINER_STATE.md
- COPY scattered preference rules → preferences.md
- No deletions proposed

Awaiting confirmation to apply.

After the user approves, apply changes and return a confirmation report.

Safety

  • 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.
  • Confirmation required. Every file write must be presented to the user for approval before execution. Do not batch-apply changes silently.
  • Read-only scan first. Always begin by scanning and reporting what fragmentation was found. Never jump straight to writing files.
  • 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.

Rules

  • Prefer creating a clear source of truth
  • Preserve information rather than deleting it
  • Structural coherence matters more than brevity
  • If something is already in the right place, leave it alone
  • Make minimal, high-value reorganizations
  • Only write to files listed in the Allowed Targets section above
  • Never modify skill definitions, SKILL.md files, or files outside the workspace
  • Always present a dry-run summary and wait for user approval before writing any file

Design Goal

Defragmenter exists to restore structural coherence across workspace knowledge.

It is focused on placement, source-of-truth repair, and reassembly of fragmented context across files and layers.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Research

Batch Content Factory

Multi-platform content production line. Automates the entire workflow from topic research to content creation. Suitable for self-media operators producing hi...

Registry SourceRecently Updated
Research

Fund Analyzer Pro

[何时使用]当用户需要基金深度分析时;当用户说"分析这个基金""基金对比""基金诊断""基金经理分析"时;当检测到基金代码/基金名称/投顾策略时触发。整合天天基金 API+ 且慢 MCP,提供单一基金分析/基金比较/基金诊断/持仓诊断/基金经理/机会分析/投资方式/报告信号八大模块。新增信号监控提醒功能(sign...

Registry SourceRecently Updated
Research

FN Portrait Toolkit

Financial report footnote extraction and analysis tool for Chinese A-share listed companies. Use when: (1) User wants to extract financial note data from ann...

Registry SourceRecently Updated
Research

流式AI检索问答技能

通用流式AI检索问答技能 — 为任意行业应用提供四步流式分析交互界面。 触发场景:用户输入关键词 → AI自动执行:理解意图 → 检索知识库 → 流式生成 → 来源标记 → 完整回答。 当需要实现以下任意场景时激活: (1) AI搜索框 / 智能咨询组件重构 (2) 知识库问答(医疗/法律/金融/教育等垂直领域)...

Registry SourceRecently Updated