Skip to content
Back to skills

Delete Path

BSecurity

Delete a file or directory (recursively if directory)

  • 12 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 13, 2026
ai-agentsgobash

Security analysis

B85/100
  • highPerforms destructive filesystem operations

Pro shows the line behind each finding and how to fix it

Scanned November 13, 2026

npx -y skills add theonlyamos/cognitrix --skill delete-path --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Delete Path?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Delete Path
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/theonlyamos-delete-path/badge)](https://www.skillsdirectory.com/skills/theonlyamos-delete-path)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: delete-path
description: Delete a file or directory (recursively if directory)
context: fork
args:
  - name: path
    description: Path to the file or directory to delete
    required: true
tags: [delete, remove, rm]
category: system
version: "1.0.0"
author: cognitrix
allowed-tools: [bash]
safety:
  risk-level: high
---

# Delete Path

Delete a file or directory.

## Steps

1. Determine if path is a file or directory:
   - If file: use `rm "$(arg path)"`
   - If directory: use `rm -r "$(arg path)"`
2. First, check if path exists with `ls -ld "$(arg path)"` 
3. Confirm deletion was successful with `ls` to verify file/dir is gone
4. Report the result

## Safety

- Always verify the path exists before deleting
- For directories, use `-r` for recursive deletion (removes all contents)
- Use `-i` flag for interactive mode (prompts before each deletion): `rm -ri`
- Use `-f` to force and ignore non-existent files: `rm -rf`

## Notes

- This action is irreversible - deleted files cannot be recovered
- Be careful with wildcards (e.g., `rm *` deletes everything in current directory)
- Consider using `ls` first to verify what will be deleted

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.