/python-plugin:python-mypyfrom python-plugin
Deep guidance for mypy strict static typing. Use when configuring `[tool.mypy]`, debugging type errors, picking between `cast` / `assert isinstance` / TypeGuard, writing protocols vs ABCs, handling third-party libraries without stubs, dealing with pydantic plugin, silencing follow-imports for path-injected modules, or migrating an untyped codebase. Pairs with the unified `python` skill — load this one when the question is specifically about mypy.
Ships in python-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Strict mode is the default. Every project starts at strict = true and
adds per-module overrides only with a written reason.
[tool.mypy]
python_version = "3.11"
strict = true
files = ["src", "scripts", "hooks"]
explicit_package_bases = true
namespace_packages = true
[[tool.mypy.overrides]]
module = ["legacy.untyped.*"]
ignore_missing_imports = true
follow_imports = "skip"
strict = true enables--disallow-untyped-defs — every function annotated.--disallow-any-generics — list, dict must be parameterized.--no-implicit-optional — Optional[T] must be explicit.--warn-unused-ignores — dead # type: ignore flagged.--warn-return-any — function declared to return T can't actually
return Any.Any-leaking call sitesWrap third-party returns:
data: dict[str, Any] = json.loads(text)
return data
The local annotation pins the type so the function doesn't trip
warn-return-any.
For pydantic / msgspec models that mypy can't infer, install the
matching plugin (pydantic ships pydantic.mypy).
types-<package>.ignore_missing_imports = true. Don't blanket-disable globally.If a module mutates sys.path to find a sibling package, mypy can't
resolve it. Two mitigations:
mypy_path in [tool.mypy] to the same dirs the runtime
bootstrap finds.import-untyped and using
follow_imports = "skip" for that package.castassert isinstance(x, T) — runtime check, mypy narrows.if x is not None: — narrows Optional[T] to T.match statements with type patterns.TypeGuard[T] for custom predicates.cast(T, x) is a last resort; prefer narrowing.
Use dmypy run (or the mypy-type-checker VS Code extension's
preferDaemon: true) to keep type state warm between checks. Cuts
incremental check time from seconds to milliseconds.
Run python -m mypy (no args — [tool.mypy].files controls scope).
Single job, no matrix needed.
What SKILL.md sets; muted values are Claude Code's defaults
python-plugin@cjhowe-us-marketplace is listed by cjhowe-us/marketplace — review the source before installing
npx claudepluginhub cjhowe-us/marketplace --plugin python-plugin6 skills in this plugin
/pythonUnified 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.
/python-pypiDeep guidance for publishing Python packages to PyPI. Use when preparing a release, configuring `[project]` metadata for distribution, building wheels with `uv build`, publishing with `uv publish`, setting up Trusted Publishers / OIDC in GitHub Actions, picking version bump strategy, dealing with name collisions, or recovering from a botched release. Pairs with the unified `python` skill.
/Other plugins' skills for the same job