safe-push
Skill1 starsChanged 3 months agoMITView on GitHub
Pre-push safety net. Runs full-branch security review, executes tests if available, summarizes what's about to land remote, and pushes only after explicit user confirmation. Refuses to push to main/master without an extra confirmation.
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- JetBrains/intellij-communitytheir own version, first seen Nov 7, 2026
- DetachHead/rebasedtheir own version, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- JetBrains/intellij-community★ 21ksame name
- DetachHead/rebased★ 6.5ksame 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 repository17 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- architectureSkill
- code-reviewSkill
- commandsSkill
- conventionsSkill
- debugSkill
- decisionSkill
- explainSkill
- isolateSkill
- issueSkill
- journeysSkill
- onboardSkill
- quick-workSkill
- safe-commitSkill
- scaffoldSkill
- todoSkill
- workSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 13 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
4
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
- Distinctive: line 33
If there are 0 commits to push, tell the user: "Branch is up to date with upstream.
- Distinctive: line 37
If the current branch is main or master, ask explicitly:
- Distinctive: line 41
If user says yes, proceed but note: "Pushing to main without PR — logged for awareness."
- Very specific: line 43
If they say no, stop and suggest: "Create a feature branch with git checkout -b feat/<name> and re-stage from there."
- Very specific: line 49
Use the built-in security-review skill against the full diff of the branch (vs upstream).
- Distinctive: line 54
Test files that were modified — were they made to pass artificially?
- Very specific: line 71
If a test script exists, ask: "Run tests before push?
- Distinctive: line 73
If user says yes, run:
- Distinctive: line 79
If tests fail, stop and surface failures.
- Distinctive: line 81
If user says skip, log: "Tests skipped at user request."
- Distinctive: line 98
Ask: "Proceed with push? (yes/no)"
- Distinctive: line 121
Don't push to main/master without the explicit confirmation in Phase 2.
- Very specific: line 122
Don't bypass hooks (--no-verify) or force-push (--force, -f) unless explicitly authorized.
- Distinctive: line 123
Don't push if tests failed and the user didn't explicitly accept that risk.
- Distinctive: line 124
Don't push if security blockers exist.
- Distinctive: line 125
Don't open the PR. That's a separate, explicit action.
- Distinctive: line 126
Don't auto-merge. Ever.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/safe-push — Reviewed push
You are Claude. The user is about to push commits to a remote. Your job is to make sure nothing dangerous goes out.
Phase 1 — Inspect what's about to be pushed
Run, in order:
git rev-parse --abbrev-ref HEAD # current branch
git rev-parse --abbrev-ref @{upstream} 2>/dev/null || echo "no upstream"
git log --oneline @{upstream}..HEAD 2>/dev/null || git log --oneline -10
git diff --stat @{upstream}..HEAD 2>/dev/nullPresent:
BRANCH: <current branch>
UPSTREAM: <upstream branch or "none">
COMMITS TO PUSH: <count>
<list commits>
DIFF STAT:
<file change summary>If there are 0 commits to push, tell the user: "Branch is up to date with upstream. Nothing to push." Stop.
Phase 2 — Branch protection check
If the current branch is main or master, ask explicitly:
"⚠️ You're about to push directly to
<branch>. This bypasses PR review. Are you sure? (yes/no)"
If user says yes, proceed but note: "Pushing to main without PR — logged for awareness."
If they say no, stop and suggest: "Create a feature branch with git checkout -b feat/<name> and re-stage from there."
For any other branch, proceed.
Phase 3 — Full-branch security review
Use the built-in security-review skill against the full diff of the branch (vs upstream). Same checklist as /safe-commit but over ALL commits being pushed, not just the most recent.
Pay extra attention to:
- Files staged then removed across commits — sometimes secrets leak then "deleted" but remain in history
- Test files that were modified — were they made to pass artificially?
- Migration files — are they reversible?
- Config files (
vercel.json,next.config.ts, env vars in workflows)
Present findings in same format as /safe-commit. Same rule: blockers stop the push.
Phase 4 — Tests (if available)
Detect the test setup:
# Check package.json for a test script
jq -r '.scripts.test // empty' package.json 2>/dev/null
# Check for common test runners
ls -la jest.config* vitest.config* playwright.config* 2>/dev/nullIf a test script exists, ask: "Run tests before push? (recommended, but slow if it's E2E)"
If user says yes, run:
npm test # or whatever the script isIf tests fail, stop and surface failures. Don't push failing tests.
If user says skip, log: "Tests skipped at user request."
Phase 5 — Summary
Output:
READY TO PUSH
Branch: <branch> → <upstream>
Commits: <count>
Files changed: <count>
Security review: <pass/warnings/blockers>
Tests: <passed/skipped/failed>
Will run: git push <remote> <branch>Ask: "Proceed with push? (yes/no)"
If yes:
git push origin "$(git rev-parse --abbrev-ref HEAD)"Never use --force or --no-verify unless the user explicitly requested it AND you've warned them about the consequences.
Phase 6 — Confirmation
After push succeeds:
git rev-parse HEAD
git log --oneline -3Tell the user the commit landed remote. If the project has a CI integration (.github/workflows/), remind them: "CI will pick this up shortly — watch for Vercel/Actions/etc."
What NOT to do
- Don't push to main/master without the explicit confirmation in Phase 2.
- Don't bypass hooks (
--no-verify) or force-push (--force,-f) unless explicitly authorized. - Don't push if tests failed and the user didn't explicitly accept that risk.
- Don't push if security blockers exist.
- Don't open the PR. That's a separate, explicit action.
- Don't auto-merge. Ever.
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.

