본문으로 건너뛰기
cccskills
무료GitHub에 공개

safe-rm

Deletes files and directories through a wrapper that avoids the usual per- command permission prompt. Use only when content must genuinely be deleted, such as clearing build artifacts or dropping obsolete files during a refactor. Moves, renames, and relocations that preserve content use mv instead.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Safe File Deletion

When to use this skill

Use this skill only when files or directories must genuinely be deleted. Do not use it to move, rename, or relocate content that should remain; use mv instead.

This skill is particularly useful when:

  • Refactoring code and removing obsolete files or directories
  • Deleting obsolete duplicates after choosing the copy to keep
  • Removing generated files that shouldn't be tracked
  • Deleting obsolete files during 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
  3. 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/

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Applies local reliability, viewport, tab-safety, stale-ref, widget, and browser-boundary lessons to every agent-browser automation. Use alongside the upstream agent-browser skill whenever navigating, clicking, filling, testing, extracting, taking screenshots, or debugging any website with agent-browser.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aspiers/ai-config152026년 10월 9일 업데이트

Size the agent-browser Chromium window to fill its current screen, leaving a configurable bottom margin for the desktop panel. Use before any agent-browser automation that needs the full screen visible without elements overlapping or scrolling off (e.g. Xero, dense web apps).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aspiers/ai-config152026년 10월 9일 업데이트

Create Claude Code slash commands, OpenCode command files, Pi prompt templates, and Codex custom prompts that delegate to the right subagent or skill. Use when creating new commands, porting commands across agent platforms, or refactoring existing commands to follow platform conventions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aspiers/ai-config152026년 10월 9일 업데이트

Adds or changes allowed commands in AI agent permission configs for OpenCode and Claude Code. Use when a command needs adding to an agent's allow list, when permission settings for existing commands need changing, when setting up a new AI tool that requires command permissions, or when the user asks to stop being prompted for a particular command.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aspiers/ai-config152026년 10월 9일 업데이트

bc

무료

Creates a Beads issue for a described problem or piece of work without doing the work itself. Use when the user invokes `/bc` or `$bc`, or asks to file, log, or record a bead for something. To also carry out the work, use the `bx` skill instead.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aspiers/ai-config152026년 10월 9일 업데이트

bdr

무료

Stores a persistent memory or learning with `bd remember` so it survives across sessions. Use when the user invokes `/bdr` or `$bdr`, or asks to remember, note, or persist an insight in a Beads workspace.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aspiers/ai-config152026년 10월 9일 업데이트

aspiers의 스킬 모두 보기

이 스킬의 문제 신고