GI

Safety rules and protocols for handling Git operations to prevent data loss.

Install

mkdir -p .claude/skills/git-safety && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/915" && unzip -o skill.zip -d .claude/skills/git-safety && rm skill.zip

Installs to .claude/skills/git-safety

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Git safety rules. INVOKE WHEN: git push, force push, git reset, git clean, destructive git, push force, reset hard. NEVER force push or do destructive git operations.
166 chars✓ has a “when” trigger
Beginner

Key capabilities

  • Enforce safe Git push workflows
  • Prevent destructive history changes
  • Provide safe alternatives to resets
  • Manage merge conflicts safely

How it works

The skill mandates a strict workflow that prioritizes pulling before pushing and using stashing instead of hard resets to maintain repository history integrity.

Inputs & outputs

You give it
Git command request
You get back
Safe Git command sequence

When to use git-safety

  • Safely recover from merge conflicts
  • Sync local branch with remote repository
  • Stash work instead of resetting
  • Follow safe push-pull workflow

About this skill

git safety

rules for git operations in this repo.

rules

  • NEVER force push (git push --force or git push -f)
  • NEVER git reset --hard without explicit permission
  • NEVER git clean -fd without explicit permission
  • prefer git stash over git reset
  • always git pull before git push

forbidden commands

these require EXPLICIT user permission:

  • git push --force
  • git push -f
  • git push --force-with-lease
  • git reset --hard
  • git clean -fd
  • git checkout -- . (discards all changes)

safe alternatives

instead of git reset --hard:

  • git stash to save changes
  • git stash pop to restore

instead of force push:

  • git pull --rebase then normal push
  • ask user how to resolve conflicts

workflow

  1. git pull before making changes
  2. make changes
  3. git add relevant files
  4. git commit
  5. git pull again before push
  6. git push (no force flags)

When not to use it

  • Performing force pushes without explicit permission
  • Executing destructive commands on shared branches

Limitations

  • Requires explicit permission for forbidden commands
  • Strict adherence to workflow rules

How it compares

It explicitly forbids destructive commands and provides safer alternatives to prevent accidental data loss or history corruption.

Compared to similar skills

git-safety side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
git-safety (this skill)36moNo flagsBeginner
resolve-conflicts818moReviewIntermediate
dependency-upgrade265moReviewIntermediate
openspec-onboard106moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry