Workspace Hygiene for Openclaw

A safe and automated workspace cleaning skill that inventories, reviews, and archives temporary build files, caches, and logs in coding repositories.

hollis9087
v0.1.2
May 31, 2026
0
774
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install agent-workspace-hygiene

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install agent-workspace-hygiene using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Workspace Hygiene?

Workspace Hygiene is a specialized tool designed to keep your development environment tidy, efficient, and free of clutter without rewriting or endangering your project code. Operating seamlessly within repository-based workflows, this skill helps developers and AI agents execute safe, non-destructive cleanups of untracked build artifacts, temporary caches, test reports, and log files. By prioritizing safety and keeping operations quiet and cheap, it ensures your project directories remain optimized without interrupting normal coding workflows.

As part of the broader suite of Openclaw Skills, Workspace Hygiene introduces a recovery-first approach. Instead of permanently deleting your data, it default-archives approved items to a local directory with a detailed manifest. This ensures that any accidental cleanups can be immediately restored, giving developers total peace of mind when executing dry runs or automated disk-space cleanups.

Workspace Hygiene Use Cases

  • Freeing up disk space by cleaning heavy build outputs like node_modules/.cache, .next/cache, or dist folders.
  • Running dry-run inventories before major git commits to identify untracked or ignored junk files.
  • Archiving test-related clutter, including playwright-reports, coverage data, and temporary databases.
  • Safely managing and review-clearing scratch files generated by autonomous AI agents during development.
  • Organizing legacy development repositories that have accumulated stale .bak, .tmp, or .rej files over time.

How Workspace Hygiene Works

  1. Trigger on Demand: The skill remains completely silent during ordinary development and only activates when you explicitly request a workspace cleanup, dry run, or disk inventory.
  2. Locate Workspace Root: It accurately identifies the current repository root to avoid scanning or affecting your home directory or unrelated neighbor projects.
  3. Run a Cheap Inventory: Using an optimized Python helper script, it scans the repository to categorize artifacts into safe-to-clean, review-required, or protected statuses without heavy computation.
  4. Generate Compact Plan: The system presents a minimal summary outlining the findings, specifying what is safe to remove, what needs approval, and what is protected.
  5. Recoverable Archive: Upon your explicit confirmation, the skill packages safe candidates into a timestamped .codex-cleanup/archive/ directory and writes an audit manifest.
  6. Post-Cleanup Verification: It double-checks git status or directory trees to verify space savings and confirms the successful execution of the cleanup plan.

Workspace Hygiene Setup

To configure and run the Workspace Hygiene skill, ensure you have Python and Git available in your environment. You can initialize the inventory check or run a dry-run cleanup directly via the command line.

Execute the workspace inventory script to inspect target artifacts safely:

python ./scripts/workspace_inventory.py --root . --summary-json --max-entries 40 --recent-hours 24

To apply automated project-specific skip rules, you can define an optional configuration file named .workspace-hygiene.yml in your repository root with customized keep/skip patterns.

Workspace Hygiene Data Schema & Taxonomy

The Workspace Hygiene skill organizes all generated logs, cleanup actions, and archived files inside a standardized local directory structure to ensure transparency and easy recovery.

Directory Structure

Directory/File Description
.codex-cleanup/ Main directory for all cleanup-related outputs.
.codex-cleanup/archive/<timestamp>/ Contains the raw archived directories and files safely moved out of active workspace roots.
.codex-cleanup/archive/<timestamp>/manifest.json An audit log cataloging files before removal.

Manifest Taxonomy

The manifest.json preserves critical metadata for every moved artifact:

  • original_path: The source file location before archival.
  • size: The file size in bytes to calculate exact disk savings.
  • modified_time: Last modification date to help with manual restoration.
  • action: The specific operation executed (e.g., archived, skipped).

Workspace Hygiene Advanced Features

  • Smart Manifest Archival: Moves target files to a timestamped archive path rather than executing destructive hard-deletions, ensuring cleanups are fully reversible.
  • Configuration Overrides: Supports a .workspace-hygiene.yml config file to define custom ignore, keep, or automated skip filters for complex repository layouts.
  • Secret & Credential Isolation: Automatically protects files containing potential credentials, tokens, and local configuration environments like .env without exposing path names.
  • Integration with Openclaw Skills: Designed to coordinate with other agentic tools to keep logs clear and workspace footprints light during continuous integration runs.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*