标准化工作空间目录结构,适用于多代理 OpenClaw 部署,所有代理生成的文件统一存放在 files/ 目录下,保持根目录整洁,并定义相应的位置。
Standardized directory conventions for OpenClaw multi-agent workspaces.
text
workspace/ ← or any agent workspace dir
├── AGENTS.md, SOUL.md ... ← core config (never moved)
├── skills/ ← ClawHub skills
├── memory/ ← long-term memory
├── files/ ← all agent-generated content
│ ├── tmp/ disposable temp files
│ ├── notes/ working docs worth keeping
│ ├── inbox/ deliverables from other agents
│ ├── outbox/ files for owner/other agents
│ ├── archive/ inactive projects
│ └── experts/ (workspace root only) expert engagements
files/{subdir}/. No exceptions.files/outbox/, receiver picks from files/inbox/.SubdirCleanup rulefiles/tmp/Eligible for auto-cleanup at any timefiles/notes/Keep; never auto-cleanfiles/archive/Manual review before removalfiles/experts/Remove after expert engagement endsfiles/inbox/Clear after processing deliverable
All generated files go into files/ subdirectories:
files/tmp/files/notes/files/inbox/ or files/outbox/files/archive/bash
# Check if current workspace has layout violations
python3 {{SKILL_DIR}}/scripts/sweep.py
# JSON output for automation
python3 {{SKILL_DIR}}/scripts/sweep.py --json
bash
python3 {{SKILL_DIR}}/scripts/apply.py --execute
HEARTBEAT.md can include a periodic sweep to catch drift.
scripts/apply.py#Creates files/ and sub-directories, migrates existing files into correct locations.
Auto-detects workspace root vs agent workspace. Dry-run by default.
Agent directories (containing AGENTS.md) are never moved.
scripts/sweep.py#Audits workspace for layout violations. Returns exit code 0 (clean), 1 (warnings), or 2 (violations).