Agent skill · software engineering · daymade
git-safety-net
Audits, preserves and recovers local Git state before cleanup: unpushed or wrong-branch commits, dirty worktrees, duplicate clones, stashes, dangling commits, squash-merge uncertainty. Use when the user fears lost work, wants to recover a commit, asks if a branch is actually merged, asks whether a branch, worktree or clone is safe to delete, or wants one clean main (误删分支 / 还有没有丢的东西). Not for GitHub PR operations.
Why this skill is useful
Adds specific scripts for auditing and recovering Git states that are not commonly known or documented.
What it needs
Requires git installed locally. About 12k tokens when loaded. Last updated 2026-08-07. 1,320 stars on the source repository.
What this skill does
Git Safety Net Prevent losing work in a tangle of branches/stashes/rebases, and recover it forensically when something already went sideways. The commands here are all non-destructive or additive until a step is explicitly labeled destructive — recovery must never make the loss worse. Outcome contract — keep the safety net subordinate to the user's job Before Mode B/E or any command that writes a ref or backup, state the following in the conversation (do not create another file): Outcome: the user-visible end state, in the user's words. Current phase: what is authorized now. "Later" work is not authorized in this phase. Authorized targets: named objects this phase may inspect, plus the subset it may change. Stop condition: observable facts that end the task. Then enforce these boundaries: Evidence scope is not action scope. A read-only audit may discover another clone, ref, repository, or dangling object. That discovery may widen the report; it does not authorize preserving, uploading, merging, deleting, or otherwise changing the newly found object. Authorization is object-specific, not repository-wide by implication. "Take over", "continue", or "finish the cleanup" applies only to the checkout/ref/PR the user identified. A collaborator-owned worktree, branch, or PR discovered later stays report-only until the user names it as a change target. If the user says to leave it alone, record that exclusion and do not inspect its working-tree contents, back it up, merge it, unlock/remove it, or mutate its refs. Resolve authority from the current request and applicable standing user instructions. Authority for any action under this Skill is the current request read together with the standing user instructions that apply to this task (for example, a standing instruction that a task ends with checks, commit, publication, readback, and retiring that task's own temporary branches/worktrees). Later user restrictions still control. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills daymade/git-safety-net