Skill
py-refactor
py-refactor — a Claude Code skill from l-mb/python-refactoring-skills
Features
- ✓Comprehensive refactoring for Python code
- ✓Automated analysis for code quality improvement
- ✓Modular skills addressing specific code quality aspects
- ✓Security vulnerability detection and fixing
- ✓Reduction of cyclomatic and cognitive complexity
- ✓Enhanced test coverage and effectiveness
- ✓Dead code removal and duplication detection
- ✓Automated quality checks with Git hooks
- ✓Visit GitHub for more details
Installation Guide
bash
git clone https://github.com/l-mb/python-refactoring-skills.git
cd python-refactoring-skillsbash
# Option A: Symlink approach (recommended - easier to update)
./scripts/install-symlinks.sh # Stable skills only (default)
./scripts/install-symlinks.sh --install-wip # All skills including WIP
# Option B: Copy approach (standalone installation)
cp -r skills/py-refactor skills/py-security skills/py-complexity skills/py-quality-setup skills/py-git-hooks skills/py-code-health skills/py-modernize ~/.claude/skills/ # Stable only
cp -r skills/* ~/.claude/skills/ # All skillsSkill Status: Skills are tagged as stable (mostly reviewed) or wip (work-in-progress, functional but may change). Default installation includes only stable skills.
Skills install analysis tools into your project's virtual environment automatically.
To pre-install, add to your pyproject.toml:
toml
[dependency-groups]
dev = ["radon", "vulture", "pylint", "bandit", "lizard", "pytest-cov", "mutmut", "wily", "xenon", "pyupgrade", "ruff", "mypy", "basedpyright", "pre-commit"]Then run: uv sync && source .venv/bin/activate
Note: Tools are tracked in pyproject.toml for reproducibility. See [docs/installation.md](docs/installation.md) for details.
Basic Usage
In Claude Code, invoke any skill:
text
# Quick security audit
Please use py-security to scan for vulnerabilities
# Reduce complexity in specific module
Use py-complexity to refactor the handlers.py module
# Comprehensive refactoring
Use py-refactor to systematically improve this codebaseSee [docs/quick-start.md](docs/quick-start.md) for more examples.