validate-git-safety

Community

Protect Git history, prevent data loss.

Authorcowwoc
Version1.0.0
Installs0

System Documentation

What problem does it solve?

History-rewriting Git operations (like filter-branch or rebase --all) can accidentally corrupt version branches or lead to irreversible data loss. This Skill acts as a critical safeguard, preventing such catastrophic mistakes and ensuring the integrity of your repository.

Core Features & Use Cases

  • Version Branch Identification: Automatically detects and protects critical v[0-9]+ version branches.
  • Command Impact Analysis: Analyzes Git commands for dangerous flags (--all, --branches) that could affect protected history.
  • Target Branch Validation: Verifies that the target of a Git operation is not a protected version branch.
  • Blocks or Warns: Explicitly blocks dangerous operations or issues warnings for potentially risky ones, providing safe alternatives.
  • Use Case: Before attempting a git filter-branch operation to remove sensitive data from your repository's history, use this Skill to validate the command. It will ensure you don't accidentally rewrite the history of your v21 release branch, preventing a major incident.

Quick Start

Before running a potentially dangerous Git command: COMMAND="git filter-branch --tree-filter 'rm -f secrets.txt' HEAD" /workspace/main/.claude/scripts/validate-git-safety.sh
--command "$COMMAND"

Dependency Matrix

Required Modules

None required

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: validate-git-safety
Download link: https://github.com/cowwoc/styler/archive/main.zip#validate-git-safety

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.