Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

alansong63/workspace-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Workspace Cleanup Skill

🧹 Intelligent workspace cleanup with LLM-powered analysis.

Version License OpenClaw

Quick Start

# Manual trigger
/workspace-cleanup

# Or say in chat
"清理一下 workspace"

Features

  • πŸ” Intelligent Scanning - Identifies temp files, backups, old outputs
  • 🧠 LLM Analysis - Risk assessment and cleanup recommendations
  • βœ… Safe Cleanup - Moves to trash, not direct deletion
  • πŸ”„ Restore - Recover files within 7 days
  • πŸ“Š Reports - Detailed cleanup reports with statistics
  • πŸ”” Notifications - Feishu cards for confirmation

Installation

Option 1: From ClawHub

clawhub install workspace-cleanup

Option 2: Manual Clone

cd ~/.openclaw/workspace/skills/
git clone https://github.com/alansong63/openclaw-skills.git workspace-cleanup

Option 3: Local Development

# Already in skills/workspace-cleanup/
# Just commit and tag your changes

Usage

Manual Cleanup

User: 清理一下 workspace

β†’ Scans workspace
β†’ LLM generates report
β†’ Sends Feishu confirmation
β†’ Executes after approval
β†’ Sends execution report

Scheduled Cleanup

Configure in HEARTBEAT.md:

# Every Saturday 3:00 AM
if [ "$(date +%u)" -eq 6 ] && [ "$(date +%H)" -eq 3 ]; then
    echo "CLEANUP:weekly"
fi

Configuration

Create EXTEND.md:

cleanup:
  enabled: true
  schedule: "weekly"
  auto_confirm_threshold_mb: 10
  trash_retention_days: 7
  max_cleanup_size_mb: 100
  protected_dirs:
    - skills/
    - memory/
    - config/

Scripts

Script Purpose
scan.sh Scan workspace and collect file info
analyze.js LLM analysis and risk assessment
cleanup.sh Execute cleanup (move to trash)
restore.sh Restore files from trash

Output Files

File Description Retention
CLEANUP-REPORT-*.md Analysis report Permanent
CLEANUP-EXECUTION-*.md Execution report Permanent
.trash/YYYYMMDD/ Recycle bin 7 days
logs/cleanup.log Cleanup logs 30 days

Version Control

This skill is version-controlled with Git:

# Check version
cat _meta.json | grep version

# View changes
git log --oneline

# Update to latest
git pull origin main

Versioning Strategy

  • MAJOR.MINOR.PATCH (e.g., 1.0.0)
  • Breaking changes β†’ MAJOR++
  • New features β†’ MINOR++
  • Bug fixes β†’ PATCH++

Release Process

# 1. Update CHANGELOG.md
# 2. Update _meta.json version
# 3. Commit
git commit -am "chore: bump version to 1.0.0"

# 4. Tag
git tag v1.0.0

# 5. Push
git push origin main v1.0.0

Safety Features

Protected Directories

  • skills/ - Skill files
  • memory/ - Memory files
  • config/ - Configuration
  • .git/ - Git repositories

Trash Mechanism

  • Files moved to .trash/ (not deleted)
  • Retained for 7 days
  • Can be restored anytime

Risk Levels

Level Size Action
Low <10MB Auto-confirm (if configured)
Medium 10-100MB Requires confirmation
High >100MB Requires double confirmation

Troubleshooting

Issue: Cleanup failed

# Check logs
cat logs/cleanup.log

# Check permissions
ls -la ~/.openclaw/workspace/

Issue: Can't restore files

# List trash
ls -la .trash/

# Restore manually
mv .trash/YYYYMMDD/* workspace/

Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/new-feature
  3. Commit changes: git commit -am 'feat: add new feature'
  4. Push branch: git push origin feature/new-feature
  5. Open Pull Request

License

MIT License - see LICENSE for details.

Support


Version: 1.0.0
Last Updated: 2026-03-07
Author: AlanSong

About

OpenClaw Skill: Workspace cleanup tool

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors