From keygate
Scan staged Git changes for leaked secrets (API keys, tokens, passwords) before commit. Use when the user is about to commit code, after staging changes, when files contain values that look like credentials, or when the user explicitly asks to check for secrets.
How this skill is triggered — by the user, by Claude, or both
Slash command
/keygate:keygate-secret-scanThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Detects accidental secret leaks in staged Git changes (`git diff --cached`) before they enter the repository history. Wraps the `keygate` CLI.
Detects accidental secret leaks in staged Git changes (git diff --cached) before they enter the repository history. Wraps the keygate CLI.
Trigger this skill in any of these situations:
git commit or has indicated commit intent.git add) that may contain secrets.sk_live_..., AKIA..., long base64-like values assigned to api_key / password / secret / token).Do NOT trigger for:
Run:
keygate --version
If it succeeds, proceed to Step 2.
If keygate is not found, present these installation options to the user and STOP. Do not attempt to install automatically; let the user choose.
keygate is not installed. Install it with one of:
pipx install keygate # recommended for pipx users
uv tool install keygate # recommended for uv users
pip install --user keygate # fallback
Then re-run the scan.
Always request JSON output via the agent profile:
keygate scan --profile agent
Output is a fixed-schema JSON document (schema_version: "1").
Exit codes:
0 — status: "pass" or status: "warn" (commit not blocked).1 — status: "block" (commit must be stopped).2 — usage error. Do not retry without fixing arguments.For each entry in findings[], the relevant fields are:
rule_id — which detection rule fired (e.g., aws-access-key).policy — must_block, should_block, etc.score — numeric severity.verdict — block or warn.file, line — location.message — human-readable reason.recommended_action — e.g., move_to_secret_manager.snippet — pre-masked excerpt (already redacted as XXXX***YY, safe to display verbatim).Format depends on status:
pass — One line: "No secrets detected in staged changes."warn — List each warning as rule_id at file:line — message. Suggest the user review.block — Strongly warn:
rule_id, file:line, message, and the masked snippet.Never display unmasked secret values. The snippet field is already masked by keygate; do not attempt to reconstruct the original.
Recommend in this order:
# keygate: ignore reason="..." on that line.keygate.toml:
[allowlist]
paths = ["vendor/*"]
patterns = ["dummy", "example"]
/keygate:baseline-create. To extend an existing baseline with newly-detected entries, run /keygate:baseline-update.Never recommend git commit --no-verify as a workaround — it defeats the safety net and bypasses every other pre-commit check too.
npx claudepluginhub kanekoyuichi/keygate --plugin keygateProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.