GI

git-guardrails-claude-code

Enforces safe Git workflows and prevents destructive actions.

Install

mkdir -p .claude/skills/git-guardrails-claude-code && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13133" && unzip -o skill.zip -d .claude/skills/git-guardrails-claude-code && rm skill.zip

Installs to .claude/skills/git-guardrails-claude-code

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Aplica guardrails de Git para evitar operações destrutivas e garantir commits seguros, rastreáveis e mínimos durante execução por agentes.
138 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Verify current Git status
  • Define explicit scope for commits
  • Prohibit destructive Git commands without authorization
  • Resolve merge/rebase conflicts safely
  • Enforce small, cohesive, and traceable commits
  • Confirm correct branch/remote before pushing

How it works

The skill executes Git operations by first checking the repository status, then locking the scope of changes, performing safety checks against destructive commands, and enforcing commit and push discipline.

Inputs & outputs

You give it
Approved scope of changes, target repository and branch, list of files for commit, team's commit convention rules
You get back
Status of Git operation (ready, blocked, completed), target branch/remote, included files, executed commands, generated/published hashes, identified risks/pendi

When to use git-guardrails-claude-code

  • Protecting Git flows
  • Ensuring safe commits
  • Avoiding hard resets

About this skill

Skill: Git Guardrails (Claude Code)

Mission

Executar operações Git com segurança operacional, minimizando risco de perda de trabalho e evitando alterações fora de escopo.

When to use

  • Antes de add/commit/push em mudanças relevantes.
  • Ao resolver conflitos, rebase ou merge manual.
  • Em repositórios com worktree suja ou alterações paralelas de outros agentes.

Inputs mínimos

  • Escopo aprovado da mudança.
  • Repositório e branch alvo.
  • Lista de arquivos esperados para commit.
  • Regras do time para convenção de commit e publicação.

Execution protocol

  1. Preflight status
  • Verificar estado atual (git status --short, branch ativa).
  • Detectar alterações fora do escopo solicitado.
  1. Scope lock
  • Definir explicitamente quais arquivos entram no commit.
  • Excluir arquivos incidentais ou temporários não aprovados.
  1. Safety checks
  • Proibir comandos destrutivos sem autorização explícita:
    • git reset --hard
    • git checkout -- <file>
    • reescrita de histórico em branch compartilhada
  • Se necessário, solicitar gate humano antes da ação.
  1. Conflict handling
  • Em conflito de merge/rebase:
    • preservar mudanças válidas locais
    • resolver por menor dif correto
    • revalidar arquivos resolvidos
  • Não remover alterações do usuário sem autorização.
  1. Commit discipline
  • Commit pequeno, coeso e rastreável.
  • Mensagem no padrão do projeto (ex.: feat:, fix:, docs:, chore:).
  • Incluir apenas arquivos do escopo travado.
  1. Push discipline
  • Confirmar branch/remoto corretos antes do push.
  • Evitar --force sem aprovação humana formal.
  1. Post-push verification
  • Registrar hash e range publicado.
  • Confirmar estado local limpo para o escopo tratado.

Davi governance gates

  • Toda ação destrutiva exige aprovação humana explícita.
  • Conflito entre mudanças de usuário e agente deve pausar para decisão humana.
  • Se houver risco de escopo excedido, bloquear e revalidar com refinadores.

Output obrigatório

  • Status: ready | blocked | completed
  • Branch/remoto alvo
  • Arquivos incluídos no commit
  • Comandos Git executados
  • Hash(es) gerados/publicados
  • Riscos/pendências identificados

Quality rules

  • Nunca usar atalho destrutivo por conveniência.
  • Commits devem ser mínimos e semanticamente consistentes.
  • Push deve preservar histórico seguro por padrão.
  • Toda exceção de guardrail deve ser documentada.

When not to use it

  • When performing Git operations that are not relevant to add/commit/push
  • When the user explicitly authorizes destructive commands
  • When the repository does not require strict commit hygiene

Limitations

  • Destructive commands like `git reset --hard` are prohibited without explicit authorization.
  • Rewriting history on shared branches is prohibited.
  • The skill requires human approval for any destructive action or conflict between user and agent changes.

How it compares

This skill applies a structured protocol with explicit safety checks and governance gates to Git operations, preventing destructive actions and ensuring commit hygiene, unlike manual Git usage.

Compared to similar skills

git-guardrails-claude-code side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
git-guardrails-claude-code (this skill)02moNo flagsIntermediate
proxychains08moReviewIntermediate
secrets-sync03moReviewIntermediate
resolve-conflicts818moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

proxychains

2025Emma

Auto-detect network issues and force proxy usage with proxychains4. Use this skill when encountering connection timeouts, DNS failures, or blocked network access. Default proxy is http://127.0.0.1:9910

00

secrets-sync

SymbionicNigel

Use when the user adds, edits, lists, or applies chezmoi-managed secrets; syncs Bitwarden sessions; runs GPG encryption on project files; or works with the .secrets submodule. Also use when troubleshooting chezmoi config path issues in this repository.

00

resolve-conflicts

antinomyhq

Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.

81334

openspec-onboard

studyzy

Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.

10207

codex-cli-bridge

alirezarezvani

Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools

9180

skill-sync

KyleKing

Syncs Claude Skills with other AI coding tools like Cursor, Copilot, and Codeium by creating cross-references and shared knowledge bases. Invoke when user wants to leverage skills across multiple tools or create unified AI context.

12130

Search skills

Search the agent skills registry