# Public Repo Safety Check

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

Public Repo Safety Check is a free AI agent skill on Agensi by Bhavana Krishnan, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Bhavana Krishnan](https://www.agensi.io/creators/bhavana-krishnan)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/public-repo-safety-check
- Tags: security, git, github

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

## Requires

- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Public Repo Safety Check skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### If I already deleted my .env file and pushed a new commit, why do I still need this skill?

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.

### How does the skill handle secrets that have already been pushed to a public server?

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.

### Does this skill help with repository presentation, or is it strictly for security?

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.

### What is included in the purchase of this skill?

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.

### Can this skill identify logic flaws or security vulnerabilities in my actual code?

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

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
