python-cleanup

Identify and remove dead code in Python projects using static analysis and security scans.

2|Updated Oct 2, 2025
One-click install
npx skills add https://github.com/franklinbaldo/egregora --skill python-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-cleanup
Source: https://github.com/franklinbaldo/egregora/tree/main/.claude/skills/python-cleanup
Command: npx skills add https://github.com/franklinbaldo/egregora --skill python-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ruff, mypy, pytest, pytest-cov, vulture, deptry, pip-audit, pyupgrade, autoflake, radon, xenon, bandit, detect-secrets, pre-commit.

What problem does it solve?

This Skill eliminates the manual drudgery of finding dead code, managing dependencies, and scanning for security flaws. It helps you maintain a pristine, secure, and efficient Python codebase without constant vigilance.

Core Features & Use Cases

  • Dead Code & Dependency Detection: Automatically identifies unused code, imports, and dependencies, streamlining your project.
  • Security & Quality Scans: Integrates tools for vulnerability checks, complexity analysis, and modernizing syntax.
  • Use Case: Before a major release, use this Skill to perform a deep audit, ensuring no security vulnerabilities, dead code, or outdated syntax makes it to production.

Quick Start

Use the python-cleanup skill to perform a quick sweep of my project for dead code and security issues.

Frequently Asked Questions about python-cleanup

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

FAQPage Schema
How do I identify and remove dead code from my Python project?

Dead code identification uses static analysis tools like vulture and coverage data to scan your codebase and flag unused functions, variables, and imports. This Skill automates that detection across modular apps and monorepos, then provides recommended fixes you can apply immediately.

Can I scan for security vulnerabilities and dependency issues in Python automatically?

Yes. This Skill integrates bandit for security scanning, pip-audit for dependency vulnerabilities, and deptry for undeclared dependencies. It runs all checks in a single workflow and surfaces actionable results before release.

What's the best way to clean up unused imports and modernize Python syntax?

Autoflake removes unused imports, pyupgrade modernizes syntax to current Python standards, and ruff enforces code quality rules. This Skill chains these tools together to standardize your codebase in one pass.

Does this work with large codebases and monorepos?

Yes. The Skill handles Python projects of any size, including monorepos and legacy systems. It uses phased workflows—quick sweep, deep analysis, and automated fixes—so you can scale scans to your project structure.

How do I check code complexity and test coverage gaps?

Radon measures cyclomatic and maintainability complexity, pytest-cov reports test coverage, and xenon enforces complexity thresholds. This Skill integrates all three to identify coverage gaps and overly complex functions.

Can I detect hardcoded secrets in my Python codebase?

Detect-secrets scans for exposed API keys, passwords, and tokens in your code and version history. This Skill runs it alongside other security checks to catch secrets before they reach production.