Skip to content
SkillModel-led2,615 tokens in use

modern-python

Sets up Python projects and scripts with uv, ruff, ty, pytest and prek, and migrates legacy pip, Poetry, mypy and black setups.

8,319 stars on the repository CC-BY-SA-4.0trailofbits/skills · plugins/modern-python/skills/modern-python
/plugin marketplace add trailofbits/skills
View source

Install command as written in the repository's README

Skill label

measured from its files

What installing modern-python costs

39tokens idle
2,615tokens in use
13,962tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Model-led

Script-ledMixedModel-led

Mostly instructions, so how well it works depends on the model that follows them.

This describes the skill's structure, how much of it is scripts. It does not say how well it works.

Touches

shelldetectednetworkdetected

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Excellent
  • Frontmatter12/15
  • Structure25/25
  • Examples9/15
  • Output10/15
  • Size15/15
  • Resources11/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Needs attention
  • Runs shell commands−5

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 91
  • Reaches the network−10

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 283
  • Downloads and runs a program−30

    downloads text and runs it as a program

    references/security-setup.md, line 19
  • Downloads and runs a program−30

    downloads text and runs it as a program

    references/uv-commands.md, line 11

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity100
  • Maintenance52
  • Community64
  • Maturity32
  • Momentum40

Modern Python teaches the agent a current Python toolchain based on the Trail of Bits cookiecutter-python template. It uses uv for dependencies and environments, ruff for linting and formatting, ty for type checking, pytest with a coverage floor, and prek for pre-commit hooks, plus security tools such as shellcheck, detect-secrets, zizmor and pip-audit.

It covers a minimal project, a full package, standalone scripts with PEP 723 inline metadata, and step-by-step migration from requirements.txt, setup.py, flake8 and isort, and mypy.

What You Get

  • A project layout with src/, pyproject.toml, dependency groups and a lock file
  • Ruff, ty and pytest configuration with an 80 percent coverage floor
  • PEP 723 headers for single-file scripts
  • Migration steps from pip, setup.py, flake8, black, isort, mypy and pyright
  • Security hooks and CI checks for secrets, workflows and vulnerable dependencies

Common Use Cases

  • Starting a new Python package with strict linting and typing
  • Writing a one-off script that declares its own dependencies
  • Moving a requirements.txt project to uv
  • Replacing flake8, black and isort with ruff

What Makes It Unique

It is opinionated and consistent: uv commands manage every dependency and run every tool, so the agent never edits dependency lists by hand or activates a virtual environment. It names the mistakes to avoid, such as putting dev tools in optional-dependencies or setting the ty Python version in the wrong table, and it can offer the Trail of Bits cookiecutter template for a full project.

Under The Hood

The skill is prose with reference files and templates and has no scripts of its own. It leads the agent to run uv, ruff, ty and pytest commands in the shell, install packages from PyPI, write pyproject.toml and a Makefile, and delete legacy files such as requirements.txt and virtual environments during a migration. For a full project it can run uvx cookiecutter against the Trail of Bits template on GitHub, which downloads and executes template code, so it asks you first. Two reference files also list installer one-liners that download a script and pipe it to the shell (for uv and prek) next to Homebrew and other options; they are documentation for you to choose from.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers