agentleFS
GitGuardianGitGuardian/agent-skills/skills/install-hooks/SKILL.md

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

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. sd0xdev/sd0x-dev-flow★ 192same name
    2. sd0xdev/sd0x-harness★ 192same name
    3. treylom/ThisCode★ 41same name
    4. 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.

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
  1. Distinctive:

    Before an installation, check:

    line 30
  2. Distinctive:

    Do not repeat a check that already passed in this context.

    line 37
  3. Distinctive:

    If the CLI is missing or not authenticated, read ggshield-cli-setup.md.

    line 41
  4. Distinctive:

    Read the relevant section of hook-selection.md when you check, install, or repair protection.

    line 45
  5. Distinctive:

    Keep existing hook managers and existing secret protection.

    line 51
  6. Very specific:

    Do not add manual scans next to a hook.

    line 52

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 protectionHookContent that the hook checks
Before a commitpre-commitStaged changes
Before a pushpre-pushOutgoing commits, including intermediate versions
During AI assistant actionsAI hook for the named or active assistantSupported 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 --help output of the relevant command
  • ggshield api-status for 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-secrets when 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-secrets is 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.