agentleFS
ummshunummshun/claude-code-skills/skills/git-prepush-secret-remote-check/SKILL.md

git-prepush-secret-remote-check

Skill0 starsChanged 46 days agoMITView on GitHub

Use immediately before a git push or public release to confirm that the remote points to the intended repository and to scan staged changes for API keys, tokens, credentials, and personally identifiable information.

  • Reads credentials
  • Commits and pushes

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. bokuwalily/claude-code-skills★ 037% same

    Wrote their own version · 0

    None found.

    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 repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    No output is the expected result.

    line 38
  2. Very specific:

    If a private environment file appears, remove it from the index and add the appropriate pattern to .gitignore.

    line 53

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

Procedure

1. Verify the remote URL

git remote -v

Expected shape:

origin  git@github.com:YOUR_USERNAME/YOUR_REPO.git (fetch)
origin  git@github.com:YOUR_USERNAME/YOUR_REPO.git (push)

Confirm that the account and repository are yours. If origin still points to an upstream or third-party fork, correct it before continuing:

git remote set-url origin git@github.com:YOUR_USERNAME/YOUR_REPO.git

2. Scan staged changes for secrets

git diff --cached | grep -iE \
  "(api_?key|secret|token|password|passwd|auth|credential|access_?key|private_?key)\s*[=:]\s*\S+"

No output is the expected result. If a value is found, unstage the file, move the value to an ignored environment file, and stage only the sanitized changes.

3. Check recent committed content

git log --oneline -10
git show HEAD | grep -iE "(api_?key|secret|token|password)\s*[=:]\s*\S+"

4. Confirm environment files are not tracked

git ls-files | grep -E "^\.env"

If a private environment file appears, remove it from the index and add the appropriate pattern to .gitignore.

5. Run a basic PII scan

git diff --cached | grep -iE \
  "(\b[0-9]{3}-[0-9]{4}-[0-9]{4}\b|@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})"

Review every phone-number or email-like match for hardcoded personal data.

Pitfalls

  • A fork can retain its upstream remote, making an otherwise normal push target the wrong repository.
  • Framework-generated .gitignore files do not cover every custom environment-file name.
  • Regular expressions do not detect every encoded or obfuscated secret. Prefer a dedicated scanner such as gitleaks or TruffleHog when available.
  • Rewriting Git history does not invalidate a secret that has already been published. Rotate exposed credentials immediately.

Verification

git remote -v | grep "YOUR_USERNAME"
git diff --cached | grep -iE "(api_?key|secret|token|password)\s*[=:]\s*\S+" | wc -l
git ls-files | grep -E "^\.env" | wc -l

Both counts should be zero, and the remote must point to the intended account and repository.

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.