git-guardrails-claude-code

Classify destructive Git commands and warn about irreversible risks.

779|80|Updated Jun 20, 2025
One-click install
npx skills add https://github.com/Haohao-end/openagent --skill git-guardrails-claude-code-haohao-end
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-guardrails-claude-code
Source: https://github.com/Haohao-end/openagent/tree/main/api/internal/core/skills/catalog/git-guardrails-claude-code
Command: npx skills add https://github.com/Haohao-end/openagent --skill git-guardrails-claude-code-haohao-end

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It reduces the risk of irreversible Git damage when users attempt history-rewriting or unsafe checkout operations.

Core Features & Use Cases

  • Risk detection for destructive commands: Identifies potentially irreversible actions such as hard resets, risky checkouts, and force pushes.
  • Safety-first user guidance: Clearly communicates the risk and encourages safer alternatives instead of proceeding blindly.
  • Protect local work: Promotes strategies that preserve unfinished local changes during corrective actions.

Quick Start

Ask the AI to apply git-guardrails to a command you plan to run and to recommend the safest alternative.

Frequently Asked Questions about git-guardrails-claude-code

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

FAQPage Schema
How do I prevent accidental data loss when running git reset --hard or force push?

Git guardrails enforce safety by first classifying commands like force push or reset --hard as destructive, warning about specific risks of irreversible repository damage, and promoting safer alternatives that preserve local changes.

What is the safest way to discard local changes in git without losing unfinished work?

The safest way to discard local changes involves using guardrails that protect local work by promoting preservation strategies during corrective actions, ensuring unfinished work is kept safe instead of being blindly overwritten by risky checkouts.

How do git safety guardrails classify risky checkout patterns and backtracking operations?

Git safety guardrails classify risky checkout patterns and backtracking operations by evaluating if the requested action may discard work, identifying it as destructive, and warning the user about specific risks before any history-rewriting occurs.

Can I use git guardrails to check a command before I run it?

Yes, you can use git guardrails to check a command before running it by asking the AI to apply the guardrails to your planned command, which will then recommend the safest alternative for your specific scenario.

When should I use git safety guardrails for history-rewriting operations?

You should use git safety guardrails whenever you plan history-rewriting operations like hard resets, risky checkouts, or force pushes, as these commands risk irreversible repository damage and require safety-first guidance to protect your work.