pre-push-checks
Skill2 starsChanged 28 days agoMITView on GitHub
Use before pushing, force-pushing, marking a pull request ready for review, or claiming checks pass, and immediately after a tool that rewrites and publishes in one step (such as a stacked-pull-request sync) has pushed rewritten branches, to select the smallest tests and checks that cover the outgoing diff without reflexively running the full repository suite, and to push history rewrites safely.
- Deletes or force-pushes
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- dbeaver/cloudbeavertheir own version, first seen Nov 8, 2026
- BrivaHamisi/laravel-shipkittheir own version, first seen Sep 26, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- dbeaver/cloudbeaver★ 5.2ksame name
- BrivaHamisi/laravel-shipkit★ 0same 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.
- agent-experienceSkill
- agent-notesSkill
- code-reviewSkill
- docs-standardSkill
- error-handlingSkill
- find-simplificationsSkill
- lifecycle-reviewSkill
- perf-evidenceSkill
- prose-standardSkill
- record-browser-gifSkill
- responsive-uiSkill
- stacked-prsSkill
- test-reliabilitySkill
- trim-cot-leakageSkill
- ui-ux-reviewSkill
- upgrade-guideSkill
- vibe-harness-bootstrapSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 11 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
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
- Distinctive: line 14
After merging a changed base, rerun the scope listing, reassess which behavior the combined scope can affect, and rerun only the checks the …
- Distinctive: line 20
When the change adds or alters a resource-owning or asynchronous test, fixture, or CI path, use test-reliability first to decide whether …
- Very specific: line 22
Source behavior: run commands.focused-test on the owning test file or test name.
- Very specific: line 24
Documentation, Agent Notes, or doc-linked comments: run commands.docs-check and git diff --check.
- Distinctive: line 26
Model-, user-, CLI-, or terminal-visible output: run the focused snapshot or end-to-end scenario that owns the output, as named in the …
- Very specific: line 27
Real provider or external-service behavior: run commands.e2e for the relevant target when credentials are available.
- Distinctive: line 29
Do not repeat a passing check merely because a commit or push follows, and do not duplicate what a git hook already runs.
- Distinctive: line 31
When filtering tests, check the reported selected-test count before treating a filtered run as focused evidence: argument forwarding …
- Distinctive: line 49
After any rewritten push, fetch the live heads again and re-audit unresolved review threads, approvals, mergeability, and checks.
- Distinctive: line 57
Run the relevant evidence selected by this skill for each affected branch.
- Distinctive: line 58
Keep every pull request unmerged and report validation as pending until all selected checks pass.
- Distinctive: line 60
If post-sync evidence fails, leave the lease-protected published heads in place, repair the failure, validate the repair, and publish the …
- Distinctive: line 68
Run the selected relevant checks once.
- Distinctive: line 69
Commit normally and inspect any files changed by a pre-commit fixer before continuing.
- Very specific: line 71
Verify the remote ref matches local HEAD: git rev-parse HEAD origin/$(git branch --show-current).
≈ “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
Pre-push checks
Run relevant local evidence once before a push. The sole ordering exception is a tool that rewrites and publishes in one step, such as a native stacked-pull-request sync: validate immediately afterward (see "Validate after a combined rewrite and publish") and do not merge until the evidence passes. CI owns exhaustive coverage and the platform matrix; local work owns the narrow evidence that would fail for this change's regression. Commands come from the project profile (.agents/project-profile.md); the profile's "Evidence by surface" table maps change types to evidence. This is guidance, not a script.
Inspect the outgoing change
- Confirm the checkout and branch:
git status --short --branchandgit rev-parse --show-toplevel. - Verify the live pull-request base (or stack parent), fetch that ref, and list the committed scope against it with the profile's
commands.change-scope. Never guess a base. Unless that command already reports the worktree, addgit status --shortfor staged, unstaged, and untracked paths. To inspect a commit other thanHEAD, usegit diff --name-status <base>...<head>. - After merging a changed base, rerun the scope listing, reassess which behavior the combined scope can affect, and rerun only the checks the merge invalidated.
Select relevant evidence
There is no universal local baseline beyond the project's git hooks; read the profile's "Hooks and CI" section to learn what they already run. Every behavior change needs the narrowest available test or purpose-built check that would fail for its regression; add broader checks only for surfaces the diff actually reaches.
When the change adds or alters a resource-owning or asynchronous test, fixture, or CI path, use test-reliability first to decide whether restoration, negative-control, quiescent-teardown, or concurrent-process evidence applies.
- Source behavior: run
commands.focused-teston the owning test file or test name. Add adjacent tests when a shared contract changes; leave repository-wide coverage to CI unless the change is genuinely cross-cutting or the user asks. - Types and public exports: run
commands.typecheck, and confirm it covers test and script files as well as shipped sources: a check scoped to package sources alone does not prove their types. If it does not, run the project's check that does before claiming completion. When the check reads generated or prebuilt declarations, rebuild missing, stale, or partial output first; a check run against stale output is not evidence. Loose typing in a test double is not type evidence; keep that loosening in the test helper, never in production types or global compiler flags. For manifests, exports, build configuration, or entry points, also runcommands.buildand a smoke run of the built artifact. - Documentation, Agent Notes, or doc-linked comments: run
commands.docs-checkandgit diff --check. - User-visible UI: when the profile enables
surfaces.ui, use theui-ux-reviewskill's UI change workflow and its minimum checks to verify required inspection and new cumulative effects. Disclose missing checks; optional paperwork is not a substitute for inspecting the result. Reuse valid evidence; ordinary changes need no separate full-audit report at push time. Keep the project's test, GIF evidence, and design or product review requirements. Tests alone do not establish visual acceptance. - Model-, user-, CLI-, or terminal-visible output: run the focused snapshot or end-to-end scenario that owns the output, as named in the profile.
- Real provider or external-service behavior: run
commands.e2efor the relevant target when credentials are available; never print secrets.
Do not repeat a passing check merely because a commit or push follows, and do not duplicate what a git hook already runs.
When filtering tests, check the reported selected-test count before treating a filtered run as focused evidence: argument forwarding through package-manager scripts differs between tools, and a filter that silently matches nothing proves nothing.
Focus coverage on the affected source
Test selection and coverage selection are separate. When coverage is relevant, name both the owning tests and the source files whose coverage they must prove, using the runner's coverage-include option. Include an exact source file when the behavior is confined to one module, and pass every owning test needed to exercise the included scope; the configured thresholds still apply inside it.
When the owning tests are unclear, use the runner's dependency-graph discovery (for example a "related tests" mode) to find candidates, then inspect the selection before treating the run as evidence. Discovery cannot find behavior reached only through configuration, dynamic loading, subprocesses, workers, built artifacts, or external providers; select those tests explicitly.
Do not pass "no tests is a pass" flags, lower thresholds, or narrow the coverage scope merely to hide an uncovered affected file. If an included scope fails because one focused test does not cover it, add its other owning tests, or narrow the scope only when the excluded modules cannot be affected by the change.
Full local rehearsal
Run the complete local approximation of CI only when the user explicitly asks, while diagnosing a CI failure, or when the change spans the repository so broadly that no narrower set is credible. Take its inventory from the current CI workflow definitions (see the profile's "Hooks and CI"), usually commands.full-test, commands.coverage, commands.lint, and commands.build, not from a remembered or aggregate command.
Protect history-rewriting pushes
Rebasing a branch, including after review, is allowed when the project rules permit it. Before a history rewrite, fetch the remote branch and record its exact commit; publish with git push --force-with-lease=<branch>:<observed-commit> so a concurrent update aborts the push. Raw --force is never allowed.
After any rewritten push, fetch the live heads again and re-audit unresolved review threads, approvals, mergeability, and checks. Commit hashes and inline-comment anchors from before the rewrite are not current evidence. For native stacked pull requests, use the stacked-prs skill when it is installed.
Validate after a combined rewrite and publish
A native stacked-pull-request sync fetches, cascade-rebases, and pushes as one operation, so local validation cannot sit between the rewrite and its publication. A stack tool that supplies its own lease protection satisfies the lease rule above for the branches it manages. Before running one, require a clean worktree and record the stack order and the exact remote heads. After it returns:
- Re-query every branch head and the live stack order.
- Inspect the changed scope of every rewritten branch against its live pull-request base.
- Run the relevant evidence selected by this skill for each affected branch.
- Keep every pull request unmerged and report validation as pending until all selected checks pass.
If post-sync evidence fails, leave the lease-protected published heads in place, repair the failure, validate the repair, and publish the correction. Do not claim the sync made the stack ready merely because the command succeeded.
Handle failures
If a relevant check fails, stop and fix or explain the blocker. Do not push and hope CI differs. After a combined rewrite and publish, block the merge and follow the repair procedure above instead. If a failure looks environment-specific, prove it: record the exact command, failing test, and platform-specific mismatch; confirm the relevant non-platform evidence; prefer fixing cross-platform nondeterminism. Bypass a local hook only when the user explicitly agrees, and report exactly what failed and why CI is expected to differ.
Push procedure
- Run the selected relevant checks once.
- Commit normally and inspect any files changed by a pre-commit fixer before continuing.
- Push normally, or with the exact lease for an authorized rewrite, so the pre-push hook runs.
- Verify the remote ref matches local
HEAD:git rev-parse HEAD origin/$(git branch --show-current).
For a combined rewrite and publish, use the post-sync validation sequence instead of this order.
For a hosted pull request, inspect remote CI after the push (for example gh pr checks when vcs.pr-cli is gh). Report pending checks as pending, and inspect failures before attributing them to the branch or the environment.
When a GitHub pull request reports no checks at all and the Actions API lists no workflow runs for its head commit (/actions/runs?head_sha=<sha> returns total_count: 0), read its mergeability (gh pr view <number> --json mergeable,mergeStateStatus) before suspecting the push: GitHub creates no pull-request workflow runs while a pull request is conflicting. Resolving the conflict is the only fix; empty commits, draft toggles, and revert-and-restore pushes leave the runs absent and add junk history. When the branch cannot be merged locally yet, list the conflicting paths with git merge-tree --write-tree HEAD origin/<base>.
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.

