modern-python

modern-python is a skill for Claude Code, Codex from antoinebou12/uml-mcp. It costs 138 tokens per session (1,053 once invoked), scanned A, original, MIT.

A guide to current Python project tools and practices, including uv for packages and environments, Ruff for code checks and formatting, ty for type checking, and pytest for tests. It also covers project layout, security checks, and pre-commit checks.

In plain words
What is it for?
Setting up or refactoring Python projects, managing dependencies, formatting and linting code, checking types, writing tests, and adding security or commit checks.
Why use it?
It gives an agent one consistent way to set up, change, check, and test a Python project. It reduces confusion between older commands and the tools this project expects.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/antoinebou12/uml-mcp/modern-python
Any agent
npx skills add antoinebou12/uml-mcp --skill modern-python
Clone the repo
git clone --depth 1 https://github.com/antoinebou12/uml-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for modern-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/antoinebou12/uml-mcp/modern-python.svg)](https://agentmods.dev/skills/antoinebou12/uml-mcp/modern-python)
Your own site
<a href="https://agentmods.dev/skills/antoinebou12/uml-mcp/modern-python"><img src="https://agentmods.dev/badge/skills/antoinebou12/uml-mcp/modern-python.svg" alt="Measured on agentmods" height="20"></a>
Per session 138 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,053 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00138 $0.01053
Opus 5 $0.00069 $0.00526
Sonnet 5 $0.00028 $0.00211
Haiku 4.5 $0.00014 $0.00105

Measured 4d ago against content hash f3163ae4a4d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

modern-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.skill/skills/modern-python/SKILL.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Modern Python

Modern Python tooling and practices: uv for dependencies, ruff for lint/format, ty for type checking, pytest for tests. Use for this project and when setting up or refactoring Python codebases.

When to Use

  • Setting up or changing Python project structure and tooling
  • Replacing pip/virtualenv with uv
  • Replacing flake8/black/isort with ruff, or mypy with ty
  • Adding pre-commit hooks and security scanning
  • Writing or reviewing tests with pytest and coverage

Legacy Command Guidance

Prefer uv over raw python/pip. When about to run legacy commands, use:

Legacy command Use instead
python uv run python
python script.py uv run script.py
pip install pkg uv add pkg or uv run --with pkg
pip uninstall pkg uv remove pkg
pip freeze uv export
python -m pip install uv add / uv sync

Commands that already use uv run (e.g. uv run pytest) do not need changing.

Project Structure and pyproject.toml

  • Layout: Prefer a src/ layout (package under src/<package_name>/). This project uses top-level packages (mcp_core, tools); when adding new packages, keep them at repo root or under a clear namespace.
  • Config: Single pyproject.toml at repo root.
  • Python: This repo targets Python 3.12 only (requires-python in pyproject.toml).
  • Dependency groups (PEP 735): Put dev/test/lint deps in dependency groups where the tool supports them.

Linting and Formatting (ruff)

  • Use ruff for both linting and formatting (replaces flake8, black, isort, pyupgrade).
  • Configure in pyproject.toml under [tool.ruff] and [tool.ruff.format].

Run:

  • uv run ruff check .
  • uv run ruff format .

Fix auto-fixable issues: uv run ruff check --fix .

Type Checking (ty)

  • Use ty instead of mypy/pyright for faster type checking when introducing it.
  • Configure in pyproject.toml under [tool.ty] if needed.

Run: uv run ty check

Read the full file on GitHub · 93 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 93 lines · 138 tokens per session scan A f3163ae4a4d4

Subscribe to this mod's changes

modern-python is a skill published in the GitHub repository antoinebou12/uml-mcp (97 stars, last pushed yesterday), licensed MIT. It adds 138 tokens to every session and 1,053 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.