Token导航 LogoToken导航TokenDH.com
开发权限需确认github未标认证来源可访问许可证需确认审计异常

safe-rm安全室

Agent Skill

safe-rm 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

279

周安装

12

GitHub Stars

10

下载量

98
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:safe-rm(安全室)
来源仓库:https://github.com/aspiers/ai-config
仓库路径:skills/safe-rm
安装命令:
npx skills add https://github.com/aspiers/ai-config --skill safe-rm
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/aspiers/ai-config --skill safe-rm

简介

safe-rm 用于安全删除文件或目录,采用智能备份策略防止误删后无法恢复。

  • 适用于重构时清理废弃文件、移除重复项或整理大型代码库的场景,比常规 rm 更安全。
  • 它通过 ai-safe-rm 脚本执行操作,支持递归删除目录,并保留原始内容于临时备份位置。
  • 默认不要求用户逐项确认,但会记录操作日志以便审计;生产环境使用前建议测试验证机制。
  • 涉及敏感数据时应先脱敏再执行,并确保备份存储位置符合安全合规要求。

SKILL.md

Safe File Deletion

When to use this skill

Whenever deletion of files or directories is required, this is quicker than usual methods which typically require asking the user for permission.

This skill is particularly useful when:

  • Refactoring code and removing obsolete files or directories
  • Cleaning up duplicate or renamed files
  • Removing generated files that shouldn't be tracked
  • Performing large-scale code reorganization
  • Deleting entire directories of old code

How it works

It runs the ai-safe-rm script which has an intelligent git-aware backup strategy. Use -r flag for directories.

Behavior

For files:

  1. Tracked in git, unmodified: Files are deleted directly (can be recovered from git)
  2. Tracked in git, modified: Files are moved to .safe-rm/<path>/<filename>.<hash>.<ext> (e.g., README.b72ae922.md) or .safe-rm/<path>/<filename>.<hash> (e.g., LICENSE.88fdc130) to preserve the modified version
  3. Not tracked in git: Files are moved to .safe-rm/<path>/<filename>.<hash>.<ext> or .safe-rm/<path>/<filename>.<hash> for safety

For directories (requires -r flag):

  1. All files unmodified tracked: Directory is deleted directly with rm -rf (can be recovered from git)
  2. Contains modified tracked or untracked files: The script recurses through the directory, applying the file logic to each file individually. Only modified/untracked files are backed up, while unmodified tracked files are deleted. Empty directories are removed after processing.

The <hash> is the first 8 characters of the MD5 sum of the file content, ensuring unique backups of different versions.

Limitations

Only use this skill for files/directories within the current git repository.

For files outside the repository:

  • Use regular rm or rm -rf directly
  • These files cannot be recovered from git or backed up by this script

Pre-check before calling:

Before running ai-safe-rm, verify all paths are within the repo:

# Verify path is inside current repo
git rev-parse --is-inside-work-tree && realpath --relative-to="$(git rev-parse --show-toplevel)" /path/to/file | grep -q '^[^.]' && echo "Inside repo" || echo "Outside repo"

Usage

When you need to delete files or directories as part of a refactoring or cleanup task:

  1. Identify the files/directories to delete
  2. Call ai-safe-rm [-r] <file1> <file2>... to safely remove them

- Use -r flag when deleting directories - Without -r, attempting to delete a directory will error

  1. The script will output what action was taken for each file/directory

Important Notes

  • This skill does NOT require user permission for deletion because:

- Unmodified tracked files can be recovered from git - Modified/untracked files are backed up to .safe-rm/

  • The .safe-rm/ directory should be added to .gitignore
  • Backed up files can be restored manually if needed from .safe-rm/

Examples

All examples assume files are within the current git repository:

# Delete a single file
ai-safe-rm src/old-component.ts

# Delete multiple files
ai-safe-rm src/legacy/*.js

# Delete a directory
ai-safe-rm -r ./old-feature

# Delete multiple directories and files
ai-safe-rm -r ./tests/deprecated ./legacy src/unused.ts

For files outside the repository, use rm directly:

# Delete file outside repo
rm /home/user/.cache/temp-file.txt

# Delete directory outside repo
rm -rf /tmp/build-artifacts/

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.92%
按下载量换算36

Claude

30.21%
按下载量换算30

Cursor

18.91%
按下载量换算19

Gemini CLI

9.47%
按下载量换算9

安全审计

Gen Agent Trust Hub

未通过

Socket

未通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills