repo-cleanup — Claude Code skill: safely remove dead code and artifacts
repo-cleanup — a skill for structured repository cleanup: removes dead code, unused dependencies, outdated docs, and flaky tests with usage checks, archiving, and validation steps built in.
MIT 183 installs ★ 71 updated 2026-06-29
npx skills add NickCrew/Claude-Cortex --skill repo-cleanup -a claude-codeWhat repo-cleanup does
repo-cleanup guides you through five cleanup categories: code, dependencies, documentation, tests, and sprint archives. For each task, it provides a reference file with validation checkpoints—before any deletion, the skill checks usage, captures baseline state, and runs tests afterward. Workflows follow a consistent pattern: define scope and safety mode, capture current state, load the relevant reference, execute with usage checks, validate changes, and report outcomes.
The skill produces a summary of actions taken, validation results, remaining risks, and recommendations for follow-up or rollback. Common traps it helps you avoid: deleting without confirming regenerability, skipping baseline tests, removing dependencies without updating build scripts, or collapsing docs without preserving entry points.
What it helps with
- remove unused code without breaking the build
- identify and delete unused dependencies safely
- update documentation to match the current codebase
- find and remove brittle or duplicate tests
- archive a completed sprint with full traceability
Example prompts for the agent
- Help me clean up dead code in
src/legacy/and check what imports it - Generate a report of unused dependencies and show where to remove them
- Update docs in
docs/for v2.0 and flag outdated examples
How to install repo-cleanup
1Skills CLI (Vercel)
npx skills add NickCrew/Claude-Cortex --skill repo-cleanup -a claude-code2Manually: put the files in place
~/.claude/skills/repo-cleanup/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/repo-cleanup/
1Skills CLI (Vercel)
npx skills add NickCrew/Claude-Cortex --skill repo-cleanup -a codex2Manually: put the files in place
.agents/skills/repo-cleanup/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add NickCrew/Claude-Cortex --skill repo-cleanup -a cursor2Manually: put the files in place
.cursor/skills/repo-cleanup/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install NickCrew/Claude-Cortex skills/repo-cleanup2Manually: put the files in place
.github/skills/repo-cleanup/SKILL.md1Skills CLI (Vercel)
npx skills add NickCrew/Claude-Cortex --skill repo-cleanup -a gemini-cli2Platform CLI
gemini skills install https://github.com/NickCrew/Claude-Cortex --path skills/repo-cleanupManually: put the files in place
.devin/skills/repo-cleanup/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add NickCrew/Claude-Cortex --skill repo-cleanup -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about repo-cleanup
How do I install repo-cleanup in Claude Code?
Run npx skills add NickCrew/Claude-Cortex --skill repo-cleanup -a claude-code, then open ~/.claude/skills/repo-cleanup/SKILL.md in Claude Code.
What does repo-cleanup do?
It provides a safe, repeatable workflow for cleaning repositories: removes dead code, unused dependencies, outdated docs, flaky tests, and archives sprints with built-in usage checks, baseline capture, test validation, and reporting.
When should I avoid using repo-cleanup?
Don't use it during active incident response or when the target code area lacks clear ownership and backup coverage.
Source text
SKILL.md · MIT
--- name: repo-cleanup description: Use when a repository needs cleanup of dead code, build artifacts, unused dependencies, outdated docs, or stale tests - provides safe cleanup workflows, validation steps, and reporting templates for code, deps, docs, tests, and sprint archives. keywords: - archive sprint - cleanup repo - dead code - docs cleanup - remove artifacts - repo cleanup - test cleanup - unused dependencies file_patterns: - '**/archive/**' - '**/cleanup/**' - '**/deprecated/**' - '**/legacy/**' confidence: 0.82 --- # Repo Cleanup ## Overview Establish a safe, repeatable cleanup workflow for code, dependencies, docs, tests, and sprint artifacts. Minimize risk by validating usage, archiving before deletion, and verifying with tests. ## When to Use - Repository bloat (generated artifacts, caches, unused files) - Dead code or unused dependencies suspected - Docs drifted from actual behavior - Tests are brittle, redundant, or mislocated - Sprint closure needs structured archiving Avoid when: - Active incident response is ongoing - The target area lacks owners or rollback coverage ## Quick Reference | Task | Load reference | | --- | --- | | Code cleanup | `skills/repo-cleanup/references/code-cleanup.md` | | Dependency cleanup | `skills/repo-cleanup/references/deps-cleanup.md` | | Docs cleanup | `skills/repo-cleanup/references/docs-cleanup.md` | | Test cleanup | `skills/repo-cleanup/references/test-cleanup.md` | | Sprint archive | `skills/repo-cleanup/references/archive-sprint.md` | ## Workflow 1. Define scope and safety mode (safe vs aggressive). 2. Capture baseline state (git status, key tests, backups). 3. Load the relevant reference file(s) for the target area. 4. Execute cleanup steps with usage checks before removal. 5. Validate changes (tests, build, lint, or doc checks). 6. Report outcomes (actions taken, risks, follow-ups). ## Output - Summary of actions and files touched - Validation results and remaining risks - Follow-up recommendations or backlog items ## Common Mistakes - Deleting without confirming usage or regenerability - Skipping baseline tests and rollback checkpoints - Removing dependencies without updating build/test scripts - Collapsing docs without preserving entry points
© NickCrew · MIT · NickCrew/Claude-Cortex