git-guardrails

Block destructive git commands and enforce safe alternatives.

25|10|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/neuron-one/GODMODE --skill git-guardrails-neuron-one
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-guardrails
Source: https://github.com/neuron-one/GODMODE/tree/main/skills/security/git-guardrails
Command: npx skills add https://github.com/neuron-one/GODMODE --skill git-guardrails-neuron-one

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Block destructive git commands and guide users toward safer alternatives to prevent repository damage.

Core Features & Use Cases

  • Blocked Commands: git push --force uses safe alternatives like git push --force-with-lease; git reset --hard and git clean show dry-run and safer options.
  • Guardrails for destructive operations: prompts and checks before performing destructive actions.
  • Never: prohibits bypassing hooks and deleting branches with unmerged changes.

Quick Start

Prevent destructive git actions by enforcing safe substitutes for risky commands.

Frequently Asked Questions about git-guardrails

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent accidental data loss from destructive git commands?▼

To prevent destructive git commands from damaging your repository, enforce guardrails that block operations like git push --force and git reset --hard, substituting them with safe alternatives like git push --force-with-lease. This intercepts risky actions and prompts with safer options before execution.

What is the safest way to force push to a shared remote branch?▼

The safest way to force push to a shared remote branch is using git push --force-with-lease instead of standard force push. Guardrails block standard force pushes and suggest this alternative to prevent overwriting teammates' unmerged changes.

How do I safely undo local commits without losing uncommitted work?▼

To safely undo local commits without losing uncommitted work, avoid git reset --hard. Guardrails intercept this destructive operation and suggest dry-run checks or softer reset options to preserve your working directory before executing any branch modifications.

Can I clean untracked files in git without risking important data deletion?▼

You can clean untracked files safely by enforcing a guardrail sequence that intercepts git clean commands. This mechanism prompts you to review dry-run outputs and suggests safer alternatives before performing any destructive file removal.

How do I stop developers from deleting git branches with unmerged changes?▼

To stop developers from deleting git branches with unmerged changes, implement guardrails that explicitly prohibit bypassing hooks and unsafe branch deletions. This enforces a defined safety sequence and blocks destructive branch operations before they execute.

What are the limitations of using git guardrails for version control safety?▼

Git guardrails limitations include strict enforcement of a defined safety sequence for push, reset, clean, and branch operations, which may require workflow adjustments. Guardrails prohibit bypassing hooks, meaning standard destructive commands will fail without manual safe substitution.