validate-git-safety
CommunityProtect Git history, prevent data loss.
Software Engineering#git#developer tools#version control#security#safety#history rewrite#data loss prevention
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-branchoperation 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 yourv21release 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 requiredComponents
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.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.