home / skills / openclaw / skills / file-cleaner
/skills/autogame-17/file-cleaner
This skill safely removes temporary files and directories within temp/, logs/, and cache/ to free space while guarding critical workspace.
npx playbooks add skill openclaw/skills --skill file-cleanerReview the files below or copy the command above to add this skill to your agents.
---
name: file-cleaner
description: A specialized skill for safely cleaning up temporary files and directories. Use this when you need to remove temp files, clear caches, or delete logs to free up space or maintain hygiene. Restricted to 'temp/', 'logs/', and 'cache/' directories for safety.
---
# File Cleaner
Safely removes files and directories. Built with strict safety checks to prevent accidental deletion of critical workspace files.
## Usage
```bash
node skills/file-cleaner/index.js <path>
```
## Examples
Clean a specific temp directory:
```bash
node skills/file-cleaner/index.js temp/my-experiment
```
Clean a log file:
```bash
node skills/file-cleaner/index.js logs/debug.log
```
## Safety
- ONLY deletes paths starting with `temp/`, `logs/`, or `cache/`.
- Will block attempts to delete workspace root, `skills/`, or other protected paths.
This skill safely cleans temporary files, caches, and logs to free disk space and maintain workspace hygiene. It enforces strict path restrictions so only items under temp/, logs/, or cache/ can be removed. Designed for automated maintenance or ad-hoc cleanup tasks, it prevents accidental deletion of critical workspace files.
The skill inspects the target path and verifies it begins with one of the allowed prefixes: temp/, logs/, or cache/. It blocks any request that targets the workspace root, the skills/ directory, or other protected paths. When a path passes validation the skill deletes files or directories under that path and reports the result.
Can this skill delete files outside temp/, logs/, or cache/?
No. It only allows paths starting with temp/, logs/, or cache/ and will block protected directories like the workspace root and skills/.
Is there a dry-run or preview mode?
Prefer listing target contents before deletion. If a dry-run option is available in your integration, use it to verify what will be removed.