Help us improve
Share bugs, ideas, or general feedback.
From python-dev
Python development quality standards. Applies when writing, reviewing, or committing Python code. Enforces coding style, line length, type annotations, linting (ruff), type checking (ty), and testing (pytest).
npx claudepluginhub vino9net/claude-python-skillHow this skill is triggered — by the user, by Claude, or both
Slash command
/python-dev:qualityThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
These standards apply whenever you write, review, or commit Python code.
Sets up Python code quality toolchain with ruff linting/formatting, mypy type checking, complexity gating, dead code detection, pre-commit hooks, pyproject.toml config, and Makefile targets.
Enforces Python code quality using ruff for linting/formatting and ty for type checking. Covers pyproject.toml configs, pre-commit hooks, and type hints.
Runs deterministic Python quality checks: linting/formatting (ruff), type checking (ty), tests (pytest), policy validation, and pre-commit workflows. Reports grouped results by category.
Share bugs, ideas, or general feedback.
These standards apply whenever you write, review, or commit Python code.
Target 88 characters per line. Hard limit is 92 (enforced by ruff).
This is critical — write concise lines from the start. Strategies:
Do NOT write lines over 88 characters and rely on the formatter to fix them.
All imports MUST be at the top of the file. Do NOT use inline or local imports inside functions/methods. The only exceptions are:
ImportErrorUse modern syntax — do not import from typing for built-in generics.
# Correct
def process(data: str | None) -> list[dict[str, int]]:
items: set[str] = set()
return []
# Incorrect — never do this
from typing import Optional, List, Dict, Set
def process(data: Optional[str]) -> List[Dict[str, int]]:
items: Set[str] = set()
return []
Remove unused typing imports when converting to modern syntax.
.py files on saveUse Conventional Commits format. Every commit subject must start with a type prefix.
type: short imperative description
| Prefix | Use for |
|---|---|
feat: | New features or functionality |
fix: | Bug fixes |
chore: | Maintenance, deps, config, CI |
refactor: | Code changes that don't fix bugs or add features |
test: | Adding or updating tests |
docs: | Documentation only |
feat(auth): add token refresh is fine, feat: add token refresh is also finefix: handle null user in session check
The middleware assumed user was always set after auth,
but expired tokens produce a null user object.
When preparing to commit, run these checks in order. Only commit if ALL pass.
1. ruff format .
2. ruff check . --fix
3. ruff check .
4. deptry .
5. ty check
6. pytest -v --timeout=180
7. Commit
This project uses uv as its package manager. Always use uv to install or remove packages. Never use pip install or pip uninstall — they bypass the lockfile and can corrupt the environment.
uv add <package> # add a dependency
uv remove <package> # remove a dependency
uv sync # sync lockfile to environment
uv run <command> # run inside the virtual environment
uv run pytest # example: run tests
| Tool | Commands |
|---|---|
| ruff | ruff format . · ruff check . · ruff check . --fix |
| deptry | deptry . — find unused, missing, and transitive dependencies |
| ty | ty check · ty check <file> |
| uv | uv add <pkg> · uv sync · uv run <cmd> |
| pytest | pytest · pytest tests/test_file.py · pytest -v |