# Repotidy: A clean repo before you publish or hand over

> Audits dead code, assets, dependencies, secrets and personal data, verifies every removal, purges leaked files from history only after your approval, proves behaviour unchanged, and ends with a dated rotate list.

Repotidy: A clean repo before you publish or hand over is a paid AI agent skill on Agensi by MAJI, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $12 (one-time purchase)
- Creator: [MAJI](https://www.agensi.io/creators/maji)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.0
- Last updated: 2026-10-18
- Security: scan passed (2026-10-18); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/repotidy-a-clean-repo-before-you-publish-or-hand-over
- Tags: code-review, security

## About this skill

Before a repo goes public or to a new maintainer, the risks are easy to miss: an old key still in history, a backup file holding a database password, dead code nobody dares remove. Delete the wrong file, such as a lockfile CI installs from, and the build breaks. Repotidy cleans a repository in a fixed order: audit, verify, clean, purge, prove, publish, rotate.

### What it does
- **Parallel audit** of structure, dead code, assets, dependencies, secrets, personal data and history, with evidence per item.
- **Repo health pass** finds churn hotspots crossed with complexity, rework and bus factor, at file level, never per person.
- **Deep verification** of every removal candidate against config, registration files, CI, routes and runtime URL loads.
- **History purge** with git filter-repo or a squash import, only after your explicit approval and a backup bundle.
- **Proof** that behaviour did not change: full suite green and identical output for moved functions.
- **Privacy test** scans the tree and every outward text (commit messages, README, release notes) against your private-terms list.
- **Dated rotate list** for every key that ever reached history.

### How it works
1. **Check the ground**: `.git` present, clean tree, latest main.
2. **Audit and deep-verify**, then you answer remove, keep or move by number.
3. **Restructure in small `git mv` batches**, a commit per module.
4. **Purge and force-push** only with approval; stale clones and hashes are noted.
5. **Publish or back up**, then rotate keys and add a pre-commit guard.

### Frameworks & tools
`git`, `git filter-repo`, `gh`, a secret scanner such as gitleaks, `ruff`, radon or the ESLint complexity rule, and your existing test runners.

### Why this beats prompting it yourself
Agents often flag used dependencies as unused. This skill deep-verifies first, takes no destructive step without your numbered answer, and treats a deleted secret as not yet safe: only rotation ends the leak.

### Use cases
- **Open-sourcing** or turning a repo into a template.
- **Handover** to a new maintainer.
- **Leak response** after a secret or customer CSV was committed.
- **Legacy trim** of dead assets and code.

### Known limitations
Not for mid-feature work or design refactors. A history rewrite kills old clones. A leak only in the last unpushed commit just needs an amend and a key rotation.

## Requires

- Git
- git filter-repo
- GitHub CLI
- gitleaks
- ruff
- radon
- Python

## 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 Repotidy: A clean repo before you publish or hand over skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What does it need?

A local clone with git access and your test suite. For a purge it uses git filter-repo, installed in a venv or with pipx; the privacy test reads a private-terms list you keep outside the repo.

### Will it delete files or rewrite history on its own?

No. You approve removals by number, and the history purge and force-push happen only after explicit approval and a backup bundle.

### How is this different from asking an agent to clean up a repo?

Every removal candidate is deep-verified before deletion, the full suite proves nothing changed, and the job ends with a dated list of keys to rotate, because a purge does not un-leak a secret.

### What is in the zip?

SKILL.md, the instructions your agent follows, and LICENSE.md.

---

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.
