Skip to content
Back to skills

Git Hygiene

ASecurity

Execute explicitly requested version-control mutations safely, including staging, commits, branches, merges, rebases, conflict resolution, undo operations, and pull-request preparation. Always use before force push, reset, clean, history rewrite, or deletion. Do not trigger for read-only status, diff, log, blame, or show requests that must leave repository state unchanged.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 19, 2026
ai-agentsgit

Security analysis

A100/100

Scanned September 19, 2026

npx -y skills add adityaarakeri/senior-agent-skills --skill git-hygiene --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Git Hygiene?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Git Hygiene
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaarakeri-git-hygiene/badge)](https://www.skillsdirectory.com/skills/adityaarakeri-git-hygiene)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: git-hygiene
description: Execute explicitly requested version-control mutations safely, including staging, commits, branches, merges, rebases, conflict resolution, undo operations, and pull-request preparation. Always use before force push, reset, clean, history rewrite, or deletion. Do not trigger for read-only status, diff, log, blame, or show requests that must leave repository state unchanged.
---

# Git Hygiene

Treat version-control state as user data. Mutate only the parts required by the requested git workflow.

## Establish Authority

- Inspect status, staged and unstaged diffs, untracked files, current branch, upstream, and recent message conventions before mutation.
- Do not create or switch branches, stage, commit, fetch, pull, push, amend, rebase, or delete unless the user's request requires that action.
- Resolve exact targets and preserve unrelated or pre-existing work. Never use blanket staging when the worktree is mixed.

## Stage and Commit

1. Stage explicit files or hunks that form one logical change.
2. Inspect the staged diff for scope, debug artifacts, generated files, large binaries, submodule changes, credentials, tokens, private data, and unsafe configuration.
3. Keep commits atomic. Separate structural changes, behavior changes, generated output, and unrelated fixes when the workflow allows.
4. Follow repository message conventions. Use an imperative summary and explain non-obvious reasons, risks, or compatibility decisions in the body.
5. Report the resulting commit and anything deliberately left unstaged.

## Remote and History Safety

- Fetch, pull, merge, or push only when requested or when an explicitly authorized workflow cannot continue without it. Explain any new remote state before integrating it.
- Require explicit confirmation of the exact destructive command and impact before force push, hard reset, clean, checkout or restore that discards work, branch deletion, or shared-history rewrite.
- Prefer `--force-with-lease` over an authorized force push and `revert` over resetting shared history.
- Read both sides of conflicts and preserve both intents where compatible. Verify the semantic result after resolution.
- Offer recovery through `reflog`, a backup branch, stash, or patch before destructive recovery, but do not create or apply them without authority.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.