首页/ AI 技能 / @skilllib/skill-2117939930272411703
Skill站外收录 @skilllib/skill-2117939930272411703

safe-file-deletion

在执行任何文件删除操作前强制要求用户明确授权,覆盖单个文件、多个文件及目录的移除场景,确保所有删除行为均经过显式确认,杜绝绕过机制或隐式清理行为。

0.0 (0) 20 次安装 原作者 编程导航
收录于 2026-01-22
测试与安全 AI 技能

Skills.MD

# Safe File Deletion ## Rule Before deleting ANY file, you MUST: 1. Call `request_file_permission` with `operation: "delete"` 2. For multiple files, use `filePaths` array (not multiple calls) 3. Wait for response 4. Only proceed if "allowed" 5. If "denied", acknowledge and do NOT delete ## Applies To - `rm` commands (single or multiple files) - `rm -rf` (directories) - `unlink`, `fs.rm`, `fs.rmdir` - Any script or tool that deletes files ## Examples Single file: ```json { "operation": "delete", "filePath": "/path/to/file.txt" } ``` Multiple files (batched into one prompt): ```json { "operation": "delete", "filePaths": ["/path/to/file1.txt", "/path/to/file2.txt"] } ``` ## No Workarounds Never bypass deletion warnings by: - Emptying files instead of deleting - Moving to hidden/temp locations - Using obscure commands The user will see a prominent warning. Wait for explicit approval.

评论 0

还没有评论,来抢沙发。