git-hygiene
Skill98 starsChanged 2 months agoMITView on GitHub
Version-control discipline — stage by explicit path, one logical change per commit with a why-message, branch before risky work, secrets never in history, no rewriting commits you don't own. Use when committing, staging, branching, amending, rebasing, stashing, force-pushing, writing commit messages, or starting any change large enough to want an undo point. Not for deciding what code to change.
- Reads credentials
3 other projects use a version of this.
Adopted by
Most recently taken up by
- wolf5996/agentic-skillstheir own version, first seen Sep 28, 2026
- neeraj181-dot/ClaudeSkillstheir own version, first seen Aug 25, 2026
- jpsweeney97/claude-code-skillstheir own version, first seen May 8, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- wolf5996/agentic-skills★ 10same name
- jpsweeney97/claude-code-skills★ 0same name
- neeraj181-dot/ClaudeSkills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository38 other files it gives its agents.
- ambiguity-commitSkill
- api-surface-careSkill
- calibrated-recommendationSkill
- codebase-orientationSkill
- concurrency-reasoningSkill
- config-and-flagsSkill
- context-checkpointSkill
- cross-platform-careSkill
- data-loss-guardSkill
- data-migration-safetySkill
- dependency-changesSkill
- docs-as-contractSkill
- edge-case-sweepSkill
- environment-firstSkill
- error-message-qualitySkill
- escalate-vs-decideSkill
- estimation-and-scopingSkill
- explain-at-the-right-levelSkill
- generalize-the-correctionSkill
- incident-diagnosisSkill
- leave-no-messSkill
- llm-app-codeSkill
- numerical-careSkill
- performance-investigationSkill
- perf-sanitySkill
- question-vs-taskSkill
- resource-lifecycleSkill
- reviewing-a-changeSkill
- root-cause-debuggingSkill
- security-reflexesSkill
- stop-thrashingSkill
- subagent-fanoutSkill
- surgical-refactoringSkill
- task-decompositionSkill
- test-designSkill
- untrusted-content-guardSkill
- verify-ui-visuallySkill
- workmanshipSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 25
Don't rewrite history you don't own: Before commit --amend, rebase, reset, or any force-push, run git log origin/<branch>..HEAD …
- Distinctive: line 26
Never push, tag, or open a PR unprompted: When asked, name the exact remote and branch in the report.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
git-hygiene
Weak git use looks like: git add -A && git commit -m "updates" on main, with a debug script and a .env riding along. Strong git use makes every commit a deliberate, reversible, explainable unit. Git is the safety net and the paper trail; each step below protects one or the other.
Before the work
- Check where you stand:
git statusandgit branch --show-current. Pre-existing uncommitted changes and stashes are the user's — not yours to stage, revert, or drop (see data-loss-guard). - Branch before risky or user-visible work, and never commit to main/master unprompted, even for "one small fix":
git switch -c <type>/<short-slug>in the repo's naming style. A branch costs nothing; un-committing from main costs a conversation. - Read history before "fixing" odd code:
git log -S <symbol> --onelineandgit blame -L <start>,<end> <file>on the lines you're about to change. If a past commit did it deliberately, its message says why — respect it, or cite it when overriding.
Staging
- Stage by explicit path, never by wildcard.
git add <file> ...orgit add -p; nevergit add -Aorgit add .. First list every untracked path ingit statusand decide each: intended artifact (stage), ignorable (add to.gitignoreif the repo would want that), or debris you created (delete). Anything untracked you didn't create gets asked about, not committed. - Scan the staged diff for secrets before committing:
git diff --cached | grep -inE 'api[_-]?key|secret|token|passw|PRIVATE KEY|AKIA[0-9A-Z]{16}'. A hit means unstage and remove. A secret in an already-pushed commit is compromised even after amend or rebase — tell the user to rotate it; never present history rewriting as the fix. - Read the staged diff top to bottom (
git diff --cached) — the last cheap moment to catch debug prints, commented-out experiments, and unrelated hunks (see workmanship). Unrelated hunks go in a separate commit or stay unstaged.
Committing
- Commit only when asked, then one logical change per commit. Run
git log --oneline -20first and match the house style (prefix, tense, length). The subject states what and why for the person runninggit logduring an incident: "fix utf8 filename crash in import", not "fix bug". Reasoning and behavior changes go in the body. - Don't rewrite history you don't own. Before
commit --amend,rebase,reset, or any force-push, rungit log origin/<branch>..HEAD --format='%h %an %s': every commit you'd touch must be unpushed AND authored this session. Otherwise stop and ask. If a force-push is explicitly requested, use--force-with-lease, never--force. - Never push, tag, or open a PR unprompted. When asked, name the exact remote and branch in the report.
Exit check
Report the branch, each commit hash and subject, and exactly what remains uncommitted or untracked and why. git status after your report should hold no surprises for the next person.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

