cleanup

Detect dead code, unused dependencies, and orphaned files in Python repositories.

Updated Sep 9, 2024
One-click install
npx skills add https://github.com/axel-kaliff/dotfiles --skill cleanup-axel-kaliff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup
Source: https://github.com/axel-kaliff/dotfiles/tree/main/claude/.claude/skills/cleanup
Command: npx skills add https://github.com/axel-kaliff/dotfiles --skill cleanup-axel-kaliff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill locates and surfaces code and dependency bloat so teams can safely remove unused functions, stale exports, orphaned files, and declared-but-unused packages before releases or refactors. It reduces maintenance burden, speeds reviews, and lowers risk of shipping unused or confusing code.

Core Features & Use Cases

  • Deterministic scanning using vulture and deadcode to identify high-confidence dead code and complementary findings.
  • Dependency auditing with deptry and ruff to find declared but unused packages and unused imports.
  • Semantic analysis via four parallel LLM agents to detect orphaned files, dead exports, vestigial code patterns, and stale cross-references that static tools miss.
  • Scoped workflows that operate on a provided path, the src/ directory, or only files changed on a feature branch, making it ideal for pre-release audits and large refactors.

Quick Start

Scan the src directory for dead code, unused dependencies, orphaned files, and produce a combined cleanup report.

Frequently Asked Questions about cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find dead code and unused dependencies in a Python repository?

To find dead code and unused dependencies in Python, this task uses deterministic tools like vulture, deadcode, deptry, and ruff for initial scans, then runs parallel LLM agents to detect vestigial patterns and stale cross-references.

What is the best way to detect orphaned files that static analysis tools miss?

Detecting orphaned files that static analysis misses is handled by running parallel LLM agents that perform semantic analysis to identify dead exports, vestigial code patterns, and stale cross-references.

Can I audit only the files changed on a feature branch for stale exports?

Yes, you can audit only the files changed on a feature branch for stale exports. The workflow operates on scoped paths, the src directory, or feature branches specifically for pre-release audits and refactors.

Does deptry work with ruff to find declared but unused packages?

Deptry works with ruff to find declared but unused packages and unused imports. They form the deterministic dependency auditing component of the combined cleanup report.

Why use LLM agents alongside vulture and deadcode for dead code removal?

Using LLM agents alongside vulture and deadcode for dead code removal catches semantic issues like stale cross-references and vestigial patterns that purely deterministic static analysis tools cannot identify.

When should I run a dead code and dependency cleanup pass before a release?

You should run a dead code and dependency cleanup pass before a release to safely remove unused functions and declared-but-unused packages, reducing maintenance burden and lowering the risk of shipping confusing code.