Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add NickCrew/Claude-Cortex --skill repo-cleanup -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/repo-cleanup/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/repo-cleanup/

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

Similar skills

All skills for Code review and refactoring →

From the same set21

The whole set →
owasp-top-10 Security audit guide based on OWASP Top 10 2021. Helps agents spot injection flaws, broken access controls, and authentication issues during code reviews. CX Codex +1 760installs ui-design-aesthetics The ui-design-aesthetics skill feeds the agent rules for typography, color and motion so generated interfaces stop looking like default AI output. Useful when starting a feature or reworking an existing screen. CX Codex +1 362installs threat-modeling-techniques threat-modeling-techniques — a skill for threat modeling: walks the system through STRIDE, builds attack trees and scores risk with DREAD. Best used before the code exists. CX Codex +1 357installs token-efficiency token-efficiency — a Claude Code skill that switches the agent to compact notation — symbols and abbreviations instead of full sentences. Kicks in when the context window is nearly full or a short status line is enough. CX Codex +1 245installs helm-chart-patterns helm-chart-patterns is a Claude Code skill for developing Kubernetes Helm charts, covering template structure, values.schema.json validation, lifecycle hooks, and multi-environment setups. CX Codex +1 179installs typescript-advanced-patterns The typescript-advanced-patterns skill helps apply advanced TypeScript types to APIs and domain models. Use it when compile-time rules need to express states, constraints, or distinct identifiers. CX Codex +1 174installs code-explanation The code-explanation skill explains code, architecture, and system behavior at a depth that matches the reader. Use it for walkthroughs, teaching, and knowledge transfer. CX Codex +1 173installs security-testing-patterns security-testing-patterns guides security testing workflows across SAST, SCA, DAST, and OWASP API audits. Use it to build CI/CD scanning pipelines and triage vulnerabilities. CX Codex +1 154installs

Project sponsors

Companies that keep this analytics open