git-repo-delete-check
БесплатноБез исполняемых скриптовНе проверенVerify a repo's work survives deletion — remote, unpushed commits, stashes — then offer a push or tar backup. Use when asked to rm -rf, delete, or prune a git…
от laurigates★ 61 звезда на GitHubОб этом скилле
/git:repo-delete-check
When to Use This Skill
| Use this skill when... | Use the alternative when... |
|---|---|
Deleting, rm -rf-ing, or pruning a whole git checkout |
Use deadbranch to delete stale branches inside a repo that stays |
| Checking a checkout for a remote, unpushed commits, and stashes before removal | Use git-coworker-check to find out whether another agent is writing in the checkout |
| Offering a push or tar backup before a clone cleanup | Use macos-plugin:macos-disk-usage or linux-plugin:linux-disk-usage to find what fills the disk |
Run this before any deletion of a git checkout — rm -rf, a cleanup
sweep over old clones, or a disk-space prune.
Before rm -rf'ing a git repository, verify that its work is preserved
somewhere else. A local checkout that has no remote is the only copy —
deletion is permanent and silently destroys committed history plus all
uncommitted work.
Preflight check
git -C <repo> remote -v
| Output | Meaning | Action |
|---|---|---|
Has origin <url> |
Pushed work lives on the remote | Local delete is safe; uncommitted work and unpushed commits are still lost — surface them first |
| Empty / no output | Local-only repo | Stop. The repo's entire history is in this checkout |
Always run this check before deleting, even when the user has explicitly said "delete this repo" — they may not realize a particular checkout is local-only.
When the repo is local-only
Surface the situation and offer three options, in increasing destructiveness, before doing anything:
- Push to a new GitHub repo first. Preserves the work on the remote, then the local checkout can be deleted safely. Requires creating the GitHub repo (or knowing it exists empty).
- Tar to a labelled backup.
tar -czf ~/Backups/<name>-$(date -I).tar.gz <repo>. Preserves the work on disk under a date-stamped name; the local checkout can then be deleted. - Delete with no backup. Confirm the user genuinely wants the work gone — including any uncommitted files, branches, and stashes.
Default when the user says a generic "go" / "yes" without specifying: option 2 (tar backup, then delete). It preserves the work without requiring remote setup or losing anything, and the backup can be deleted later when confidence builds.
Also surface before deleting
Even when a remote exists, these conditions warrant a pause:
- Uncommitted changes.
git status --porcelainis non-empty — those files are not on any remote. - Unpushed commits.
git log @{u}..HEAD --onelineis non-empty — those commits exist only locally. - Stashes.
git stash listis non-empty — stashes are pure working-copy state. - Untracked branches.
git branch -vvshows branches without upstreams — those branches' commits may be local-only.
If any are present, list them in the same message as the deletion prompt so the user can decide knowing what disappears.
Rationale
The general system-prompt rule ("destructive operations need confirmation") covers the spirit. This rule is the concrete check to run before nuking a repo: the failure mode of skipping it is silent permanent data loss, with no way to recover.
Related
hooks-pluginrepo-deletion-safety.sh— the deterministic enforcement half. Its block message reports the preflight findings and points here for the options above; the only thing it restates is option 2's tar command, because writing that tarball is what clears the block. Change option 2's archive name or its backup directory and that hook has to change with it, or the command it prints stops clearing its own block (hooks-plugin/hooks/test-repo-deletion-safety.shruns the printed command end to end).git-plugin:git-coworker-check— is another agent writing here? (different question, same safety-diagnostic shape)git-plugin:git-maintain— maintenance inside a surviving repogit-plugin:deadbranch— deleting branches, not the checkoutmacos-plugin:macos-disk-usage— the likely caller when disk pressure prompts a clone cleanup
Установить git-repo-delete-check в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(git -C *)Bash(git remote *)Bash(git status *)Bash(git log *)Bash(git stash *)Bash(git branch *)Bash(du *)Bash(tar *)Bash(mkdir *)ReadGlobAskUserQuestionTodoWriteFAQ
Что делает скилл git-repo-delete-check?
Verify a repo's work survives deletion — remote, unpushed commits, stashes — then offer a push or tar backup. Use when asked to rm -rf, delete, or prune a git checkout.
Как установить скилл git-repo-delete-check?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл git-repo-delete-check запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic