Pre-Push Readiness Gate
Answer one question: "If I push right now, will I regret it?" This is a fast,
focused pre-flight check of what is actually about to be published — not a deep
code review. Run read-only, then give a clear verdict.
Key principle: a file being in .gitignore does NOT mean it's safe. .gitignore
only affects untracked files. A secret that was committed before being ignored, a
key hardcoded in source, or a secret in history will still push. This gate checks
reality (git state), not just the rules.
What this skill is (and isn't)
- It is a gate: a quick checklist run right before commit/push.
- It is not the
gitignore skill (which writes ignore rules) or security-audit
(deep OWASP review). When this gate finds a rules gap or wants depth, it defers:
"Your .gitignore is missing X — want me to run the gitignore skill?" Skills
can't call each other programmatically, so recommend and let the user trigger them.
Step 1 — Read the real git state
git status --porcelain — what's staged / modified / untracked.
git diff --cached — exactly what the next commit will contain.
git ls-files — what's already tracked (the stuff .gitignore can't save you from).
- Current branch (
git branch --show-current) and whether commits are ahead of remote.
Step 2 — Run the checklist
A. Secrets about to ship (highest priority)
Scan the staged diff, tracked files, AND source contents for:
- API keys / tokens:
api[_-]?key, secret, token, Bearer , AKIA[0-9A-Z]{16}
(AWS), Google/Stripe/GitHub token shapes, high-entropy strings.
- Private keys:
-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----.
- Hardcoded passwords / connection strings (
password=, mongodb://user:pass@).
- Secret files being tracked:
.env, .env.* (except .env.example), *.pem,
*.key, credential JSON, .npmrc/.pypirc with tokens.
- Check both: is the secret file tracked (
git ls-files)? Is a secret hardcoded
in committed source? Either is a blocker even if .gitignore lists the file.
B. Environment / dependency dirs being tracked
.venv/ venv/ env/ (Python), node_modules/, __pycache__/, build output
(dist/, build/, .next/, target/). If tracked, that's bloat/leakage — flag it.
C. Personal / sensitive information (PII)
- Real emails, full names, phone numbers, addresses, real customer data, internal
hostnames/IPs in committed content. Distinguish placeholders from real data.
D. Repo hygiene
- Leftover merge-conflict markers:
<<<<<<<, =======, >>>>>>>.
- Debug leftovers:
console.log dumps, debugger, print() debugging, TODO/FIXME
that block release, commented-out secrets.
- Large/binary files that shouldn't be in git (consider Git LFS).
- Empty or nonsense commit, or committing on the wrong branch (e.g. straight to
main).
E. .gitignore sanity
- Are
.env, .venv, node_modules, build dirs ignored and not already tracked?
- If rules are missing → defer to the
gitignore skill.
Step 3 — Verdict
Give a clear, scannable result:
Pre-push check — <branch> — <date>
⛔ BLOCKERS (do not push)
- [SECRET] AWS key hardcoded in src/config.js:12
- [TRACKED] .env is tracked (git ls-files) — will publish DB password
⚠️ WARNINGS (review)
- .venv/ is tracked (412 files) — bloat
- Leftover console.log at src/app.js:88
✅ OK
- No conflict markers, .gitignore covers build output
Verdict: NOT READY — 2 blockers.
Always end with the safe next actions, e.g.:
Rules
- Read-only. Report the verdict; don't commit, push, or edit. Fix only what the
user approves, and surface
git rm --cached rather than running it silently.
- Blocker vs warning: secrets/keys/PII about to publish = BLOCKER. Bloat, debug
leftovers, style = WARNING. Be explicit which is which.
- Don't echo full secret values — show the location and a masked snippet; the goal
is to flag, not to reprint the secret.
- Rotate, don't just delete: any secret that already reached a commit must be
treated as compromised — say so.
- Defer, don't duplicate: lean on
gitignore and security-audit for fixes/depth.
1---2name: pre-push3description: Pre-flight safety gate that checks whether the project is actually safe to commit/push to GitHub (or any remote) RIGHT NOW. Use when the user asks "is this ready to push?", "can I commit this?", "check before I push", "did I leave any secrets in", "ready for GitHub?". Inspects the real git state — staged diff, tracked files, source, and history — for secrets/API keys, .env/.venv being tracked, PII, leftover debug/conflict markers, and .gitignore gaps. Read-only; reports a clear ready/blockers verdict and defers to the gitignore and security-audit skills for fixes.4---56# Pre-Push Readiness Gate78Answer one question: **"If I push right now, will I regret it?"** This is a fast,9focused pre-flight check of what is *actually about to be published* — not a deep10code review. Run read-only, then give a clear verdict.1112Key principle: **a file being in `.gitignore` does NOT mean it's safe.** `.gitignore`13only affects *untracked* files. A secret that was committed before being ignored, a14key hardcoded in source, or a secret in history will still push. This gate checks15**reality** (git state), not just the rules.1617## What this skill is (and isn't)1819- It **is** a gate: a quick checklist run right before commit/push.20- It is **not** the `gitignore` skill (which writes ignore rules) or `security-audit`21 (deep OWASP review). When this gate finds a rules gap or wants depth, it **defers**:22 "Your `.gitignore` is missing X — want me to run the `gitignore` skill?" Skills23 can't call each other programmatically, so recommend and let the user trigger them.2425## Step 1 — Read the real git state2627- `git status --porcelain` — what's staged / modified / untracked.28- `git diff --cached` — exactly what the next commit will contain.29- `git ls-files` — what's already tracked (the stuff `.gitignore` can't save you from).30- Current branch (`git branch --show-current`) and whether commits are ahead of remote.3132## Step 2 — Run the checklist3334### A. Secrets about to ship (highest priority)35Scan the staged diff, tracked files, AND source contents for:36- API keys / tokens: `api[_-]?key`, `secret`, `token`, `Bearer `, `AKIA[0-9A-Z]{16}`37 (AWS), Google/Stripe/GitHub token shapes, high-entropy strings.38- Private keys: `-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----`.39- Hardcoded passwords / connection strings (`password=`, `mongodb://user:pass@`).40- Secret files being **tracked**: `.env`, `.env.*` (except `.env.example`), `*.pem`,41 `*.key`, credential JSON, `.npmrc`/`.pypirc` with tokens.42- **Check both:** is the secret file *tracked* (`git ls-files`)? Is a secret *hardcoded43 in committed source*? Either is a blocker even if `.gitignore` lists the file.4445### B. Environment / dependency dirs being tracked46- `.venv/` `venv/` `env/` (Python), `node_modules/`, `__pycache__/`, build output47 (`dist/`, `build/`, `.next/`, `target/`). If tracked, that's bloat/leakage — flag it.4849### C. Personal / sensitive information (PII)50- Real emails, full names, phone numbers, addresses, real customer data, internal51 hostnames/IPs in committed content. Distinguish placeholders from real data.5253### D. Repo hygiene54- Leftover merge-conflict markers: `<<<<<<<`, `=======`, `>>>>>>>`.55- Debug leftovers: `console.log` dumps, `debugger`, `print()` debugging, `TODO/FIXME`56 that block release, commented-out secrets.57- Large/binary files that shouldn't be in git (consider Git LFS).58- Empty or nonsense commit, or committing on the wrong branch (e.g. straight to `main`).5960### E. .gitignore sanity61- Are `.env`, `.venv`, `node_modules`, build dirs ignored **and not already tracked**?62- If rules are missing → defer to the `gitignore` skill.6364## Step 3 — Verdict6566Give a clear, scannable result:6768```69Pre-push check — <branch> — <date>7071⛔ BLOCKERS (do not push)72 - [SECRET] AWS key hardcoded in src/config.js:1273 - [TRACKED] .env is tracked (git ls-files) — will publish DB password7475⚠️ WARNINGS (review)76 - .venv/ is tracked (412 files) — bloat77 - Leftover console.log at src/app.js:887879✅ OK80 - No conflict markers, .gitignore covers build output8182Verdict: NOT READY — 2 blockers.83```8485Always end with the safe next actions, e.g.:86- Untrack a committed file (keep it locally):87 ```bash88 git rm --cached .env && echo ".env" >> .gitignore89 ```90- **If a secret already reached a commit/history:** removing it from tracking does NOT91 scrub history. Recommend **rotating the secret immediately**, and history rewrite92 (`git filter-repo` / BFG) if it must be purged.93- Offer to run `gitignore` (fix rules) or `security-audit` (deep review) as follow-ups.9495## Rules9697- **Read-only.** Report the verdict; don't commit, push, or edit. Fix only what the98 user approves, and surface `git rm --cached` rather than running it silently.99- **Blocker vs warning:** secrets/keys/PII about to publish = BLOCKER. Bloat, debug100 leftovers, style = WARNING. Be explicit which is which.101- **Don't echo full secret values** — show the location and a masked snippet; the goal102 is to flag, not to reprint the secret.103- **Rotate, don't just delete:** any secret that already reached a commit must be104 treated as compromised — say so.105- **Defer, don't duplicate:** lean on `gitignore` and `security-audit` for fixes/depth.