push-preflight
Push Preflight
Formalised pre-push safety check. Runs before every git push <remote> where the remote is not a local file path. Refuses on secret hits; warns on size/forbidden-file; confirms intent before pushing.
Use this skill whenever the user asks to push, or before Claude runs git push to any remote. Complements git-ops (which handles the push itself) — this is the gate that runs immediately before.
Why the name. Formerly push-gate. It runs six checks (secret scan, clean tree, forbidden files, fast-forward, size advisory, open-issue advisory), so secret-scan would undersell it, and mislead: it scans only the commits being pushed, never history (that is security-ops). The name matches scripts/preflight.sh. The secret scan leads the description because the description, not the name, is what selects the skill.
Hard rules
- Gitleaks is a required dependency. If not installed, emit the install instructions and refuse. Do not silently fall back to regex-only.
- Any secret-scanner hit ⇒ refuse. No bypass flag. Confirmed-safe findings go into the committed repo-local allowlists (
.gitleaksignorefor gitleaks,.push-preflight-allowfor the regex layer — see §False-positive handling), never an inline override. Real secrets force the user to rewrite history and re-invoke the gate. - Never
--forcepush. The gate never passes a force flag. If the user needs to force-push, that's a separate conversation with explicit authorization. - Never
--no-verify. Don't skip hooks. - Working tree must be clean. Refuse on dirty tree (uncommitted work could be accidentally stashed into the push flow).
- Remote must be named. Refuse if
git pushis called without an explicit remote and branch.