agentsclimarketplace

Git hygiene

Skill adityaarakeri/senior-agent-skills/skills/git-hygiene

Eight portable SKILL.md playbooks that make coding agents work like careful senior engineers. One-command install across Claude Code, Codex, Antigravity, OpenCode, Copilot, and Cursor.

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

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

3 things to look at

  • 15 days oldThe repository was created 15 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Version control discipline for agent work. Atomic commits, meaningful messages, safe operations, and zero destructive surprises. Use this whenever committing, branching, merging, rebasing, resolving conflicts, or preparing pull requests, before any git command that rewrites or discards history, and when the user says "commit this", "clean up the history", or "undo". Consult it before every force push, reset, or clean, without exception.

SKILL.md

3.5 KB, as published. Nobody here has run it

Git Hygiene

History is a debugging tool. bisect, blame, and revert only work when commits are small, honest, and well described. And nothing torches user trust faster than an agent that ran one destructive git command it was not asked to run. Two goals, then: leave history useful, and never destroy anything without an explicit instruction.

Committing

  1. Look before staging. git status and git diff first, every time. Know exactly what is about to enter the commit; agents that stage blind commit debug prints, secrets, and stray files.
  2. Stage with intent. Add specific files (or hunks). Avoid blanket add-everything commands when anything unrelated is sitting in the working tree.
  3. Atomic commits. One logical change per commit. Structure changes separate from behavior changes (see safe-refactor). A reviewer should be able to describe any commit in one sentence.
  4. Messages: imperative summary, then the why. Summary line around 72 characters or less, written as a command ("Add retry to webhook delivery", not "Added" or "adds"). The body explains why the change exists and any non-obvious decision; the diff already shows what. Check git log first and follow the repo's existing convention (conventional commits, ticket prefixes, whatever the house style is).
  5. Never commit secrets, tokens, keys, credentials, .env files, large binaries, or generated artifacts. Scan the staged diff for these every single time; a committed secret is compromised even after the commit is deleted, and rotating it becomes someone's bad afternoon.

The danger zone

The following require an explicit user instruction naming the operation before you run them. "Clean this up" is not an instruction to rewrite history.

  • Any force push. If instructed, prefer --force-with-lease so you cannot stomp work pushed by someone else in the meantime.
  • reset --hard, clean -f, and any checkout that discards uncommitted work.
  • Amending or rebasing commits that are already pushed to a shared branch.
  • Deleting branches, local or remote, that you did not create in this session.
  • Any history rewrite (interactive rebase, filter operations) on shared history.

When one of these seems necessary, name the command, say what it will destroy, and wait for a yes.

Branches, merges, conflicts

Work on a task branch unless told otherwise, named for the change. Sync with the remote before pushing. When conflicts appear, read BOTH sides and understand what each was trying to do; the correct resolution usually preserves both intents, and resolving by mechanically taking one side is how other people's finished work disappears. After resolving, build and run the tests before declaring the merge done, because a textually clean merge can still be semantically broken.

Recovery beats destruction

Prefer revert (a new commit undoing an old one) over reset on anything shared; it fixes the mistake without erasing the record. And before anything drastic, remember git reflog can usually resurrect what seems lost. Mention that option to the user before reaching for a destructive command on their behalf.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.