← 返回 Skills 市场
balukov

Defragmenter

作者 Ivan Balukov · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
122
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install defragmenter
功能描述
Structural knowledge defragmentation for OpenClaw workspaces. Finds information, rules, and operational facts that are spread across the wrong files or embed...
使用说明 (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
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install defragmenter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /defragmenter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug defragmenter
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

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。

💬 留言讨论