Public Repo Safety Check
Identify and purge leaked secrets, private data, and repository noise before making code public.
Free
Public Repo Safety Check
Example session with this skill installed
I just realized I pushed my .env file and a credentials.json to my public repo two commits ago. What do I do?
- Read your context and instructions
- Compiled the public repo safety
I have analyzed the situation. Since these files were committed to a public repository, the secrets are compromised and must be treated as stolen.
Repo safety check: [Current Project]
Verdict
Act now (secret exposed)
Must fix (safety)
- Revoke Keys Now — The
.envandcredentials.jsonlikely contain live keys. Revoke them at the provider (e.g., Google Cloud, OpenAI) immediately. .env— Contains environment variables — Remove from tracking and Git history.credentials.json— OAuth/Service Account credentials — Remove from tracking and Git history.
Commands to run
First, ensure you have a backup:
git clone --mirror [REPO_URL] backup_repo.git
To remove the files from all history and stop tracking them:
# Install filter-repo if not present
pipx install git-filter-repo
# Remove specific sensitive files from all commits
git filter-repo --path .env --path credentials.json --invert-paths
# Re-add your remote and force push (caution: this overwrites history)
git remote add origin [REPO_URL]
git push --force --all
git push --force --tags
Update your .gitignore to prevent this from happening again:
.env
credentials.json
Should fix (presentation)
- README — Add a
.env.examplefile so users know which keys are required without seeing your real values. - License — No license detected. Add an MIT license if this is for a portfolio.
Already good
- No large database dumps (
.sql,.db) detected in the current file list.
Next steps
- Check your billing/usage console for the revoked keys to ensure no unauthorized activity occurred.
- Create a
.env.examplefile containing only the keys (no values). - Enable GitHub Secret Scanning in Settings > Code security.
Connects securely to your tools. The creator never sees your data.
About this skill
Sharing a repository publicly or adding it to a portfolio often leads to accidental exposure of API keys, environment variables, and sensitive user data. This skill identifies leaked secrets and private files within your repository history and provides the exact remediation steps to secure your code before it reaches recruiters or the public.
What it does
- Secret detection identifies API keys, OAuth tokens, and cloud credentials using
gitleaksand targetedgreppatterns. - Exposure analysis flags tracked
.envfiles, database dumps, private keys, and personal media that should not be public. - History scrubbing provides precise commands to rewrite Git history or recreate a clean repository using
git-filter-repo. - Credential rotation guides the immediate revocation of compromised keys before attempting history cleanup.
- Presentation auditing reviews README quality, license presence, and setup instructions to ensure the project is recruiter-ready.
How it works
- Initial Scan uses
git ls-filesand content search to flag current and historical leaks. - Remediation Plan generates a prioritized list of fixes, starting with high-risk secret exposures.
- History Cleanup provides the sequence for mirror cloning, path inverting, and force-pushing to purge data from history.
- Final Polish checks the README for broken links, hardcoded local paths, and missing license files.
Frameworks & tools
This skill utilizes standard Git CLI, gitleaks for deep history scanning, and git-filter-repo for permanent data removal. It is compatible with GitHub, GitLab, and Bitbucket.
Why this beats prompting it yourself
Generic prompts often overlook that deleting a file in a new commit does not remove it from Git history. This skill enforces the "Rotate first, clean second" rule and provides specific regex patterns to find secrets that standard LLMs frequently miss.
Use cases
- Auditing a portfolio project before sharing the link on LinkedIn.
- Recovering from an accidental push of a
.envfile to a public repository. - Preparing a repository for a technical interview or code review.
- Cleaning up internal development noise like
node_modulesor.DS_Storebefore release.
Known limitations
This skill focuses on repository hygiene and secret leakage. It does not perform deep application security audits for vulnerabilities like SQL injection or broken authentication.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 8 days ago
- Free with an Agensi account
- Software
Git
Permissions
What's inside
Frequently Asked Questions
New in Security
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.