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-skillThis skill is limited to using the following tools:
These standards apply whenever you write, review, or commit Python code.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides MCP server integration in Claude Code plugins via .mcp.json or plugin.json configs for stdio, SSE, HTTP types, enabling external services as tools.
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 |