Workspace Review
A self-audit process to verify workspace files follow OpenClaw conventions and haven't drifted into non-standard patterns.
When to Run
- - Periodically (weekly or after major changes)
- When asked to "review", "audit", or "check" workspace
- After bootstrap or significant reorganization
- During heartbeat maintenance cycles
Review Process
1. Structure Check
Verify expected files exist in correct locations:
CODEBLOCK0
Note on BOOT.md vs BOOTSTRAP.md:
- -
BOOT.md — Persistent; runs every gateway restart (if boot-md hook enabled) - INLINECODE2 — One-time; agent follows it on first run, then deletes it
Check: Run ls -la on workspace root. Flag missing required files.
2. File Purpose Audit
Each file has ONE job. Check for scope creep:
| File | Should Contain | Should NOT Contain |
|---|
| AGENTS.md | Operating instructions, memory workflow, behavior rules | Personal memories, daily logs, tool configs |
| SOUL.md |
Persona, tone, boundaries, identity philosophy | Task lists, technical details, credentials |
| USER.md | User profile, preferences, how to address them | Agent memories, system config |
| IDENTITY.md | Name, emoji, vibe, external identities (wallets, handles) | Instructions, memories |
| TOOLS.md | Environment-specific notes (camera names, SSH hosts, voices) | Skill instructions, operating procedures |
| HEARTBEAT.md | Short checklist for periodic checks | Long procedures, full documentation |
| MEMORY.md | Curated lessons, key context, important people/projects | Daily logs, raw notes |
| memory/*.md | Daily logs, raw notes, session summaries | Long-term curated memories |
Check: Skim each file. Flag content in wrong location.
3. Memory Hygiene
- - [ ] Daily files use
YYYY-MM-DD.md or YYYY-MM-DD-slug.md format - [ ] Hook-generated session files (
session-memory hook creates YYYY-MM-DD-slug.md) reviewed periodically - [ ] Reference docs use descriptive names (not dates):
project-notes.md, INLINECODE9 - [ ] MEMORY.md contains curated insights, not raw logs
- [ ] No duplicate information across MEMORY.md and daily files
- [ ] Old daily files reviewed and distilled to MEMORY.md periodically
- [ ] No sensitive data (API keys, passwords) in memory files
Automatic Memory Flush: OpenClaw triggers a silent agent turn before session compaction to write durable memories. The agent receives a prompt to flush important context to memory/YYYY-MM-DD.md. This is automatic — no action needed, but be aware your context WILL be compacted after ~180k tokens.
4. Vector Search Alignment
- - [ ] Only
MEMORY.md and memory/**/*.md are indexed by default - [ ] Daily logs use
YYYY-MM-DD.md; reference docs use descriptive names - [ ] Files outside
memory/ can be indexed via memorySearch.extraPaths in config
Session Memory (Experimental): If memorySearch.experimental.sessionMemory = true, session transcripts are also indexed and searchable via memory_search.
5. Git Status
⚠️ This workspace is PRIVATE. Never push to GitHub or any public remote.
CODEBLOCK1
- - [ ] No remote configured (or only private backup)
- [ ] No untracked files that should be tracked
- [ ] No tracked files that should be gitignored
- [ ] No uncommitted changes lingering for days
- [ ] .gitignore excludes secrets (.key, .pem, .env, secrets*)
6. Rogue Files Check
Look for files that don't fit the standard layout:
CODEBLOCK2
Flag anything that:
- - Duplicates bootstrap file purposes (e.g., README.md alongside AGENTS.md)
- Stores credentials in workspace (should be in ~/.openclaw/credentials/)
- Creates non-standard directories without clear purpose
Note: Only MEMORY.md and memory/**/*.md are vector-indexed. Files outside memory/ can be added via memorySearch.extraPaths in config.
7. Size Check
Bootstrap files should be lean (loaded every session):
- - AGENTS.md: < 500 lines ideal, < 1000 max
- SOUL.md: < 200 lines ideal
- USER.md: < 100 lines ideal
- IDENTITY.md: < 50 lines ideal
- HEARTBEAT.md: < 100 lines (token burn concern)
CODEBLOCK3
8. Skills Check
If skills/ exists:
- - [ ] Each skill has SKILL.md with valid frontmatter (name, description)
- [ ] No duplicate skills (workspace vs managed)
- [ ] Skills follow progressive disclosure (lean SKILL.md, references for details)
Output Format
After review, report:
CODEBLOCK4
References
工作区审查
一种自我审计流程,用于验证工作区文件遵循OpenClaw规范,且未偏离至非标准模式。
何时运行
- - 定期(每周或在重大变更后)
- 当被要求审查、审计或检查工作区时
- 在引导或重大重组之后
- 在心跳维护周期期间
审查流程
1. 结构检查
验证预期文件存在于正确位置:
~/.openclaw/workspace/
├── AGENTS.md ← 操作指令(必需)
├── SOUL.md ← 角色/语气(必需)
├── USER.md ← 用户档案(必需)
├── IDENTITY.md ← 代理名称/氛围/表情符号(必需)
├── TOOLS.md ← 本地工具说明(必需)
├── HEARTBEAT.md ← 心跳检查清单(可选)
├── MEMORY.md ← 精选长期记忆(可选)
├── BOOT.md ← 网关重启时运行(可选,boot-md钩子)
├── BOOTSTRAP.md ← 一次性首次运行仪式(使用后删除)
├── memory/ ← 每日日志 + 参考文档(向量索引)
│ └── YYYY-MM-DD.md
└── skills/ ← 工作区特定技能(可选)
关于BOOT.md与BOOTSTRAP.md的说明:
- - BOOT.md — 持久存在;每次网关重启时运行(如果启用了boot-md钩子)
- BOOTSTRAP.md — 一次性;代理在首次运行时遵循,然后删除
检查: 在工作区根目录运行ls -la。标记缺失的必需文件。
2. 文件用途审计
每个文件只有一个职责。检查范围蔓延:
| 文件 | 应包含内容 | 不应包含内容 |
|---|
| AGENTS.md | 操作指令、记忆工作流、行为规则 | 个人记忆、每日日志、工具配置 |
| SOUL.md |
角色、语气、边界、身份理念 | 任务列表、技术细节、凭证 |
| USER.md | 用户档案、偏好、如何称呼他们 | 代理记忆、系统配置 |
| IDENTITY.md | 名称、表情符号、氛围、外部身份(钱包、账号) | 指令、记忆 |
| TOOLS.md | 环境特定说明(摄像头名称、SSH主机、语音) | 技能指令、操作流程 |
| HEARTBEAT.md | 用于定期检查的简短清单 | 长流程、完整文档 |
| MEMORY.md | 精选经验、关键上下文、重要人物/项目 | 每日日志、原始笔记 |
| memory/*.md | 每日日志、原始笔记、会话摘要 | 长期精选记忆 |
检查: 浏览每个文件。标记内容位置错误的情况。
3. 记忆卫生
- - [ ] 每日文件使用YYYY-MM-DD.md或YYYY-MM-DD-slug.md格式
- [ ] 钩子生成的会话文件(session-memory钩子创建YYYY-MM-DD-slug.md)定期审查
- [ ] 参考文档使用描述性名称(非日期):project-notes.md、api-guide.md
- [ ] MEMORY.md包含精选洞察,而非原始日志
- [ ] MEMORY.md和每日文件之间无重复信息
- [ ] 旧的每日文件定期审查并提炼至MEMORY.md
- [ ] 记忆文件中无敏感数据(API密钥、密码)
自动记忆刷新: OpenClaw在会话压缩前触发一次静默代理轮次以写入持久记忆。代理会收到提示,将重要上下文刷新至memory/YYYY-MM-DD.md。这是自动的——无需操作,但请注意您的上下文将在约18万token后被压缩。
4. 向量搜索对齐
- - [ ] 默认仅索引MEMORY.md和memory//*.md
- [ ] 每日日志使用YYYY-MM-DD.md;参考文档使用描述性名称
- [ ] memory/之外的文件可通过配置中的memorySearch.extraPaths进行索引
会话记忆(实验性): 如果memorySearch.experimental.sessionMemory = true,会话记录也会被索引并通过memory_search进行搜索。
5. Git状态
⚠️ 此工作区为私有。切勿推送到GitHub或任何公共远程仓库。
bash
cd ~/.openclaw/workspace && git status
- - [ ] 未配置远程仓库(或仅配置私有备份)
- [ ] 无应被跟踪的未跟踪文件
- [ ] 无应被gitignore忽略的已跟踪文件
- [ ] 无持续数日未提交的更改
- [ ] .gitignore排除机密文件(.key, .pem, .env, secrets*)
6. 异常文件检查
查找不符合标准布局的文件:
bash
ls -la ~/.openclaw/workspace/
标记任何:
- - 重复引导文件用途的内容(例如,README.md与AGENTS.md并存)
- 在工作区存储凭证(应放在~/.openclaw/credentials/)
- 创建无明确用途的非标准目录
注意: 仅MEMORY.md和memory//*.md被向量索引。memory/之外的文件可通过配置中的memorySearch.extraPaths添加。
7. 大小检查
引导文件应保持精简(每次会话加载):
- - AGENTS.md:理想<500行,最大<1000行
- SOUL.md:理想<200行
- USER.md:理想<100行
- IDENTITY.md:理想<50行
- HEARTBEAT.md:<100行(token消耗考量)
bash
wc -l AGENTS.md SOUL.md USER.md IDENTITY.md HEARTBEAT.md TOOLS.md MEMORY.md 2>/dev/null
8. 技能检查
如果存在skills/:
- - [ ] 每个技能都有包含有效前置元数据(名称、描述)的SKILL.md
- [ ] 无重复技能(工作区 vs 托管)
- [ ] 技能遵循渐进式披露(精简的SKILL.md,详细内容通过引用)
输出格式
审查后,报告:
工作区审查 — YYYY-MM-DD
✅ 通过
⚠️ 警告
❌ 问题
📋 建议
参考