360 Secure SkillHub
360 安全技能中心

Workspace Hygiene Publish

对指定工作区执行结构与文件审计、记忆健康检查(条目格式、日志缺口、MEMORY.md 行数)及项目 README 完整性核查,输出含违规项与优先建议的健康报告;仅时间戳格式记忆文件会被自动合并,其余问题只标记待人工处理。依赖 python3,可手动运行或按周计划运行。

stevemichael001
stevemichael001
热度 81.28
最近更新 2026-05-11 17:31:50
分类:效率依赖:代码执行 / 读写文件应用场景:工作流 / 报告撰写 / 笔记整理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add workspace-hygiene
Metadata
name
workspace-hygiene
version
0.1.0
description
Audit and maintain workspace file structure, memory quality, and project documentation. Use when: cleaning up the workspace, running a file audit, checking memory health, ensuring project READMEs exist, or during weekly Monday heartbeat. Triggers: "clean up workspace", "run hygiene", "audit files", "workspace health", "check file structure", or scheduled Monday heartbeat.
metadata
{"openclaw":{"emoji":"🧹","requires":{"bins":["python3"]},"os":["linux","darwin"]}}

Workspace Hygiene

Maintains clean, RAG-friendly workspaces across all agents. Runs on demand or weekly.

Quick Start

python3 skills/workspace-hygiene/scripts/hygiene.py --workspace ~/.openclaw/workspace

Or for a specific agent:

python3 skills/workspace-hygiene/scripts/hygiene.py --workspace ~/.openclaw/workspace-claire

What It Does

1. Structure Audit

Reads STRUCTURE.md from the workspace root. Scans for:

  • Files at root that aren't agent config (AGENTS.md, SOUL.md, etc.)
  • Folders that don't match the canonical layout
  • Files in wrong locations (e.g. Claire scripts in Maggie's workspace)

2. Memory Health

Scans memory/ for:

  • Files using timestamp format (YYYY-MM-DD-HHMM.md) instead of date or topic
  • Daily logs older than 30 days that haven't been distilled into MEMORY.md
  • Gaps in daily logging (missing dates during active periods)
  • MEMORY.md line count — flag if over 150

3. Project README Audit

Checks every folder in projects/ for a README.md. Missing READMEs degrade RAG retrieval — memory_search can't find project context without them.

4. Memory Format Check

Validates that recent memory entries (last 7 days) use the tagged format:

[DECISION] What was decided and why
[FACT] A durable fact worth retaining
[PROJECT] Project name — status update
[RULE] A rule or preference established
[EVENT] Something that happened

Untagged entries are flagged for manual review, not auto-tagged.

5. Health Report

Writes a report to projects/system/hygiene-YYYY-MM-DD.md with:

  • Structure violations (with suggested fixes)
  • Memory health score
  • Missing project READMEs
  • Untagged memory entries
  • Recommended actions (prioritized)

Auto-Fix vs Flag

Issue Action
Timestamp-format memory files Auto-consolidate into date file
Missing project README Flag — agent should write it with project context
Files in wrong location Flag with suggested move command
MEMORY.md over 150 lines Flag for manual trimming
Root-level junk files Flag with suggested archive command
Untagged memory entries Flag — don't auto-tag (context needed)

Deployment

Install to each agent workspace's skills/ folder, or install to ~/.openclaw/skills/ for global access.

Add to HEARTBEAT.md:

## Weekly Hygiene (Monday)
- Run `python3 skills/workspace-hygiene/scripts/hygiene.py --workspace <path>`
- Review the report at projects/system/hygiene-YYYY-MM-DD.md
- Fix flagged issues or escalate to Steve

Reference Docs

File Purpose
memory-format.md Canonical memory entry format and tagging rules
rag-index.md How to write project READMEs for optimal RAG retrieval
audit.md Detailed audit rules and canonical structure