git-safety-net
БесплатноЗапускает вложенные скриптыНе проверенAudits, preserves and recovers local Git state before cleanup: unpushed or wrong-branch commits, dirty worktrees, duplicate clones, stashes, dangling commits…
от daymade★ 1 556 звёзд на GitHubОб этом скилле
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. Splitting the work into phases alone does not revoke authority the task already carries: when the task already includes retiring its exact temporary resources, complete Mode E within that same task — a new task or fresh confirmation solely for entering retirement is a re-ask, not a gate. Mode E's evidence, preservation, and readback gates still apply in full. A merge alone still does not authorize extra targets, and targets the task's authority does not name stay report-only until separately authorized.
- Preserve the smallest set threatened by the next authorized destructive action. If the current phase is only commit/push/verify and no deletion, reset, gc, history rewrite, or worktree removal is authorized, do not create an all-refs bundle or pin every dangler.
- Classify an artifact before choosing its transport. Durable project source follows the repository's normal Git/LFS policy. A temporary recovery artifact (bundle, working-tree diff, snapshot, transport chunk) belongs in a repository-external backup directory. Do not stage, commit, push, or route it through Git LFS merely to make the backup remote; Git LFS is for durable versioned project binaries, not a fallback transport for temporary recovery material.
- Never use a single/blanket offline backup as a cleanup or closeout path. Never propose,
offer as a menu option, or execute packing multiple unreviewed branches, dirty worktrees,
diffs, and untracked files into one offline archive (
git bundle+.diff+ copied files) so you can delete the live Git branches/worktrees. That converts inspectable Git state into an unsearchable offline graveyard and shifts the triage mess onto the user instead of finishing the job. Audit every unresolved branch and dirty worktree item-by-item against the fresh base and resolve each into one of four real outcomes: land valuable work the base lacks, prove superseded and retire directly (no archive graveyard), explicitly discard verified dead scratch with user approval, or keep in place as a live branch/worktree when active or awaiting a user decision. Reserve external exports strictly for short-lived, single-target rollback safety around an active destructive operation (or an explicit user export request for a named item). No bundled script enforces this prohibition automatically; the executing agent and independent reviewer must verify it on every Mode B/E plan and closeout. - Keep preservation and retirement as separate phases. A verified recovery artifact proves recoverability; it does not prove the business code landed. Keep an already-existing or operation-scoped artifact through its destructive action and content-level postconditions. Retire an exact task-owned temporary artifact only when every payload is landed or proven superseded and the artifact itself has explicit cleanup authorization. Keep pre
Установить git-safety-net в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл 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.
Как установить скилл git-safety-net?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл git-safety-net запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic