python-lintinglisted
Install: claude install-skill abdullahkhawer/devops-skills
# Python Linting Skill
Run this skill when asked to lint, format, check style, or check types for Python code.
## Step 1 — Detect available tooling
Check which linting/formatting tools are configured or installed, in order of preference:
```bash
# Config files (indicate which tool the project already uses)
ls pyproject.toml setup.cfg .flake8 mypy.ini 2>/dev/null
# Installed tools
which ruff black flake8 mypy isort 2>/dev/null
```
Prefer `ruff` if configured or installed — it replaces `flake8`, `isort`, and much of `pylint` with a single fast tool. Fall back to `flake8` + `black` + `isort` if `ruff` is not available. Do not install new tools without asking the user first.
---
## Step 2 — Run linting (read-only check)
```bash
# Preferred
ruff check .
# Fallback
flake8 .
```
Report all findings grouped by file, with line numbers and rule codes.
---
## Step 3 — Run formatting check
```bash
# Preferred
ruff format --check --diff .
# Fallback
black --check --diff .
isort --check-only --diff .
```
Show the proposed diff to the user before applying any formatting changes.
---
## Step 4 — Run type checking (if type hints are used)
```bash
mypy .
```
Skip this step if the project has no type hints and no `mypy` configuration.
---
## Step 5 — Apply fixes (only with user confirmation)
```bash
# Preferred
ruff check --fix .
ruff format .
# Fallback
black .
isort .
```
Only run auto-fix commands after showing the user what will change and getting explicit confirmat