Install
openclaw skills install @mars2003/workspace-governanceA methodology-first workspace governance skill for AI agents. Focuses on principles, decision framework, and safe execution patterns instead of fixed directory templates. Triggers on "organize", "cleanup", "archive", "workspace check", "整理工作区", "清理文件", "归档项目", "太乱了".
openclaw skills install @mars2003/workspace-governanceMethodology-first workspace governance for AI agents.
For Chinese readers:
README.zh-CN.mdreferences/治理手册.zh-CN.mdThis skill teaches an agent how to design a workspace management strategy that fits its own runtime, platform, and user preferences.
This is not a single directory template and not a rigid SOP.
The agent should adapt based on context, then execute safely.
Before execution, the agent should verify runtime capabilities:
ls, move, rename, archive, delete).Preconditions:
workspace_root must be defined (user-provided or default current directory).workspace_root is broad/high-risk, require explicit confirmation before scanning.ask-user items are blocking items.The agent must define these before execution:
workspace_root: the manageable boundary for this task.immutable_dirs: directories that must never be moved/deleted/renamed.protected_files: sensitive files (keys, env, certs, VCS metadata).risk_level: low/medium/high based on destructive potential.If workspace_root is too broad (for example home root), require explicit confirmation before scanning.
The agent should adapt strategy using this order:
Do not force a fixed folder structure unless the user requests standardization.
SKILL_ADAPT:
workspace_root: <path>
immutable_dirs: [dir1, dir2]
protected_files: [pattern1, pattern2]
cache_policy: separate # separate | consolidate
naming_policy: inherit # inherit | enforce
If SKILL_ADAPT.yaml exists, the agent must read it before planning and execution.
If platform profiles exist (for example tools/adapt-profiles/openclaw.yaml), the agent should load the matching profile as an overlay.
Configuration precedence:
SKILL_ADAPT config.If SKILL_ADAPT parsing fails:
Profile merge semantics:
immutable_dirs: union (security items only increase)protected_files: union (protection only increases)destructive_guard: override allowed only when strictness is not reducedBefore any move/delete action, produce a governance plan with:
| Item | Current | Proposed Action | Target | Risk | Reason |
|---|---|---|---|---|---|
| example.tmp | root | delete | — | medium | temporary artifact |
| report-final.docx | root | ask user | docs or archive | low | destination ambiguous |
Use this pattern regardless of platform:
SKILL_ADAPT (if present) and resolve effective policy by precedence.workspace_root, immutable/protected scope).workspace_root only.If multiple user intents exist, process sequentially and reconfirm between destructive batches.
For non-interactive runtimes (cron, background subagent, execute-only environments):
ask-user, the agent must stop with status blocked.pending_decisions list and required user input.fail-fast).Recommended blocked output:
| Item | Proposed Action | Block Reason | Needed Input |
|---|---|---|---|
| report-final.docx | ask-user | no confirmation channel | choose destination |
Use heuristics, not hard-coded folders:
Rules:
.git/, .svn/, .hg/)*.key, *.pem, *.p12, private credentials).env and equivalents)Goal: improve discoverability and reduce clutter with minimal disturbance.
Goal: initialize a new work area aligned with existing conventions.
Goal: transition inactive work into retrievable cold storage with metadata.
Goal: audit quality signals and output fix recommendations.
Note: The agent should choose implementation details based on local system constraints, not this document's examples.
workspace-governance can run standalone, but some scenarios may benefit from companion skills/tools:
Interoperability rule:
blocked with required dependency.Recommended checks:
Output style:
The agent should keep a lightweight operation record, including:
YYYY-MM-DD)Each execution should create:
checkpoint_before).checkpoint_batch_<n>).checkpoint_after).Minimum log fields:
timestamp (YYYY-MM-DD HH:mm:ss)intent (organize/create/archive/audit)batch_idaction (move/rename/archive/delete)source_pathtarget_pathresult (success/failure/blocked)reversible (yes/no)rollback_ref (checkpoint id or recovery note)Example principles in action:
ask-user.This example is illustrative, not normative.