py-code-health
Python Code Health Maintenance
Remove dead code and consolidate duplication to keep codebase clean and maintainable.
Objectives
- Detect unused code (functions, classes, variables)
- Find and remove dead code with high confidence
- Identify duplicate code across files
- Consolidate similar code into parametrized functions
- Remove redundant imports and commented-out code
Required Tools
Add to [dependency-groups] dev: "vulture", "pylint"
- vulture: AST-based dead code detection
- pylint: Duplicate code detection
More from l-mb/python-refactoring-skills
py-refactor
Orchestrate comprehensive Python refactoring - coordinates security, complexity, testing, code health, and modernization skills to systematically improve code quality.
28py-complexity
Reduce cyclomatic and cognitive complexity in Python code. Break down complex functions, simplify control flow, and track complexity trends over time.
19py-quality-setup
Configure ruff, mypy, and basedpyright for Python 3.13 projects. Use when setting up linters and type checkers in pyproject.toml and pyrightconfig.json.
13py-modernize
Modernize Python codebases - migrate pip to uv, upgrade syntax to Python 3.13+, replace deprecated patterns, and update tooling to current best practices.
12py-test-quality
Measure and improve test coverage and test suite quality using code coverage and mutation testing. Ensures tests actually catch bugs.
11py-security
Security vulnerability detection and remediation for Python codebases. Identifies SQL injection, hardcoded secrets, weak cryptography, and other OWASP vulnerabilities.
9