Skip to content
Back to skills

Repository Cleanup

ASecurity

Plan and perform a behavior-preserving repository cleanup, refactor, or disk-hygiene pass. Use when asked to remove clutter, simplify code, or clean generated files. Requires the target repository's instructions and verification commands.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 7, 2026
ai-agentsrefactoringgit

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 7, 2026

npx -y skills add mgerdov-igt/ai-cookbook --skill repository-cleanup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Repository Cleanup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Repository Cleanup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mgerdov-igt-repository-cleanup/badge)](https://www.skillsdirectory.com/skills/mgerdov-igt-repository-cleanup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: repository-cleanup
description: Plan and perform a behavior-preserving repository cleanup, refactor, or disk-hygiene pass. Use when asked to remove clutter, simplify code, or clean generated files. Requires the target repository's instructions and verification commands.
---

# Repository Cleanup

Use this skill for scoped code cleanup, refactoring, Git hygiene, or removal of generated artifacts. It is project-neutral: discover the target repo's contracts, instructions, and commands instead of assuming a framework or directory layout.

## First Pass

Read the repository's agent instructions, cleanup/refactor guidance, contribution rules, and relevant CI or test configuration. Check the working-tree state without changing it. Then read [the cleanup workflow](references/CLEANUP-WORKFLOW.md).

On the first cleanup pass in a repository, make no edits or deletions. Propose the exact scope, candidates, risk tier, nearby contracts or invariants, and verification steps. Wait for the user's confirmation. Later work is authorized only within the confirmed scope; stop and ask before expanding it.

## Safety Rules

- Preserve observable behavior unless the user explicitly requests a behavior change. Report bugs found during cleanup separately instead of hiding them inside a refactor.
- Treat public interfaces, persisted formats, protocols, configuration, generated files, and architectural boundaries as protected until repository guidance says otherwise.
- Do not infer that code is dead or a file disposable from its name, age, lack of imports, or Git ignore status. Search static and dynamic references and inspect ownership first.
- Never discard user changes. Do not reset, stash, force-update, or run broad cleanup commands to make the tree look clean.
- Treat ignored files as potentially valuable local data. Preview exact targets and preserve evidence, settings, and user-created files.
- Use the target repo's own platform, working-directory, formatting, analysis, test, and CI conventions. Do not copy commands from another project blindly.

## Finish

Run the agreed checks, inspect the final diff and Git status, and report what changed, what was verified, and any blocked checks or remaining risks. Do not commit or push unless asked.

Files in this skill

  • SKILL.md2.2 KB
  • references/CLEANUP-WORKFLOW.md5.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.