ss-workflow-restrict-git-commands

Require explicit user confirmation before executing destructive Git commands.

Updated May 19, 2026
One-click install
npx skills add https://github.com/Emrebener/Sublime-Skills --skill ss-workflow-restrict-git-commands
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ss-workflow-restrict-git-commands
Source: https://github.com/Emrebener/Sublime-Skills/tree/main/skills/workflow/ss-workflow-restrict-git-commands
Command: npx skills add https://github.com/Emrebener/Sublime-Skills --skill ss-workflow-restrict-git-commands

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) components.

What problem does it solve?

This Skill prevents accidental or unauthorized destructive Git operations that can irreversibly rewrite history or delete local work.

Core Features & Use Cases

  • Per-command authorization policy: Blocks execution unless the user explicitly confirms the exact destructive command for that specific invocation.
  • Covers common high-risk operations: Includes push (with force variants), reset --hard, clean -f (including common variants), branch -D / force deletion, and checkout . / restore ..
  • Optional deterministic enforcement: Ships a Claude Code PreToolUse hook script that hard-blocks the same dangerous patterns at the harness level when installed.

Quick Start

Use the skill at session start by telling your agent: "I will use ss-workflow-restrict-git-commands—destructive git operations require your explicit authorization."

Frequently Asked Questions about ss-workflow-restrict-git-commands

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

FAQPage Schema
How do I prevent destructive git commands like force push or reset --hard from running automatically?

To prevent destructive git commands from running automatically, you need an authorization policy that requires explicit user confirmation before executing patterns like force push, reset --hard, or clean -f. This Skill enforces per-command consent for these specific high-risk operations.

What destructive git operations should I safeguard during automated agent workflows?

Destructive git operations to safeguard during agent workflows include push (with force variants), reset --hard, clean -f, branch -D (force deletion), and checkout . / restore . These operations can irreversibly rewrite history or delete local work without explicit confirmation.

Can I block dangerous git patterns at the Claude Code harness level?

Yes, you can block dangerous git patterns at the Claude Code harness level using a PreToolUse hook. This Skill provides an optional deterministic enforcement script that hard-blocks dangerous git operations unless explicitly allowed by the user.

How do I set up a git safety guardrail for repository maintenance and refactoring tasks?

To set up git safety guardrails for repository maintenance or refactoring, activate this Skill at session start by instructing your agent that destructive git operations require explicit authorization, enforcing per-command consent for irreversible changes.

Do I need any dependencies to enforce workflow policies for git authorization?

Yes, you need jq installed as a dependency to enforce workflow policies for git authorization. This lightweight command-line JSON processor is required to support the consent validation scripts within the agent harness.

What are the limitations of using per-command consent for destructive git operations?

A limitation of per-command consent for destructive git operations is that it requires manual approval for every flagged invocation, which can interrupt automated refactoring or deployment preparation workflows if the agent triggers multiple sequential git commands.