Agent skill · laurigates

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.

What it needs

About 2k tokens when loaded.

What this skill does

/git:repo-delete-check 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 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: 1. 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). 2. 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. 3. 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 --porcelain is non-empty — those files are not on any remote. Unpushed commits. git log @{u}..HEAD --oneline is non-empty — those commits exist only locally. Stashes. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills laurigates/git-repo-delete-check

View the source on GitHub

Browse the @skills marketplace