← Back to Skills Marketplace
balukov

Defragmenter

by Ivan Balukov · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
122
Downloads
1
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install defragmenter
Description
Structural knowledge defragmentation for OpenClaw workspaces. Finds information, rules, and operational facts that are spread across the wrong files or embed...
README (SKILL.md)

\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\r
  • memory/*.md\r
  • CONTAINER_STATE.md\r
  • flows/*.md\r
  • preference files within the current workspace root\r \r Defragmenter must not modify:\r
  • Any file under skills/ or any SKILL.md file (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
Usage Guidance
This skill appears coherent and low-risk, but take these precautions before running it: 1) Backup your workspace (or run in a copy) so you can revert unwanted reorganizations. 2) Carefully review the dry-run report—look specifically for proposals that would copy chat logs or notes into persistent files, since those may contain secrets or PII you do not want written into source-of-truth files. 3) Confirm per-file changes only after verifying they don't leak credentials or sensitive configuration. 4) If you need stricter guarantees, run the defragmentation on a cloned workspace or restrict access to the chat/history sources the agent can read. If you want, I can list what I would look for in a dry-run to help you review it safely.
Capability Analysis
Type: OpenClaw Skill Name: defragmenter Version: 1.0.1 The 'defragmenter' skill is a set of Markdown-based instructions (SKILL.md) designed to guide an AI agent in reorganizing documentation and operational state within a workspace. It includes strong safety constraints, such as mandatory dry-runs, explicit user confirmation for all writes, and strict file-path restrictions that exclude sensitive files like credentials, shell scripts, and skill definitions. No malicious code, data exfiltration logic, or obfuscation techniques were found.
Capability Assessment
Purpose & Capability
Name/description match the runtime instructions: the skill scans workspace content and rewrites or copies fragments into a limited set of allowed target files. It requests no binaries, env vars, or installs, which is reasonable for an instruction-only reorganization utility.
Instruction Scope
SKILL.md confines writes to a specific set of file patterns and explicitly forbids modifying skills, SKILL.md files, executables, .env and credentials. It mandates a dry-run and per-file confirmation. Minor concern: the guidance mentions extracting facts from chat/cron/messages/daily notes — if those sources contain secrets or PII, the skill could propose copying them into persistent files. Review proposed changes carefully before approving writes.
Install Mechanism
No install spec and no code files present. Being instruction-only means nothing is downloaded or written by the skill itself, which is the lowest-risk install posture.
Credentials
No environment variables, credentials, or config paths are requested. The lack of required secrets is appropriate for the declared functionality.
Persistence & Privilege
always:false and disable-model-invocation:false (normal). The skill does not request persistent platform privileges or modify other skills. It asks for user approval before writes, limiting autonomous modifications.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install defragmenter
  3. After installation, invoke the skill by name or use /defragmenter
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Added strict safety and approval procedures: all operations now begin with a dry-run scan and require explicit user confirmation before applying changes. - Introduced "Allowed Targets" list restricting write operations to specific workspace files; skill files and other sensitive files are excluded from modification. - Updated output to provide a detailed proposed change report before any action is taken. - Clarified that no deletions occur and that Defragmenter never modifies files outside approved patterns. - Removed legacy metadata files (README.md, _meta.json) for simplification.
v1.0.0
Initial release of the defragmenter skill for OpenClaw workspaces. - Identifies and reorganizes fragmented knowledge, logic, and operational facts into their proper files and locations. - Rewrites or duplicates information to establish source-of-truth files without deleting existing material. - Targets misplaced logic (e.g., in cron, chat, notes) and consolidates it into structured files (e.g., flows, CONTAINER_STATE.md, preference files). - Focuses on improving structural coherence and clarity of workspace organization. - Provides a clear, concise structural report after each defragmentation run.
Metadata
Slug defragmenter
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Defragmenter?

Structural knowledge defragmentation for OpenClaw workspaces. Finds information, rules, and operational facts that are spread across the wrong files or embed... It is an AI Agent Skill for Claude Code / OpenClaw, with 122 downloads so far.

How do I install Defragmenter?

Run "/install defragmenter" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Defragmenter free?

Yes, Defragmenter is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Defragmenter support?

Defragmenter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Defragmenter?

It is built and maintained by Ivan Balukov (@balukov); the current version is v1.0.1.

💬 Comments