svenja-dev/claude-code-skills/safe-git-guard
Claude Code and agent skill by svenja-dev/claude-code-skills
- community
Checking that the SKILL.md file is still in the repository.
Prevents destructive Git operations by requiring backup and confirmation. Blocks git reset --hard, git push --force on main, git clean -fd. Requires backup before git checkout, git reset, git rebase. Activate on any destructive git command.
Install
npx vskill@latest install svenja-dev/claude-code-skills/safe-git-guardSKILL.md
Safe Git Guard
Skill to prevent destructive Git operations
Trigger
This skill activates automatically on these commands:
git reset --hardgit checkout -- <file>git clean -fdgit rebase(without explicit confirmation)git push --force
Rules
FORBIDDEN (never execute):
- `git reset --hard` - Deletes uncommitted changes irreversibly
- `git push --force` on main/master - Can destroy remote history
- `git clean -fd` - Deletes untracked files irreversibly
WARNING + BACKUP required:
- `git checkout -- <file>` - Overwrites local changes
- BEFORE execution: Create backup
git stash push -m "backup-before-checkout-$(date +%s)"
- `git reset HEAD~n` - Resets commits
- BEFORE execution: Create tag
git tag backup-before-reset-$(date +%s)
- `git rebase` - Modifies history
- BEFORE execution: Create backup branch
git branch backup-before-rebase-$(date +%s)
Workflow for Destructive Operations
Example Dialog
User: "Undo the last 3 commits"
Claude (with this skill):
Protected Branches
Configure in your project's CLAUDE.md:
Integration with No-Touch Zones
This skill respects No-Touch Zones defined in CLAUDE.md. When changes affect protected files: Additional warning + Impact Analysis.
Configuration
Add to your CLAUDE.md:
Origin
Originally developed for fabrikIQ - AI-powered manufacturing data analysis.
License
MIT - Free to use and modify
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/safe-git-guard/SKILL.md
Popularity
- Repository stars
- 32
- Repository forks
- 5
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 3 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/svenja-dev/claude-code-skills/safe-git-guard)