🦀 ClawHub
RedHat File Operations
by @mzfshark
Perform safe, auditable file operations with path validation and backups.
TERMINAL
clawhub install axodus-file-operations📖 About This Skill
name: file-operations description: Perform safe, auditable file operations with path validation and backups. metadata: author: RedHat Dev version: 1.0.0 owner: RedHat Dev Agent category: execution
SKILL: file-operations
Purpose
Perform safe, auditable file operations (read/write/update/delete/move/copy) in an MCP-enabled environment with path validation and backups.When to Use
Inputs
operation (required, enum: read|write|update|delete|move|copy).paths (required, object):source (optional, string)
- target (optional, string)
- targets (optional, string[])
content (optional, string): for write/update.backup (optional, boolean, default: true for overwrite/delete).constraints (optional, string[]): e.g., “only within workspaceâ€.Steps
1. Resolve absolute paths and normalize. 2. Validate scope: - operation stays inside the intended workspace root(s) - block path traversal/suspicious targets 3. Preflight: - confirm existence for read/update/delete - confirm non-existence (or allow overwrite explicitly) for write/move 4. If overwrite/delete andbackup=true, create a backup copy (timestamped).
5. Execute the operation with explicit reporting (what changed).
6. Post-validate:
- file exists where expected
- content/diff matches expectationValidation
Output
operation: ""
affected: [""]
backup_paths: [""]
result: "success|blocked|failed"
notes: ["..."]
Safety Rules
Example
Update a config file:operation: updatepaths: { target: "apps/api/.env.example" }⚡ When to Use
💡 Examples
Update a config file:
operation: updatepaths: { target: "apps/api/.env.example" }