ARCHIVED. Out of date, do not use.
This skill no longer loads: it lives in archive/, not skills/. Its stack
detection is stale, and the work it gated is now covered by /factory (which
adversarially reviews every diff before merge) and /remediate (which owns the
test-verified fix loop). See the archive README for the why.
Everything below this line is the original skill, kept for reference.
Pre-Push
Everything you run before pushing to main, once you like the result. Each stage is a gate: it passes quietly, or trips on a genuine failure and stops for a fix. Never pushes — stops at the commit and hands back.
Setup
- Resolve the target repo root:
git rev-parse --show-toplevel. Fails → not a git repo, stop. Run every stage from this path.
git -C <root> status --short empty → nothing to ship, stop.
- Polish-and-ship, not build. Don't change behavior or add features.
Detect the stack
- Node:
package.json exists.
- Python: any of
pyproject.toml, setup.py, setup.cfg, requirements*.txt, Pipfile, tox.ini.
Both can be true — run both toolchains. Neither → skip stack commands, ask the user. Concrete commands per stack: stacks.md.
Gate: fixing what surfaces
A gate trips only on a genuine failure — a security defect, a failing test, a functional bug — never a style nit or theoretical note.
- Show the user the problem, location, and error/repro. Ask:
diagnosing-bugs, fix another way, or skip? Wait.
- On go, invoke
diagnosing-bugs with the specifics.
- Re-run the tripped stage, then re-run
test. Report pass/fail counts.
- If it won't resolve in a reasonable pass, stop and hand back. Never commit over a blocker.
Style nits: fix directly or leave; don't pause for them.
Stages, in order
Run each from the repo root; let it finish before the next.
- simplify — invoke
simplify.
- review — invoke
code-review (Standards + Spec; reports, doesn't fix). Functional bug → gate.
- security —
cd <root> first, else security-review silently narrows scope; then invoke it. Real issue → gate.
- test — from
stacks.md: lint/format check, pre-commit hooks if configured, then the full suite. Report pass/fail. Genuine failure → gate. Retry flaky network: a run dying on ETIMEDOUT/ECONNRESET/ENOTFOUND/EAI_AGAIN/getaddrinfo/Could not resolve host/Read timed out/Retrying/registry 50[234] is infra, not a test failure — re-run up to 3×. Any other non-zero exit is genuine; take it to the gate, don't retry. 3 network failures → stop, tell the user, don't commit on unrun tests.
- commit:
- chmod +x scripts. A push ships the whole tree, so any tracked
.sh-or-shebang file at mode 100644 breaks a Linux install. git ls-files, and for each script still 100644: git update-index --chmod=+x <path>. Report which you flipped.
- Scan for secrets in changed/staged files (SSH logs, credentials, tokens). Suspicious → stop.
- Invoke
commit, or inline: match git log --oneline -20 convention; commit staged-only if anything's staged else git add -A; message states intent, not a file list; git commit with native hooks — never --no-verify/--no-gpg-sign/amend.
Done
Summarize: stack, simplify changes, review findings, debug-loop fixes, scripts flipped, test counts (and retries), commit hash. State it's committed, ready to push, and not pushed.
1---2name: pre-push3description: Pre-push orchestrator — detect Python/Node stack, then run simplify, review, security, test, commit as gated stages (retry flaky network, chmod +x scripts, stop on real failures). Use when ready to push to main, or on "pre-push", "clean up before pushing", "polish and commit", "finalize", "ship it".4---56> **ARCHIVED. Out of date, do not use.**7>8> This skill no longer loads: it lives in `archive/`, not `skills/`. Its stack9> detection is stale, and the work it gated is now covered by `/factory` (which10> adversarially reviews every diff before merge) and `/remediate` (which owns the11> test-verified fix loop). See [the archive README](../README.md) for the why.12>13> Everything below this line is the original skill, kept for reference.1415---1617# Pre-Push1819Everything you run before pushing to main, once you like the result. Each stage is a **gate**: it passes quietly, or trips on a genuine failure and stops for a fix. Never pushes — stops at the commit and hands back.2021## Setup2223- Resolve the **target repo** root: `git rev-parse --show-toplevel`. Fails → not a git repo, stop. Run every stage from this path.24- `git -C <root> status --short` empty → nothing to ship, stop.25- Polish-and-ship, not build. Don't change behavior or add features.2627## Detect the stack2829- **Node**: `package.json` exists.30- **Python**: any of `pyproject.toml`, `setup.py`, `setup.cfg`, `requirements*.txt`, `Pipfile`, `tox.ini`.3132Both can be true — run both toolchains. Neither → skip stack commands, ask the user. Concrete commands per stack: [`stacks.md`](stacks.md).3334## Gate: fixing what surfaces3536A gate trips only on a **genuine failure** — a security defect, a failing test, a functional bug — never a style nit or theoretical note.37381. Show the user the problem, location, and error/repro. Ask: `diagnosing-bugs`, fix another way, or skip? Wait.392. On go, invoke `diagnosing-bugs` with the specifics.403. Re-run the tripped stage, then re-run `test`. Report pass/fail counts.414. If it won't resolve in a reasonable pass, stop and hand back. Never commit over a blocker.4243Style nits: fix directly or leave; don't pause for them.4445## Stages, in order4647Run each from the repo root; let it finish before the next.48491. **simplify** — invoke `simplify`.502. **review** — invoke `code-review` (Standards + Spec; reports, doesn't fix). Functional bug → gate.513. **security** — `cd <root>` first, else `security-review` silently narrows scope; then invoke it. Real issue → gate.524. **test** — from `stacks.md`: lint/format check, pre-commit hooks if configured, then the full suite. Report pass/fail. Genuine failure → gate. **Retry flaky network:** a run dying on `ETIMEDOUT`/`ECONNRESET`/`ENOTFOUND`/`EAI_AGAIN`/`getaddrinfo`/`Could not resolve host`/`Read timed out`/`Retrying`/registry `50[234]` is infra, not a test failure — re-run up to 3×. Any other non-zero exit is genuine; take it to the gate, don't retry. 3 network failures → stop, tell the user, don't commit on unrun tests.535. **commit**:54 - **chmod +x scripts.** A push ships the whole tree, so any tracked `.sh`-or-shebang file at mode `100644` breaks a Linux install. `git ls-files`, and for each script still `100644`: `git update-index --chmod=+x <path>`. Report which you flipped.55 - **Scan for secrets** in changed/staged files (SSH logs, credentials, tokens). Suspicious → stop.56 - Invoke `commit`, or inline: match `git log --oneline -20` convention; commit staged-only if anything's staged else `git add -A`; message states intent, not a file list; `git commit` with native hooks — never `--no-verify`/`--no-gpg-sign`/amend.5758## Done5960Summarize: stack, `simplify` changes, review findings, debug-loop fixes, scripts flipped, test counts (and retries), commit hash. State it's committed, ready to push, and **not** pushed.