pre-push-checks
Skill0 starsChanged 48 days agoMITView on GitHub
Run the production build, secrets scan, Pint, static analysis and the full test suite automatically before every git push, and the same checks in GitHub Actions CI. Use when setting up git hooks, a pre-push hook, composer check scripts, CI workflows, or when broken builds, failing tests or leaked secrets keep reaching the main branch.
- 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
- zehuichan/vibe-harnesstheir own version, first seen Oct 17, 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
- zehuichan/vibe-harness★ 2same 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 repository11 other files it gives its agents.
- bot-proof-formsSkill
- image-uploadsSkill
- inertia-admin-tablesSkill
- json-ld-structured-dataSkill
- mpesa-stk-pushSkill
- paypal-checkoutSkill
- secrets-scannerSkill
- seo-crawlabilitySkill
- shared-network-rate-limitsSkill
- social-share-previewsSkill
- wordpress-migrationSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Add phpstan analyse, npm run lint or tsc --noEmit when the project has them.
- Very specific: line 39
Run composer hooks:install once per clone.
≈ “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
One command, composer check:push, runs everything that must pass before code leaves your machine. A git pre-push hook runs it automatically, and CI runs the identical command, so "works on my machine" and "CI is red" stop disagreeing.
Agent safety
- Ask the user before enabling the hook.
composer hooks:installchanges only this repository's git config (core.hooksPath=.githooks). Nothing system-wide, global or outside the project is touched. - The hook runs the project's own scripts (
composer check:push) and nothing downloaded at runtime.
Install
- Copy
stubs/.githooks/pre-push.stubto.githooks/pre-pushand make it executable:chmod +x .githooks/pre-push. - Copy
stubs/.github/workflows/checks.yml.stubto.github/workflows/checks.yml, merging it into an existing workflow if there is one. - Merge these scripts into
composer.json, and adaptcheck:pushto the tools the project uses:
Add"scripts": { "check:push": [ "Composer\\Config::disableProcessTimeout", "npm run build", "@php artisan app:scan-secrets", "@php artisan config:clear --ansi", "pint --test", "@php artisan test" ], "hooks:install": [ "@php -r \"is_dir('.git') && passthru('git config core.hooksPath .githooks');\"" ] }phpstan analyse,npm run lintortsc --noEmitwhen the project has them.app:scan-secretscomes from thesecrets-scannerskill; install it too, or remove that line. - Run
composer hooks:installonce per clone. To make it automatic, add"@hooks:install"to thepost-install-cmdscript, or to the project'ssetupscript. - Copy
stubs/tests/Feature/PrePushChecksTest.php.stubtotests/Feature/PrePushChecksTest.php. It fails if someone deletes the hook, the script or the CI step.
Why each step is there
npm run buildfirst. A TypeScript or import error that only shows in the production build is the most common "passed locally, broke deploy" failure. Building before tests also creates the Vite manifest that feature tests rendering pages need.- Secrets scan before tests, so a leaked key blocks the push even when tests are slow or flaky.
config:clear, so a cached config fromphp artisan config:cachecan't make tests read the wrong environment.pint --test, notpint: checks must never rewrite files mid-push.
Rules
- Hooks live in the repo (
.githooks/, viacore.hooksPath), not in.git/hooks, which isn't versioned or shared. - Don't skip the hook to get a push through. Fix the failing check. CI runs the same command, so skipping it only moves the failure.
- Keep the hook tiny. It calls
composer check:pushand nothing else, so CI, the hook and developers all run the same list. - Pin GitHub Actions to commit SHAs in production repos and let Dependabot update them. A moved tag can run someone else's code with your repo's permissions.
- Set
persist-credentials: falseon checkout unless a later step needs to push.
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.

