Public Repo Safety Check

    by Bhavana Krishnan

    1

    Identify and purge leaked secrets, private data, and repository noise before making code public.

    Free

    Security scanned

    Works with the AI Agents you already use

    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)

    1. Revoke Keys Now — The .env and credentials.json likely contain live keys. Revoke them at the provider (e.g., Google Cloud, OpenAI) immediately.
    2. .env — Contains environment variables — Remove from tracking and Git history.
    3. 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.example file 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

    1. Check your billing/usage console for the revoked keys to ensure no unauthorized activity occurred.
    2. Create a .env.example file containing only the keys (no values).
    3. 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 gitleaks and targeted grep patterns.
    • Exposure analysis flags tracked .env files, 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

    1. Initial Scan uses git ls-files and content search to flag current and historical leaks.
    2. Remediation Plan generates a prioritized list of fixes, starting with high-risk secret exposures.
    3. History Cleanup provides the sequence for mirror cloning, path inverting, and force-pushing to purge data from history.
    4. 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 .env file to a public repository.
    • Preparing a repository for a technical interview or code review.
    • Cleaning up internal development noise like node_modules or .DS_Store before 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Terminal / Shell
    Read Files
    Write Files
    Listed8 days ago

    What's inside

    Frequently Asked Questions

    No, deleting a file in a new commit leaves the data in your Git history. This skill provides the specific commands to use tools like git-filter-repo to permanently purge sensitive data from every previous commit.

    This skill prioritizes the 'Rotate First' rule, providing immediate guidance on revoking compromised API keys before you even touch the code. This ensures that even if a crawler found your secret, the key is already invalidated.

    While it focuses on security, the skill also performs a 'Presentation Audit' to check for broken links, hardcoded local file paths, and missing licenses to ensure your project looks professional to recruiters.

    You receive the full logic for secret detection patterns, the remediation workflow for history scrubbing, and the auditing checklist for repository polish. It includes step-by-step instructions for integrating gitleaks and git-filter-repo into your workflow.

    The skill focuses on repository hygiene and secret leakage (API keys, PII, and credentials). It is not designed to find application-level code vulnerabilities like SQL injection or Cross-Site Scripting (XSS).

    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.

    Free