From python-plugin
Unified Python coding standard for projects in this workspace. Use this skill whenever reading, writing, editing, reviewing, or creating any `.py` file. Covers types (mypy --strict), lint/format (ruff), env + packaging (uv), tests (pytest), and publishing (PyPI). Per-tool deep dives live in sibling skills (`python-ruff`, `python-mypy`, `python-uv`, `python-pypi`, `python-pytest`) — load those for fine-grained guidance.
How this skill is triggered — by the user, by Claude, or both
Slash command
/python-plugin:pythonThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
All Python code in projects that opt into the `python-plugin`. Hooks
All Python code in projects that opt into the python-plugin. Hooks
auto-run ruff + mypy + pytest after every .py edit; this skill is the
guidance the agent reads before writing the code in the first place.
| Concern | Tool | Sibling skill |
|---|---|---|
| Lint + format | ruff | python-ruff |
| Static types | mypy strict | python-mypy |
| Env + deps + lockfile | uv | python-uv |
| Test runner + discovery | pytest | python-pytest |
| Distribution + publish | uv / twine | python-pypi |
-> None for procedures.Any; use Any only at JSON / external
boundaries and document why.from __future__ import annotations in every module; type
expressions become strings, allowing forward references and Py3.9-style
dict[str, X] on older runtimes.list[str], dict[str, int],
tuple[int, ...]. dict[str, Any] is acceptable for parsed JSON.pyproject.toml under [tool.ruff] and
[tool.ruff.lint]. Project owns the rule set; defaults: E, F, I,
UP, ANN.ruff check --fix && ruff format..venv/ per project.pyproject.toml; uv.lock committed.uv sync for normal work, uv pip install -e ".[dev]" for
legacy editable workflows.pip install ad-hoc; if a dep is needed, add it to pyproject
and re-lock.tests/test_<module>.py. The
posttooluse-test-required hook warns when a new module ships without
one.pytest (no unittest classes unless inheriting from a fixture
framework that requires it).tests/, mirror source layout where feasible.tests/conftest.py; use scoped fixtures over module
globals.scripts/, src/<pkg>/, or top-level package — match
project convention.setuptools discovery.I
enforces).raise ... from e to preserve cause when wrapping.except: pass.asyncio only when the I/O concurrency
is the bottleneck.subprocess.run(..., check=False) + explicit returncode check beats
try/except CalledProcessError for control flow.python-ruff — rule selection, per-file ignores, format-on-save.python-mypy — strict-mode escape hatches, stubs, cast() patterns.python-uv — venvs, lockfile workflow, uv run, uv tool.python-pytest — fixtures, parametrize, async tests, plugins.python-pypi — building, uv publish, version bumping, trusted publishers.npx claudepluginhub cjhowe-us/marketplace --plugin python-pluginProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.