commit-gate
Skill0 starsChanged 45 days agoMITView on GitHub
Blocks commits that stage a secret: a git pre-commit hook plus a PreToolUse hook for model commits; also splits big changes into atomic commits. Use when: "guard my commits", "block secret commits", "set up the pre-commit hook".
1 other project uses a version of this.
Adopted by
Most recently taken up by
- maridlabsai/jinitheir own version, first seen Jun 12, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- maridlabsai/jini★ 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 repository34 other files it gives its agents.
- audit-codeSkill
- audit-docsSkill
- auditSkill
- bisect-driverSkill
- coding-conventionsSkill
- compact-ioSkill
- cron-task-manageSkill
- cve-auditSkill
- data-integrity-auditSkill
- decision-logSkill
- deck-builderSkill
- determinism-guardSkill
- etl-validateSkill
- experiment-logSkill
- fetch-firstSkill
- flaky-test-detectorSkill
- github-repo-polishSkill
- golden-lockSkill
- history-leak-scanSkill
- landing-checkSkill
- llm-eval-harnessSkill
- local-secrets-manageSkill
- long-taskSkill
- milestone-trackSkill
- opus-workersSkill
- path-quirk-auditSkill
- reorg-proposalSkill
- research-briefSkill
- seed-controlSkill
- shell-portabilitySkill
- skill-vetSkill
- small-taskSkill
- token-squeezeSkill
- venue-fitSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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 26
PreToolUse: add to ~/.claude/settings.json hooks.PreToolUse (append, don't overwrite) an entry with "matcher": "Bash" running node …
- Distinctive: line 45
When asked to commit a large change: propose a split into atomic commits (one logical change each), and write outcome-first messages …
≈ “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
commit-gate — the secret never reaches a commit
Two hooks, one scanner (../history-leak-scan/pm-secretscan.js --staged):
| Hook | File | Fires when | Effect |
git pre-commit | hooks/pre-commit | you commit from the shell | exit 1 → git aborts the commit |
PreToolUse (matcher Bash|PowerShell) | hooks/pretooluse-commit-gate.js | the model runs git commit via Bash | permissionDecision:"deny" → the tool call is blocked |
Both fail OPEN on scanner error (never wedge commits) — but NOISILY: each prints/surfaces a "gate SKIPPED (fail-open), commit is UNSCANNED" warning, because a gate that skips silently is a dead gate. Both point a real hit at secret-rotation + the secrets-inventory.
Install
- PreToolUse: add to
~/.claude/settings.jsonhooks.PreToolUse(append, don't overwrite) an entry with"matcher": "Bash"runningnode "<abs>/skills/commit-gate/hooks/pretooluse-commit-gate.js". - git pre-commit, per repo:
cp hooks/pre-commit <repo>/.git/hooks/pre-commit(already executable via sh). Or setgit config core.hooksPathglobally to a dir holding it. Install into every repo that can hold a live credential first. - The pre-commit script references the scanner by an absolute path — set the
SCANNERvariable at the top ofhooks/pre-committo wherever you cloned this suite. The PreToolUse hook resolves the scanner relative to itself.
Verify before trusting (definition of done)
node ../history-leak-scan/pm-secretscan.js --canaryprints PASS.- In a scratch repo with the pre-commit hook installed: staging a real-format secret and committing is BLOCKED; committing a placeholder-only change PASSES.
- Feed the PreToolUse hook a
git commitstdin payload whose cwd has a staged secret → it returnspermissionDecision:"deny"; a clean cwd → allow.
Atomic-commit / message layer (the judgment part)
When asked to commit a large change: propose a split into atomic commits (one logical change each), and write outcome-first messages (imperative subject, body explaining WHY). This half is model judgment; the gate above is the deterministic guarantee.
node hooks/pretooluse-commit-gate.js --canary — MUST print CANARY PASS 51/51 before you trust a result.
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.

