install-hooks
Skill12 starsChanged 6 months agoMITView on GitHub
Install or repair hooks that check for secrets on each commit, push, or AI assistant action. Use when the user wants leak prevention, when credential-handling work has no hook protection, or when agent scans duplicate a hook that already exists. Use scan-secrets for a one-off scan or a leak investigation.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- sd0xdev/sd0x-dev-flowtheir own version, first seen Oct 8, 2026
- sd0xdev/sd0x-harnesstheir own version, first seen Oct 6, 2026
- treylom/ThisCodetheir own version, first seen Sep 5, 2026
- rvdbreemen/adr-kittheir own version, first seen Jul 18, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- sd0xdev/sd0x-dev-flow★ 192same name
- sd0xdev/sd0x-harness★ 192same name
- treylom/ThisCode★ 41same name
- rvdbreemen/adr-kit★ 13same 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 repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- check-hmslSkill
- create-honeytokensSkill
- scan-machineSkill
- scan-secretsSkill
- triage-incidentsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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
- Distinctive: line 30
Before an installation, check:
- Distinctive: line 37
Do not repeat a check that already passed in this context.
- Distinctive: line 41
If the CLI is missing or not authenticated, read ggshield-cli-setup.md.
- Distinctive: line 45
Read the relevant section of hook-selection.md when you check, install, or repair protection.
- Distinctive: line 51
Keep existing hook managers and existing secret protection.
- Very specific: line 52
Do not add manual scans next to a hook.
≈ “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
Install secret-scanning hooks
Overview
Hooks do the recurring checks. The agent does not. Never run a scan yourself, and never write a script or other tool to find secrets. Check the existing protection once per context. Reuse protection that works. Offer a missing installation or a repair one time. If the user declines, do not ask again, and do not run scans instead.
When to Use
| Requested protection | Hook | Content that the hook checks |
| Before a commit | pre-commit | Staged changes |
| Before a push | pre-push | Outgoing commits, including intermediate versions |
| During AI assistant actions | AI hook for the named or active assistant | Supported prompt and tool events |
Use the stage, the assistant, and the scope that the user specified. Ask only for a missing choice. For a bare "install hooks" request, ask which hook family the user wants. An explicit installation request authorizes its stated scope. A recommendation request or a scan request does not authorize an installation. A global installation needs explicit authorization.
Onboarding (first use)
Prerequisites
Before an installation, check:
ggshield --version- the
--helpoutput of the relevant command ggshield api-statusfor authentication- the target assistant, when the request names one
Do not repeat a check that already passed in this context.
Setup
If the CLI is missing or not authenticated, read ggshield-cli-setup.md. Otherwise, continue.
Commands
Read the relevant section of hook-selection.md when you check, install, or repair protection. It covers the effective Git hook paths, existing hook managers, and scoped AI hook installation. Do not read it again for a routine operation that it already covered.
After an installation, check the configuration. Do not run a test scan. Do not create a test secret, a test commit, or a test push. Report "configured" and "ran and passed" as two different states. The next authorized operation runs the hook and gives the "ran and passed" result.
Best Practices
- Keep existing hook managers and existing secret protection. A hook that only runs a linter is not secret protection.
- Do not add manual scans next to a hook. Do not bypass a hook failure. Do not report a skipped or failed check as clean. For an explicit scan, use
scan-secretswhen it is available. - When a hook finds a secret, report the secret type and location. Do not show the secret value. Show the organization's remediation message first, when one exists. Determine if the secret was exposed. A blocked commit or push does not prove that the secret never leaked elsewhere. If the secret is only local, remove it, including from unpushed commits. If the secret was exposed, coordinate a rotation. The same hook checks the next authorized retry. If
scan-secretsis installed, it contains detailed remediation guidance.
Troubleshooting
If a hook does not run, check the effective hook paths, the hook manager dispatch, the enabled events, the authentication, and the project trust settings. The hook-selection reference describes each check. An AI scan error can let an unscanned action continue. To uninstall, remove only the ggshield entries, through the hook manager that owns them. Keep the other hooks.
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.

