pre-push
Skill2 starsChanged 7 days agoMITView on GitHub
Pre-flight checklist before a git push: commits-to-ship summary plus branch-name, commit-hygiene, AI-attribution, staged-leftover, debug-artifact, hook-bypass and unresolved-secret checks; stops on any flag, never pushes past it. Auto-fires when about to run git push or on \"push this\" or \"send it up\". Skip on the scratch branch or when told to skip it. /pre-push.
- Commits and pushes
6 other projects use a version of this.
Adopted by
Most recently taken up by
- strands-agents/harness-sdktheir own version, first seen Oct 14, 2026
- AlexZio00/sovereign-skillstheir own version, first seen Oct 9, 2026
- strands-agents/sdk-pythontheir own version, first seen Oct 8, 2026
- chenson42/stackkeeltheir own version, first seen Sep 22, 2026
- Sanexxxx777/curated-claude-codetheir own version, first seen Jun 28, 2026
- POSTTTT/SKILLstheir own version, first seen Jun 9, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- strands-agents/sdk-python★ 9.1ksame name
- strands-agents/harness-sdk★ 8.9ksame name
- AlexZio00/sovereign-skills★ 157same name
- Sanexxxx777/curated-claude-code★ 16same name
- chenson42/stackkeel★ 1same name
- POSTTTT/SKILLs★ 1same 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 repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- autonomizeSkill
- blueprintSkill
- brainstormSkill
- captureSkill
- checkpointSkill
- close-outSkill
- coordinateSkill
- cycleSkill
- deliverSkill
- design-proposalSkill
- discoverSkill
- dispatchSkill
- draft-planSkill
- envisionSkill
- executeSkill
- extract-conventionsSkill
- glossarySkill
- humanizeSkill
- human-viewSkill
- improve-promptSkill
- memory-auditSkill
- new-agentSkill
- new-agents-mdSkill
- new-hookSkill
- new-mcpSkill
- orchestrateSkill
- pr-authorSkill
- prepSkill
- pr-triageSkill
- recapSkill
- retrospect-coreSkill
- reviewSkill
- rulesSkill
- shortcutsSkill
- specSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- update-changelogSkill
- update-codemapSkill
- using-git-worktreesSkill
- visualise-codemapSkill
- visualSkill
- work-stateSkill
- wrapSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 55
Run the seven checks. Each is tick (pass, silent) or flag (surface).
- Distinctive: line 63
Secret-hook carry-forward: If the session's security hooks flagged a secret in a recent Write that wasn't resolved, that flag is a stop …
- Distinctive: line 76
Run the actual git push command the user intended (preserve their flags — if they said git push -u origin feature, run that exact form).
- Distinctive: line 90
Does not push past a flag silently: Every flag stops the flow until the user resolves or overrides it.
“Common” is measured: kept by at least 6 in 10 of the 6 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
pre-push
Reviewee-side pre-flight before a git push. The first of the GitHub reviewee triad; siblings are pr-author and pr-triage. The reviewer-side counterpart is review --pr.
Whatever the local branch is, that's what ships to the remote. Most pre-push issues are catchable in seconds; none are caught when the push is improvised inline. This skill runs the checklist once, surfaces flags, and stops on a flag — it does not push past a problem on its own.
Triad-wide boundary — no Claude-initiated GitHub writes. Across all three skills, Claude never runs a gh command (or any API call) that writes to GitHub — no gh pr create, no gh pr comment, no thread reply, no gh api POST. Those are drafted and handed to the user to run. Claude does apply local changes (working-tree code edits, staging) and runs read-only gh calls (gh pr view, gh api GET). git push is the one remote-touching action Claude runs — and only the exact push the user asked for, only after the checklist passes — because it ships the user's own commits via git, not via GitHub's API on the user's behalf. The rule: Claude prepares; the user is the one who speaks to GitHub.
Auto-fires via this description, not a hook (per skill-auto-fire (architectural rule)). The right moment is "about to push" — a concept that only exists once a push is imminent, so a SessionStart hook would fire against nothing.
When to run
Auto-fire when:
- About to run a Bash command matching
git push(any form —git push,git push -u origin <b>,git push origin HEAD, etc.). - The user says "push this", "push the branch", "send it up", or equivalent.
Skip when:
- The push target is the user's configured scratch branch (see Configuration). Scratch pushes are intentionally low-ceremony.
- The user explicitly says "skip pre-push", "force push, I know", or similar. Back off; run the push the user asked for.
- This is a re-push in the same session and nothing has changed since the last passing run (don't re-run the full checklist on every push of an unchanged branch — say so and proceed).
Manual trigger: /pre-push.
Procedure
1. Surface what's about to be pushed
Determine the upstream:
git rev-parse --abbrev-ref --symbolic-full-name @{u}- Has upstream → list the commits being sent and the size:
git log @{u}..HEAD --oneline git diff --stat @{u}..HEAD - No upstream yet (first push) → surface that explicitly. First push is a different animal: it sets tracking and creates the remote ref. List the commits relative to the base branch instead:
Resolvegit log <base>..HEAD --oneline git diff --stat <base>..HEAD<base>per pr-author's base detection (git symbolic-ref refs/remotes/origin/HEAD, fall back to main/master/trunk).
Show the user a one-block summary: branch, upstream (or "first push — no upstream"), N commits, +A/-D lines.
2. Pre-flight checklist
Run the seven checks. Each is tick (pass, silent) or flag (surface). Optionally load project rules first via discover (kind: "architectural-rule", scopes [git, <detected-language>, global]) to pick up project branch-name / commit conventions; fall back to the built-in smells when no project rule exists.
- Branch name follows convention. Per project standards if discovery surfaced any; else flag obvious smells: spaces, leading slash, bare
wip/test/asdf/tmp, uppercase-only, or a name identical to the default branch. - Commits clean. No
fixup!/squash!/wipprefixes still ingit log @{u}..HEAD(or<base>..HEADon first push). These belong squashed before push, not after. - No AI-attribution lines. Scan the commit messages in range for
Co-Authored-By:,Generated with,🤖, or any AI-attribution footer. Flag any hit — per git.md, commit history never carries AI attribution. - No staged-but-uncommitted leftovers.
git diff --cached --statnon-empty means staged changes that won't be in the push but linger in the index. A dirty working tree is fine (unstaged work in progress); staged leftovers are usually an accident — flag them. - No debug artifacts in the diff. Scan
git diff @{u}..HEAD(or<base>..HEAD) for printf-debugging and hardcoded test scaffolding:console.log(/print(/println!/dbg!(/debuggerin non-test files, hardcodedlocalhost/127.0.0.1URLs, hardcoded test credentials or tokens. Report file:line for each hit. (Self-evident; don't flag legitimate logging frameworks or test files.) - Hooks not bypassed. Check the hook-skip arming log: if the
allow-skip-hookscounter was armed during this session (its log/state file records arming events), list the armed commands and ask whether the bypassed hooks' checks were satisfied another way.--no-verifyitself leaves no git-side trace — the arming log is the only reliable signal, so absence of an arming event plus active hooks counts as a pass. - Secret-hook carry-forward. If the session's security hooks flagged a secret in a recent Write that wasn't resolved, that flag is a stop condition here — a secret must not reach the remote. Surface it as a hard flag.
3. Decide
- All checks pass → confirm with one line and proceed:
All checks pass. Push to
origin/<branch>? - Any check flagged → surface every flag with file:line where applicable, propose the fix for each, and wait. Do not push past a flag without explicit user say-so. The user can:
- Fix the flagged item (skill helps), then re-run from step 2.
- Override a specific flag ("that localhost URL is intentional, push anyway") — proceed, noting the override.
- Cancel the push.
4. Push
- Run the actual
git pushcommand the user intended (preserve their flags — if they saidgit push -u origin feature, run that exact form). - Capture output. On non-zero exit, surface the error verbatim and stop. Do not retry silently and do not add flags (no auto
--force, no auto--no-verify). - On success, surface the result. If this was a first push to a non-default branch with no open PR, hand off to pr-author — its auto-fire moment ("post-push, no PR") has just occurred.
Configuration
Per-repo scratch-branch exemption lives in the project's .claude/ config when present. Absent config, treat no branch as exempt — run the checklist on every push. The user can always say "skip pre-push" inline for a one-off.
What pre-push does NOT do
- Does not force-push. It never constructs a
--force/--force-with-leaseflag itself. The user runs force-push manually if they mean to. - Does not bypass hooks. It never adds
--no-verify. It reads theallow-skip-hooksarming log for diagnostic traces of prior bypass, but respects an active arming and never interferes with it. - Does not run the full review. Pre-push is a fast hygiene pass, not review. A diff-level audit is a separate, heavier skill; running it here would make every push slow.
- Does not commit. It surfaces staged leftovers and dirty trees; it doesn't decide commit granularity for the user.
- Does not push past a flag silently. Every flag stops the flow until the user resolves or overrides it.
Relationship to other organs
- pr-author — fires right after a first push to a non-default branch with no PR. pre-push hands off to it.
- git.md — the source for commit hygiene + AI-attribution checks (checks 2, 3).
- discover — optional rule retrieval for project-specific branch-name / commit conventions (check 1).
- security hooks — their unresolved secret flags become pre-push stop conditions (check 7).
allow-skip-hooks— pre-push respects its arming; intentional hook-skips under it are not flagged (check 6).
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.

