Skip to content
Skills Library
Security · Building & coding

install-hooks

/install-hooks

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.

Licence
MIT
Last repository change
06.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
12
Scripts
5
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 06.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 5 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: evals/files/already-has-hook/setup.sh, evals/files/ambiguous-asks-family/setup.sh, evals/files/global-needs-consent/setup.sh, evals/files/install-claude-code/setup.sh, evals/files/install-precommit-local/setup.sh

What it does and when to use it

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.

Original author description

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.

How it works

  1. Overview
  2. When to Use
  3. Onboarding (first use)
  4. Commands
  5. Best Practices
  6. Troubleshooting
Original SKILL.md headings · 50 lines, 540 words
SKILL.md preview
---
name: install-hooks
description: 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.
license: MIT
compatibility: Requires the ggshield CLI installed and authenticated, version 1.49.0 or later for AI-assistant hooks and 1.51.0 or later for codex. Git hooks need git; AI-assistant hooks need the target tool installed.
metadata:
  version: "0.8.0" # x-release-please-version
---

# 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 `--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](references/ggshield-cli-setup.md). Otherwise, continue.

## Commands

Read the relevant section of [hook-selection.md](references/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.
Files in this package (12)
  • SKILL.md 4 KB
  • evals/evals.json 10 KB
  • evals/targets.json 1 KB
  • evals/files/README.md 4 KB
  • evals/files/already-has-hook/setup.sh 2 KB
  • evals/files/ambiguous-asks-family/setup.sh 1 KB
  • evals/files/global-needs-consent/setup.sh 1 KB
  • evals/files/install-claude-code/setup.sh 1 KB
  • evals/files/install-precommit-local/setup.sh 1 KB
  • references/ggshield-cli-setup.md 14 KB
  • references/gitguardian-platform.md 6 KB
  • references/hook-selection.md 6 KB

Versions

RepositoryScoreLicence
This page · gitguardian/agent-skills90MIT
rvdbreemen/adr-kit100MIT
gitguardian/agent-skills100MIT

Database snapshot: 13.11.2026 · package version 7c78a011c274 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90security-secrets-scan
    Scans repo and build artifacts for leaked secrets (keys, tokens, certs) and proposes a prevention policy — pre-commit hooks, CI check, rotation plan. Output: findings report, remediation steps (rotate / revoke / invalidate), and hook/CI proposals. Pulled by the `security`…
  • 100scan-secrets
    Scan files, staged changes, commits, history, Docker images, or packages for hardcoded secrets. Use when the user asks for a scan, during an audit, or when the user asks you to investigate a suspected leak or a finding. Use install-hooks for recurring checks on edits, commits,…
  • 100specstory-guard
    Install a pre-commit hook that scans .specstory/history for secrets before commits. Run when user says "set up secret scanning", "install specstory guard", "protect my history", or "check for secrets".
  • 100secrets-management
    Find hardcoded secrets in code, config and git history (gitleaks, trufflehog, detect-secrets), plan and run credential rotation after a leak, and move secrets into Vault, AWS Secrets Manager, GCP Secret Manager, Azure Key Vault or KMS-encrypted files (SOPS, Sealed Secrets,…
  • 100secrets-scan
    Detect hardcoded credentials, API keys, tokens, and secrets in source code and configuration files. Use when reviewing code for leaked secrets before commit/merge, auditing a repository for credential exposure, or setting up secret detection.
  • 100synthesis-git-hooks
    Commit-time protection: blocks credentials, private keys and credential files in every repo, and unapproved disclosures where outsiders read it (class read from push remotes, with a disclosure ledger). Use to install, configure or debug the commit check, or when a commit is refused.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.