git-safety
Skill404 starsChanged 45 days agoApache-2.0View on GitHub
Stops an agent from destroying uncommitted work with git. Requires git status and git diff before any command that discards changes, treats "revert" and "undo" as manual edits, and never runs reset, checkout, clean, stash drop, or force push without explicit approval. Use when a task involves reverting, undoing, resetting, cleaning, rebasing, or force pushing, or before any git command in a repo with uncommitted changes.
- 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
- haintbotast/coding-agent-instructionstheir own version, first seen Oct 25, 2026
- Tsurai7/agentic-playbooktheir own version, first seen Oct 20, 2026
- tamagui/tamaguitheir own version, first seen Oct 8, 2026
Used with
Projects with it also use verification-before-completion.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillverification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Also in 3 projects that use this
Other versions11 projects use a version of this.
Word for word · 1
- waynesutton/convexskills★ 405100% same
Edited · 0
None found.
Wrote their own version · 10
- tamagui/tamagui★ 14ksame 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
- haintbotast/coding-agent-instructions★ 0same name
- kartykk/agent-ready★ 0same name
- TrueImmortal82/open-code-skills★ 0same name
- Tsurai7/agentic-playbook★ 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 repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- avoid-feature-creepSkill
- convex-agentsSkill
- convex-best-practicesSkill
- convex-component-authoringSkill
- convex-cron-jobsSkill
- convex-file-storageSkill
- convex-functionsSkill
- convex-http-actionsSkill
- convex-migrationsSkill
- convex-realtimeSkill
- convex-schema-validatorSkill
- convex-security-auditSkill
- convex-security-checkSkill
- convexSkill
- project-docsSkill
- project-workflowSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
If anything is modified or untracked, stop.
- Distinctive: line 18
Never run these on your own.
- Distinctive: line 35
When the user says "revert that", "undo that", or "go back":
- Distinctive: line 37
Ask which change. Committed or uncommitted?
- Distinctive: line 39
Read the current file.
- Distinctive: line 43
Do not reach for git checkout or git restore.
- Distinctive: line 53
Do not commit, push, tag, publish, or deploy unless the user asks in the current message.
- Distinctive: line 72
Before a git command:
- Distinctive: line 79
When asked to revert or undo:
“Common” is measured: kept by at least 6 in 10 of the 10 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
These rules exist because one git checkout -- . erased two days of work. Follow them every time, not only when it feels risky.
Before any git command
git status. Read it.- If anything is modified or untracked, stop. Say what is there. Ask before proceeding with anything that could touch those files.
- Suggest
git stash push -m "<why>"if the user needs a clean tree and wants the work kept.
Commands that need explicit approval
Never run these on your own. Show the exact command, say what it will destroy, and wait for a yes.
| Command | What it destroys |
git reset --hard | every uncommitted change |
git checkout -- <file> or git restore <file> | uncommitted changes in that file |
git checkout -- . or git restore . | uncommitted changes in every file |
git clean -fd | every untracked file and folder |
git stash drop or git stash clear | stashed work |
git push --force or --force-with-lease | remote history other people may have |
git branch -D | a branch and any commits only it holds |
git rebase on a shared branch | commit ids other people have |
"Explicit approval" means the user saw the command and said yes to it. A general "go ahead" from earlier in the conversation does not count.
Revert and undo mean edit
When the user says "revert that", "undo that", or "go back":
- Ask which change. Committed or uncommitted? All of it or one part?
git diff <file>to see exactly what would be lost.- Read the current file.
- Edit the file by hand to remove the specific lines that are wrong. Keep everything else.
- Show the result.
Do not reach for git checkout or git restore. They remove everything in the file, including the parts the user liked.
For committed changes, git revert <sha> is safe because it creates a new commit. Still show the sha and the commit message first.
Diff before discard
Any time a change is about to be thrown away, the user sees git diff output for it first. No exceptions. If the diff is long, show git diff --stat and offer the full diff.
Commits, pushes, deploys
Do not commit, push, tag, publish, or deploy unless the user asks in the current message. When the work is done, print a suggested commit message and stop.
Suggested commit:
fix: dedupe heartbeat writes within 10s windowSafe defaults
These are fine to run without asking:
git status,git log,git diff,git show,git blamegit stash push -m "<message>"when the user asked for a clean treegit add <specific files>when the user asked to commitgit checkout -b <new-branch>from a clean treegit revert <sha>after showing the commit
Checklist
Before a git command:
git statusran and I read it- no uncommitted work is in the blast radius, or the user approved
- I showed
git difffor anything being discarded - the command is not in the approval table, or the user said yes to this exact command
When asked to revert or undo:
- I know which change and whether it is committed
- I am editing the file, not checking it out
- everything the user did not mention stays
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.

