agentleFS
divik-09divik-09/claude-skills-collection/skills/pre-push-secret-scan/SKILL.md

pre-push-secret-scan

Skill1 starsChanged 10 days agoMITView on GitHub

Scan a project folder for accidentally committed secrets (API keys, tokens, private keys, passwords) before pushing to GitHub or sharing code. Use whenever the user is about to publish a repo, push or zip code, asks 'is it safe to share this', or mentions leaked keys, .env files, or credentials in code.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    Run the scanner on the project root:

    line 12
  2. Distinctive:

    Remove it from code; load from environment variables or a secret manager.

    line 25
  3. Distinctive:

    If it was ever committed, deleting the file is not enough.

    line 26
  4. Very specific:

    Add prevention: .gitignore for .env*, a committed .env.example with fake values, and a pre-commit hook or CI secret scanner (gitleaks, …

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Pre-push Secret Scan

A defensive check to catch credentials before they become public. Public leaks are scraped by bots within minutes.

Workflow

  1. Run the scanner on the project root:
python scripts/scan_secrets.py path/to/project
python scripts/scan_secrets.py . --json            # machine-readable
python scripts/scan_secrets.py . --no-entropy      # fewer false positives

Exit code is 1 if findings exist, 0 if clean, so it works in CI or a git pre-push hook.

  1. Review each finding. Values are always masked in output. Classify as real secret, test fixture, or false positive.
  2. For every real secret:
    • Revoke or rotate it first. Assume it is compromised the moment it was written to a file that may be shared.
    • Remove it from code; load from environment variables or a secret manager.
    • If it was ever committed, deleting the file is not enough. History must be rewritten (git filter-repo) or the repo recreated, and rotation remains mandatory.
  3. Add prevention: .gitignore for .env*, a committed .env.example with fake values, and a pre-commit hook or CI secret scanner (gitleaks, trufflehog).

What it checks

Cloud and platform keys (AWS, GitHub, Slack, Stripe, Google, Anthropic/OpenAI-style), private key blocks, JWTs, credentials embedded in URLs, hardcoded password=/secret=/token= assignments, and optionally high-entropy strings. It skips .git, node_modules, virtualenvs, build output, and binary files.

Limits

Pattern matching cannot find every secret and will flag some harmless strings. A clean result is not a guarantee. Say so when reporting.

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.