hf.block-destructive-git

Block destructive git commands unless explicit approval is provided.

5|2|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/T-rav/hydraflow --skill hf-block-destructive-git
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hf.block-destructive-git
Source: https://github.com/T-rav/hydraflow/tree/main/.codex/skills/hf.block-destructive-git
Command: npx skills add https://github.com/T-rav/hydraflow --skill hf-block-destructive-git

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Blocking destructive git commands to prevent irreversible changes and protect a codebase from accidental history rewrites.

Core Features & Use Cases

  • Guard destructive commands like git push --force, git reset --hard, git checkout ., git restore ., git clean -f, and git branch -D
  • Works as a pretool hook or integrated into CI/development workflows with explicit approval prompts
  • Use case: In a team repository, prevent accidental destructive operations without slowing development.

Quick Start

Block destructive git commands in a repository by requiring explicit user confirmation before actions like push --force, reset --hard, or branch deletion.

Frequently Asked Questions about hf.block-destructive-git

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

FAQPage Schema
How do I prevent accidental git push --force in a team repository?

You can block destructive git commands like git push --force by implementing a guardrail that detects risky operations and requires explicit user approval before executing them.

What git commands are considered destructive and how do I block them?

Destructive git commands include git reset --hard, git checkout ., git restore ., git clean -f, and git branch -D. You can block them using a safety hook that intercepts these operations and demands confirmation.

Can I block destructive git commands in a CI pipeline?

Yes, this safety guardrail integrates into CI pipelines and development workflows. It detects destructive git commands, emits a clear error message, and exits with a non-zero status if approval is not given.

How do I require explicit approval before a git reset --hard?

You can require explicit approval for destructive git commands like git reset --hard by using a pretool hook that intercepts the command and prompts the user for confirmation before proceeding.

What is the best way to protect a codebase from accidental history rewrites?

The best way to protect a codebase from accidental history rewrites is to implement a guardrail that blocks destructive git commands, preventing irreversible changes without slowing down team development.

Do I need additional dependencies to block branch deletion in git?

No additional dependencies are required. You can block git branch deletion and other destructive operations directly through a simple guardrail hook integrated into your existing development workflow.