skills/safe-git-guard/SKILL.md
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.
npx skillsauth add svenja-dev/claude-code-skills safe-git-guardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Skill to prevent destructive Git operations
This skill activates automatically on these commands:
git reset --hardgit checkout -- <file>git clean -fdgit rebase (without explicit confirmation)git push --forcegit reset --hard - Deletes uncommitted changes irreversiblygit push --force on main/master - Can destroy remote historygit clean -fd - Deletes untracked files irreversiblygit checkout -- <file> - Overwrites local changes
git stash push -m "backup-before-checkout-$(date +%s)"git reset HEAD~n - Resets commits
git tag backup-before-reset-$(date +%s)git rebase - Modifies history
git branch backup-before-rebase-$(date +%s)1. STOP - Don't execute immediately
2. BACKUP - Save current state (tag/branch/stash)
3. ASK - "Are you sure? What will be lost?"
4. CONFIRM - Explicit "Yes, I understand the risk"
5. EXECUTE - Only then run the command
User: "Undo the last 3 commits"
Claude (with this skill):
WARNING: DESTRUCTIVE OPERATION DETECTED
You want to run `git reset HEAD~3`. This would:
- Remove 3 commits from history
- Changes become "unstaged" (--soft) or deleted (--hard)
Creating backup:
> git tag backup-YYYYMMDD-pre-reset
Should I proceed? (Answer with "Yes, proceed with reset")
Configure in your project's CLAUDE.md:
protected_branches:
- main # Production branch, never force-push
- master # Legacy production branch
- develop # Development branch, PR only
- release/* # Release branches, approval only
This skill respects No-Touch Zones defined in CLAUDE.md. When changes affect protected files: Additional warning + Impact Analysis.
Add to your CLAUDE.md:
### Git Safety Rules
Protected Branches:
- main, develop, release/*
No-Touch Zones (require explicit approval):
- src/auth/**
- src/core/**
- config/production.*
Originally developed for fabrikIQ - AI-powered manufacturing data analysis.
MIT - Free to use and modify
development
Protects design and theme files from unintended changes. Locks tailwind.config, global CSS, and theme variables. Requires explicit confirmation before modifying UI components. Activate on changes to CSS, theme config, or layout components.
tools
Proactive token budget assessment and task chunking strategy. Use this skill when queries involve multiple large file uploads, requests for comprehensive multi-document analysis, complex multi-step workflows with heavy research (10+ tool calls), phrases like "complete analysis", "full audit", "thorough review", "deep dive", or tasks combining extensive research with large output artifacts. This skill helps assess token consumption risk early and recommend chunking strategies before beginning work.
development
Erzwingt striktes Test-Driven Development mit Red-Green-Refactor Zyklus. Blockiert Code-Generierung ohne vorherige Tests. Dokumentiert 13 ungueltige Rationalisierungen. Aktivieren bei neuen Features, Bug Fixes, Refactoring.
development
Enforces TypeScript best practices when writing code. Automatically enables strict typing for TypeScript projects, prevents `any` usage, and recommends generic constraints. Activate on TS/TSX files, new features, code reviews.