π§Ή Intelligent workspace cleanup with LLM-powered analysis.
# Manual trigger
/workspace-cleanup
# Or say in chat
"ζΈ
ηδΈδΈ workspace"- π 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
clawhub install workspace-cleanupcd ~/.openclaw/workspace/skills/
git clone https://github.com/alansong63/openclaw-skills.git workspace-cleanup# Already in skills/workspace-cleanup/
# Just commit and tag your changesUser: ζΈ
ηδΈδΈ workspace
β Scans workspace
β LLM generates report
β Sends Feishu confirmation
β Executes after approval
β Sends execution report
Configure in HEARTBEAT.md:
# Every Saturday 3:00 AM
if [ "$(date +%u)" -eq 6 ] && [ "$(date +%H)" -eq 3 ]; then
echo "CLEANUP:weekly"
fiCreate 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/| 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 |
| 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 |
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- MAJOR.MINOR.PATCH (e.g.,
1.0.0) - Breaking changes β MAJOR++
- New features β MINOR++
- Bug fixes β PATCH++
# 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.0skills/- Skill filesmemory/- Memory filesconfig/- Configuration.git/- Git repositories
- Files moved to
.trash/(not deleted) - Retained for 7 days
- Can be restored anytime
| Level | Size | Action |
|---|---|---|
| Low | <10MB | Auto-confirm (if configured) |
| Medium | 10-100MB | Requires confirmation |
| High | >100MB | Requires double confirmation |
# Check logs
cat logs/cleanup.log
# Check permissions
ls -la ~/.openclaw/workspace/# List trash
ls -la .trash/
# Restore manually
mv .trash/YYYYMMDD/* workspace/- Fork the repository
- Create feature branch:
git checkout -b feature/new-feature - Commit changes:
git commit -am 'feat: add new feature' - Push branch:
git push origin feature/new-feature - Open Pull Request
MIT License - see LICENSE for details.
- Issues: https://github.com/alansong63/openclaw-skills/issues
- Discussions: https://github.com/alansong63/openclaw-skills/discussions
- Documentation: https://docs.openclaw.ai/skills/workspace-cleanup
Version: 1.0.0
Last Updated: 2026-03-07
Author: AlanSong