Validate git operations won't affect protected branches or cause data loss
Validates git operations to prevent data loss and protect version branches.
/plugin marketplace add cowwoc/claude-code-dog/plugin install dog@claude-code-dogThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Purpose: Validate git history-rewriting operations won't affect protected branches or cause unintended data loss.
git filter-branchgit rebase with --all or --branchesv[0-9]+ (e.g., v1, v13, v21)# NEVER use --all with history rewriting
git filter-branch --all
git rebase --all
# NEVER force push without explicit request
git push --force
git push -f
# NEVER delete version branches
git branch -D v21
# NEVER rebase shared branches
git checkout main
git rebase feature # Rewrites main!
# Target specific branch (not --all)
git filter-branch main
# Rebase feature onto main (not main onto feature)
git checkout feature
git rebase main
# Use --force-with-lease instead of --force
git push --force-with-lease
# Move version branch pointer forward (not rewrite)
git branch -f v21 <new-commit>
Before any history-rewriting operation:
git branch -agit branch | grep -E "^ v[0-9]+"git branch backup-before-op-$(date +%Y%m%d-%H%M%S)# Before running dangerous command, check:
COMMAND="git filter-branch --tree-filter 'rm secrets.txt' HEAD"
# Check for dangerous flags
if echo "$COMMAND" | grep -qE "(--all|--branches)"; then
echo "BLOCKED: --all/--branches affects protected branches"
echo "Use: git filter-branch <branch-name>"
exit 1
fi
# Check target isn't version branch
TARGET=$(echo "$COMMAND" | grep -oE "v[0-9]+")
if [[ -n "$TARGET" ]]; then
echo "BLOCKED: Cannot modify version branch $TARGET"
exit 1
fi
echo "Command appears safe"
# If version branch history was modified:
# 1. Check reflog for original position
git reflog show v21
# 2. Reset to original commit
git branch -f v21 v21@{1}
# 3. Verify restored
git log v21 -5 --oneline
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.