Install
openclaw skills install agent-workspace-managerOrganize and maintain agent workspace directories by initializing structure, classifying files, auditing placement, cleaning content, and suggesting expansions.
openclaw skills install agent-workspace-managerThis skill provides a systematic approach to organizing and maintaining agent workspace directories. It ensures documents are placed in appropriate functional directories, detects structure issues, and maintains content freshness.
Initialize a standardized workspace structure for new agents:
workspace/
├── MEMORY.md # Core memory index (agent reads this first)
├── memory/ # Time-based memory fragments
├── knowledge/ # Stable domain knowledge
│ └── sql/ # Core business SQL (NEW)
├── tasks/ # Temporary/project-specific items
├── decisions/ # Decision records with rationale
├── preferences/ # User preferences and settings
├── archives/ # Expired but preserved content
│ └── sql_versions/ # Historical SQL versions (NEW)
├── templates/ # Reusable templates
│ └── sql/ # Reusable SQL templates (NEW)
└── scripts/ # Scripts and utilities (NEW)
Usage: When setting up a new workspace, create this structure to enable efficient information retrieval.
Every document must be placed in a directory matching its functional purpose:
| Document Type | Directory | Characteristics |
|---|---|---|
| Events, conversations, time-based records | memory/ | Has timestamp, may expire |
| Domain knowledge, technical docs | knowledge/ | Stable, long-term valid |
| Core business SQL | knowledge/sql/ | Long-term used SQL |
| Tasks, todos, project items | tasks/ | Temporary, project-bound |
| Important choices with rationale | decisions/ | Decision history, traceable |
| User habits, preferences | preferences/ | Personalization config |
| Expired but valuable content | archives/ | Preserved for reference |
| Historical SQL versions | archives/sql_versions/ | Deprecated SQL |
| Reusable patterns, templates | templates/ | Copy-paste ready |
| Reusable SQL templates | templates/sql/ | Standard queries |
| Scripts (.py, .sh) | scripts/ | Utility scripts |
Classification Rule: Before creating any document, determine its primary function. Place it in the matching directory. Never place files in incorrect directories.
Code files (SQL, Python, Shell, etc.) must follow these rules:
| File Type | Directory | Purpose |
|---|---|---|
.sql (core business) | knowledge/sql/ | Long-term used SQL queries |
.sql (templates) | templates/sql/ | Reusable standard queries |
.sql (historical) | archives/sql_versions/ | Deprecated SQL versions |
.py (scripts) | scripts/ | Python utility scripts |
.sh (scripts) | scripts/ | Shell utility scripts |
.json (config) | config/ or root | Configuration files |
SQL File Naming Rules:
神策宽表转JSON.sql神策宽表转JSON_v1.sql, 神策宽表转JSON_最终版.sql神策宽表转JSON_修正版.sql, 神策宽表转JSON_完整版.sqlWhen to Create New Version:
archives/sql_versions/ with timestamp if neededknowledge/sql/Run health checks to identify issues:
Output: A report with specific file recommendations.
Detect duplicate files using these methods:
report-v1.md and report-v2.md)_v1, _v2, _final, _修正版, _完整版 etc.Detection Command:
# Find SQL files with version suffixes
find . -name "*.sql" -type f | grep -E "(_v[0-9]|_最终|_完整|_修正|_修复)"
# Find duplicate MD files by name pattern
find . -name "*.md" -type f | grep -E "(_v[0-9]|_最终|_完整)"
Maintain document freshness through:
archives/ with timestampSafety Principle: Never delete content that might contain unique valuable information. Archive instead.
When existing directories cannot accommodate new functional needs:
Example: If knowledge/ grows too large with mixed domain types, split into knowledge/product/, knowledge/technical/, knowledge/business/.
This skill is designed to be copyable across agents: