pre-push-compliance
Skill0 starsChanged 4 months agoMITView on GitHub
Enforce a mandatory pre-push audit checking CI/CD, Actions Workflow, Runtime/Package Manager, and README configurations. This skill ONLY allows Git push execution if all checks PASS. Triggers: "pre-push audit", "verify pre-push compliance", "push to main with audit", "git push with audit".
- Reads credentials
- Commits and pushes
In this repository4 other files it gives its agents.
- governance-encodedSkill
- governanceSkill
- taskmasterSkill
- vuln-scannerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 9 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
When a user requests a git push command (e.g., "push to main", "git push with audit") or when the agent is about to execute a push action, …
- Distinctive: line 25
Verify that no personal names, GitHub handles, or emails are hardcoded in the codebase, issue templates, or markdown files.
- Very specific: line 27
Ensure that template-driven community files are in sync with .env values.
- Distinctive: line 30
Verify that a root README.md file exists.
- Distinctive: line 31
Verify that the root README.md documents:
- Very specific: line 39
CWE-1395 (Supply Chain): All third-party actions (uses:) MUST be pinned to a specific SHA-256 commit hash instead of mutable tags (e.g., …
- Very specific: line 40
CWE-250 (Privilege Misconfiguration): Default permissions for GITHUB_TOKEN must be restricted.
- Very specific: line 42
CWE-798 (Hardcoded Secrets): Verify that secrets (e.g., ${{ secrets.MY_SECRET }}) are not printed or logged in raw shell output commands.
- Very specific: line 45
Duplicate Lockfiles: Check the root and subdirectories to ensure no conflicting lockfiles coexist (e.g.
- Very specific: line 46
Runtime Engines Bounding: Verify that package.json contains a populated and pinned engines block declaring allowed runtimes (Node.js, Bun, …
- Very specific: line 47
Execution Script Match: Ensure scripts in package.json do not run commands for a different package manager than the one specified by the …
- Very specific: line 48
Lockfile Synchronization: Ensure the lockfile is up to date and not older than package.json.
- Distinctive: line 57
Verify that zero High or Critical vulnerabilities exist in the dependency tree.
- Very specific: line 60
Verify that an automated version updater configuration exists: .github/dependabot.yml or renovate.json in the root repository.
- Distinctive: line 61
Verify that the config is active and covers core package manager updates.
- Distinctive: line 70
If any check in Pillars 1–5 fails, the agent MUST NOT execute the git push command.
- Distinctive: line 78
If all checks in Pillars 1–5 pass, the agent is authorized to proceed.
- Distinctive: line 85
If the audit fails, output the report using the following format:
≈ “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 Compliance Gate
Purpose
The pre-push-compliance subskill is a strict gatekeeping utility designed to prevent insecure, undocumented, or broken codebases from being pushed to upstream remote repositories. It operates as a blocking checkpoint: the AI agent is only authorized to execute git push commands once all pre-push audits report a 100% PASS score.
Interception and Execution Protocol
When a user requests a git push command (e.g., "push to main", "git push with audit") or when the agent is about to execute a push action, the agent MUST intercept the workflow and execute the following checks in order:
Step 1: Run the Pre-Push Audit Checks
The agent must check the following five pillars deterministically in the local repository:
PII Compliance & Secrets Gate
- Verify that no personal names, GitHub handles, or emails are hardcoded in the codebase, issue templates, or markdown files.
- The system must dynamically extract maintainer contacts from the
.envconfiguration (keysMAINTAINER_NAMEandMAINTAINER_EMAIL). - Ensure that template-driven community files are in sync with
.envvalues.
Pillar 1: README Structure & Completeness
- Verify that a root
README.mdfile exists. - Verify that the root
README.mddocuments:- Prerequisites (Node.js/Docker versions, etc.).
- Dependency installation commands (e.g.
npm install,pnpm install). - Runtime execution scripts (development, build, and test lifecycle commands).
- Environment variable setup instructions (with references to
.env.example).
Pillar 2: GitHub Actions Workflow Security (CI/CD)
Inspect all workflow configurations in .github/workflows/*.yml (if they exist) for the following issues:
- CWE-1395 (Supply Chain): All third-party actions (
uses:) MUST be pinned to a specific SHA-256 commit hash instead of mutable tags (e.g.,uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1fd717b0instead ofuses: actions/checkout@v4). - CWE-250 (Privilege Misconfiguration): Default permissions for
GITHUB_TOKENmust be restricted. The workflow yaml file must specify an explicitpermissions:block (e.g.,permissions: read-allor minimal scoped read permissions). - CWE-94 (Code Injection): Untrusted variables from events (such as
github.event.issue.titleorgithub.event.pull_request.title) must NOT be evaluated directly inside shell execution scripts. They must instead be passed as environment variables. - CWE-798 (Hardcoded Secrets): Verify that secrets (e.g.,
${{ secrets.MY_SECRET }}) are not printed or logged in raw shell output commands.
Pillar 3: Runtime & Package Manager Consistency
- Duplicate Lockfiles: Check the root and subdirectories to ensure no conflicting lockfiles coexist (e.g. having both
package-lock.jsonandpnpm-lock.yamlin the same directory, which causes deployment non-determinism). - Runtime Engines Bounding: Verify that
package.jsoncontains a populated and pinnedenginesblock declaring allowed runtimes (Node.js, Bun, or Deno versions). - Execution Script Match: Ensure scripts in
package.jsondo not run commands for a different package manager than the one specified by the lockfile (e.g., callingnpm runin scripts when apnpm-lock.yamllockfile exists). - Lockfile Synchronization: Ensure the lockfile is up to date and not older than
package.json.
Pillar 4: Dependency Vulnerability Audit
- Identify the active lockfile (
package-lock.json,pnpm-lock.yaml,yarn.lock, orbun.lockb). - Propose and run the corresponding package manager audit command:
- npm:
npm audit --audit-level=high - pnpm:
pnpm audit --audit-level=high - yarn:
yarn audit --level high - bun:
bun audit
- npm:
- Verify that zero High or Critical vulnerabilities exist in the dependency tree.
Pillar 5: Automated Dependency Updates
- Verify that an automated version updater configuration exists:
.github/dependabot.ymlorrenovate.jsonin the root repository. - Verify that the config is active and covers core package manager updates.
Step 2: The Gateway Verdict
Based on the audit findings, the agent must enforce the following blocking rules:
- ❌ AUDIT FAIL (Score < 100%):
If any check in Pillars 1–5 fails, the agent MUST NOT execute the
git pushcommand. The agent must output a detailed compliance failure report outlining:- The exact gate/pillar that failed.
- The specific file and code line causing the failure.
- Actionable remediation requirements to resolve the audit gap. The push command is ABORTED.
- ✅ AUDIT PASS (Score = 100%):
If all checks in Pillars 1–5 pass, the agent is authorized to proceed.
The agent must output a compliance clearance report and then execute the requested
git pushcommand.
Output Template for Pre-Push Failures
If the audit fails, output the report using the following format:
# ❌ Pre-Push Compliance Gate Blocked
**Date:** [timestamp] **Operator:** [AI Agent Name]
**Git Target:** [branch/remote]
The repository has failed the pre-push compliance checks. To prevent deployment degradation, the push command has been blocked. Please resolve the following findings:
## ❌ Pillar 2: GitHub Actions Workflow Security (CWE-1395)
- **File:** .github/workflows/deploy.yml#L12
- **Finding:** Action `actions/checkout@v4` is not pinned to a SHA-256 commit hash.
- **Remediation:** Replace `@v4` with `@8ade135a41bc03ea155e62e844d188df1fd717b0` (or appropriate hash).
## ❌ Pillar 3: Runtime & Package Manager Consistency
- **File:** / (Root directory)
- **Finding:** Found conflicting lockfiles: package-lock.json and pnpm-lock.yaml coexist.
- **Remediation:** Remove the unused lockfile to ensure deployment determinism.
## ❌ Pillar 4: Dependency Vulnerability Audit (CWE-1395 / OWASP A03)
- **Audit Tool:** `npm audit`
- **Finding:** Found 2 High vulnerability advisories (e.g. prototype pollution in lodash).
- **Remediation:** Run `npm audit fix` or upgrade the vulnerable packages.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.

