git-guardrails

Block dangerous git commands with configurable pre-command hooks.

Updated May 2, 2026
One-click install
npx skills add https://github.com/maxenergy/skills --skill git-guardrails-maxenergy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-guardrails
Source: https://github.com/maxenergy/skills/tree/main/skills/misc/git-guardrails
Command: npx skills add https://github.com/maxenergy/skills --skill git-guardrails-maxenergy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Set up safeguards that block or warn before dangerous git operations such as push, reset --hard, clean -f, branch -D, checkout ., or restore .. Use when user wants to prevent destructive git commands, add git safety hooks, or make an agent ask before risky repository changes.

Core Features & Use Cases

  • Blocks dangerous commands or requires explicit confirmation before proceeding.
  • Provides flexible integration options for project-scoped hooks (e.g., pre-command hooks) or shell wrappers to cover all environments.
  • Use case: protect repositories from accidental destructive actions in development, CI, or automation workflows.

Quick Start

Run the installer to enable pre-command git guardrails across your projects.

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 git push --force or git reset --hard in local development?

You can prevent accidental git push --force or git reset --hard by installing a pre-command hook that blocks dangerous git commands and requires explicit confirmation before proceeding.

Can I add git safety hooks to block destructive commands like git clean -f and git branch -D?

Yes, you can add git safety hooks to block destructive commands like git clean -f and git branch -D by enforcing configurable guardrails with a script-based blocker and a verify step.

What is the best way to require confirmation before risky git repository changes in CI pipelines?

The best way to require confirmation before risky git repository changes in CI pipelines is using a pre-command hook that warns or blocks dangerous operations across repositories.

Does a pre-command git guardrail work across all my repositories and automation workflows?

Pre-command git guardrails work across local development and CI pipelines by applying script-based blockers to dangerous commands, offering flexible integration for project-scoped hooks or shell wrappers.

Are git pre-command safeguards configurable to allow specific destructive actions when needed?

Git pre-command safeguards are configurable, allowing you to block or warn before dangerous operations while providing a verify step to confirm safe operations when explicit confirmation is given.