git-safety
Skill0 starsChanged 22 days agoMITView on GitHub
Use when committing, pushing, creating or publishing a repository, opening a PR, changing dependencies, or resolving an in-progress merge or rebase conflict: no leaked secrets, no rewritten shared history, every step reversible. Not for deciding how a finished branch ends (merge, PR, keep), that is branch-lifecycle.
- Deletes or force-pushes
- Commits and pushes
11 other projects use a version of this.
Adopted by
Most recently taken up by
- TrueImmortal82/open-code-skillstheir own version, first seen Nov 8, 2026
- Adham-Aly/quartermastertheir own version, first seen Nov 1, 2026
- Adham-Aly/implement-looptheir own version, first seen Nov 1, 2026
- Tsurai7/agentic-playbooktheir own version, first seen Oct 20, 2026
- tamagui/tamaguitheir own version, first seen Oct 8, 2026
- Effulgent-Point/pawtheir own version, first seen Oct 8, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- tamagui/tamagui★ 14ksame name
- waynesutton/convexskills★ 405same name
- waynesutton/builder-skills★ 404same name
- genfeedai/genfeed.ai★ 4same name
- Effulgent-Point/paw★ 2same name
- Adham-Aly/implement-loop★ 1same name
- Adham-Aly/quartermaster★ 1same name
- shaunburdick/skills★ 1same name
- kartykk/agent-ready★ 0same name
- TrueImmortal82/open-code-skills★ 0same name
1 more not listed
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 repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- brainstorming-designSkill
- branch-lifecycleSkill
- bug-feedback-loopSkill
- codebase-designSkill
- code-review-disciplineSkill
- domain-modelingSkill
- failure-classesSkill
- grillingSkill
- handoffSkill
- ops-safetySkill
- prototypeSkill
- quality-floorSkill
- researchSkill
- subagent-driven-devSkill
- systematic-debuggingSkill
- terse-modeSkill
- test-driven-developmentSkill
- ui-designSkill
- using-skillsSkill
- verification-before-completionSkill
- vetting-third-partySkill
- writing-plansSkill
- writing-skillsSkill
- zoom-outSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Confirm remote and account: before pushing: git remote -v, and the authenticated account (gh auth status or equivalent) match what the user …
- Very specific: line 22
Run from the project root.
“Common” is measured: kept by at least 6 in 10 of the 11 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 safety
Goal: repo operations that are boringly safe — no surprises, no leaks, reversible.
Hard rules
- Never commit secrets. Scan staged changes before every commit. Found one: unstage, add to
.gitignore, redo. - Never force-push or rewrite shared history (
push --force, rebasing pushed commits, deleting branches) without explicit confirmation. If truly needed and confirmed,--force-with-lease, never bare--force. - Confirm remote and account before pushing:
git remote -v, and the authenticated account (gh auth statusor equivalent) match what the user intends. - Small, clear commits. Imperative subject ≤ 72 chars; the body explains why when not obvious. Follow the repo's commit convention if it has one; otherwise
feat/fix/docs/chore/refactor/security. - Publishing (private → public) is irreversible in practice: forks, caches and clones keep what was public. Before the first public push scan the WHOLE tree and history, not just the last diff, for secrets AND for internal material (hostnames, internal IPs, customer names, runbooks, personal paths). Secret scanners skip prose; a human-style read of Markdown is still required.
Dependency discipline. One dependency change per commit. Review the lockfile diff, not just the manifest; never hand-edit a lockfile. Audit a new dependency with install scripts disabled first (npm ci --ignore-scripts, pip download then inspect) and pin its version.
Pre-commit secret scan
Run from the project root; <skill-dir> is where this skill is installed (e.g. ~/.agents/skills/git-safety):
bash <skill-dir>/scripts/secret-scan.sh # staged changes (default)
bash <skill-dir>/scripts/secret-scan.sh --working # all uncommitted changes
bash <skill-dir>/scripts/secret-scan.sh --file X # one file
bash <skill-dir>/scripts/secret-scan.sh --test # self-test, run after changing the patternsExit 0 = clean, 1 = review before committing; hits print with the value masked. Run the script; do not retype the pattern by hand — a hand-typed scan that misses looks exactly like one that passed. Two layers keep it worth reading: credential shapes (PAT, AWS key, PEM, JWT, Bearer) always flag; keyword-plus-assignment flags only with a real value attached, so prose about secrets does not. Prefer a dedicated scanner (gitleaks, trufflehog) for whole-history scans when available.
Standard flow
git status
git add -A # or the specific paths
bash <skill-dir>/scripts/secret-scan.sh || exit 1
git commit -m "type: concise imperative subject"
git switch -c feat/short-name # work on a branch, not main
git push -u origin feat/short-nameBefore any push
git remote -vand the authenticated account are the intended ones.- Secret scan clean.
- On a purpose-named branch (or
mainintentionally). - No force-push unless explicitly confirmed.
Merge or rebase conflict in progress
- See the state:
git status, the history of both sides, the conflicting files. - Find the primary sources for each conflict — commit messages, PRs, issues — and understand why each change was made.
- Resolve each hunk. Preserve both intents where possible; where incompatible, pick the one matching the merge's stated goal and note the trade-off. Do not invent new behaviour. Do not give up on a resolvable conflict with
--abort. - Run the project's checks (typecheck, tests, format). Fix what the merge broke.
- Finish: stage and commit; if rebasing, continue until every commit is rebased. Then the pre-push checklist.
Recovery — when it already went wrong
| State | Way out |
| Wrong content committed, not pushed | git reset --soft HEAD~1 keeps changes staged, drops the commit. Fix, re-scan, re-commit. |
| Wrong message, not pushed | git commit --amend -m "…". Never amend a commit already on the remote. |
| Staged something that should not be there | git restore --staged <path>; add to .gitignore if it will recur. |
| Pushed a commit that should be undone | git revert <sha> and push the revert. Not reset + force-push. |
| Secret already pushed | Stop touching git. The credential is compromised the moment it left the machine: rotate/revoke first, then decide about history. Removing it from history does not un-leak it. Tell the user before doing either. |
| Resolution going wrong, nothing committed | git merge --abort / git rebase --abort restores the pre-merge state — the one right use of abort. |
| Lost track of what each side said | git show :2:<path> ours, :3:<path> theirs, :1:<path> ancestor — until the merge is committed or aborted. |
| Committed the merge, resolution wrong | Not pushed: git reset --hard ORIG_HEAD. Pushed: git revert -m 1 <merge-sha>, redo the merge. |
| Rebase went sideways | git reflog lists every position; git reset --hard <sha> returns to any of them. |
| Checks fail after resolving | The merge is not done. Fix, or abort and restart; never commit to "finish it". |
| Pushed to the wrong remote/account | Deleting it is a history rewrite on someone else's repo. Tell the user which remote and commits; let them decide. |
Everything above except the secret case is local and reversible — that is why the order is scan, then commit, then push: each step is harder to undo than the last.
Original rules by the repository author. Conflict procedure from mattpocock/skills resolving-merge-conflicts (MIT © Matt Pocock, snapshot 7a83a3a); dependency discipline from addyosmani/agent-skills (MIT). See SOURCES.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

