modern-python skill from Trail of Bits: uv, ruff and ty for Python projects
Makes your AI assistant set up and migrate Python projects with uv, ruff, ty, pytest and prek.
- Installs
- 9K
- on skills.sh
- Stars
- 7.9K
- on GitHub
- Files
- 13
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
modern-python is Trail of Bits' guide for Python tooling, based on its cookiecutter-python template. It has your assistant use uv for dependencies, ruff for linting and formatting, ty for types, pytest for tests and prek for git hooks, and it covers migrations from older tools. It needs uv. The Claude Code plugin route also adds a hook that blocks bare python, pip and pipx commands in your assistant's shell, so read the permissions section before you pick it.
Good for
- Developers starting a new Python project or package
- Anyone moving from pip, Poetry, mypy, black or flake8 to uv and ruff
- Developers writing single-file scripts with dependencies (PEP 723)
- Teams adding pre-commit security checks and Dependabot to a Python repo
Install modern-python
Claude Code
- 1
Copy this prompt.
Install the modern-python skill in Claude Code. Run this command: /plugin marketplace add trailofbits/skills /plugin install modern-python@trailofbits Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires uv.
Install uv first. The plugin routes include a hook; the folder routes install the skill only.
Built from the package data we hold. Not yet tested by us. Source.
What's in the skill
When it loads
Configures Python projects with modern tooling (uv, ruff, ty). Use when creating projects, writing standalone scripts, or migrating from pip/Poetry/mypy/black.
Sections in SKILL.md
- When to Use This Skill
- When NOT to Use This Skill
- Anti-Patterns to Avoid
- Decision Tree
- Tool Overview
- Security Tools
- Quick Start: Minimal Project
- Full Project Setup
- 1. Create Project Structure
- 2. Configure pyproject.toml
- 3. Install Dependencies
- 4. Add Makefile
- Migration Guide
- From requirements.txt + pip
- From setup.py / setup.cfg
- From flake8 + black + isort
Key facts
- Installs on skills.sh
- 9,005 as of 2026-11-02
- Last repo commit
- 2026-10-28
What it includes
Script, new project, library or migration
Single-file script: PEP 723 inline metadata. New multi-file project: minimal uv setup. Reusable package: full setup. Existing project: migration guide.
Try: “Set up a new Python package here with uv, ruff and ty, and add a pytest config.”
Read ·
Decision treeuv init, dependency groups, pyproject.toml, Makefile
Creates a src/ layout project, configures ruff with select ALL, ty strict rules and pytest coverage of 80 percent, and adds a Makefile. It asks first whether you want the Trail of Bits cookiecutter template.
Runs code ·
Quick start and full setupFrom requirements.txt, setup.py, flake8/black/isort, mypy/pyright
Converts to uv and pyproject.toml, removes the old tools, and deletes old files such as requirements.txt and the virtual environment folder when you ask for a migration.
Delete ·
Migration guide10 things to avoid and what to use instead
For example uv add instead of uv pip install or editing pyproject.toml by hand, uv run instead of activating a venv, and prek instead of pre-commit.
Read ·
Anti-patterns tableshellcheck, detect-secrets, actionlint, zizmor, pip-audit, Dependabot
Set up through prek hooks and CI. security-setup.md shows how to install them.
Runs code ·
Security toolspyproject, uv commands, ruff, testing, PEP 723, prek, security, Dependabot, migration
Loaded on demand for details.
Read ·
9 reference filesBlocks bare python, pip and pipx in the agent shell
Only in the plugin route. Prepends PATH shims that print the uv alternative and exit with an error.
Runs code ·
Plugin hook: legacy command interception
From the official docs
Permissions
Medium risk
The skill makes your assistant run uv and other tools, rewrite project config and delete old files during a migration. The plugin route adds a hook that makes bare python, pip and pipx commands fail in your assistant's shell.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
The plugin hook changes PATH for your assistant
On SessionStart, hooks.json runs setup-shims.sh. If uv is installed and CLAUDE_ENV_FILE is set, it appends an export PATH line to that file, so 6 shims (python, python3, pip, pip3, pipx, uv) sit first on PATH for every command your assistant runs. Bare python or python script.py, python -m pip, pip, pip3, pipx and uv pip fail with a uv suggestion. python -c, python -, python -m <module> (other than pip) and uv pip with --project, --directory or --target pass through to the real tool. github.com
Migration deletes files in your project
The migration guide tells the assistant to delete requirements.txt, setup.py, setup.cfg and the venv folder. Commit first and review the diff. github.com
It installs tools with downloaded scripts
security-setup.md shows brew install, cargo install and a curl installer piped to sh for prek, plus uv tool install for detect-secrets and zizmor. prek.md shows prek install, which sets up git hooks, and rm -rf ~/.cache/pre-commit. github.com
It can run a cookiecutter from GitHub
For a new project it asks first, then can run uvx cookiecutter gh:trailofbits/cookiecutter-python. github.com
The command table lists uv publish
The uv quick reference includes uv publish, which uploads a package to PyPI. SKILL.md gives it only as a reference line. github.com
Technical details
| Turning on read-only | No read-only mode. |
|---|---|
| Talks to | PyPI and tool downloads through uv, brew, cargo or the prek installer script (security-setup.md) |
| Scopes |
|
Questions
What does modern-python do?
It gives your assistant Trail of Bits' opinionated Python setup: uv for dependencies, ruff for lint and format, ty for type checks, pytest with coverage, prek for git hooks, and security tools such as zizmor and pip-audit.
How do I install it?
Use the install box at the top. In Claude Code, the plugin route installs the skill plus a hook. The skills folder routes install only the skill. Codex, the skills CLI and a Codex marketplace route are also listed. The box has no Claude app upload because the skill runs uv on your machine.
What is the difference between the plugin and the skill folder?
The plugin adds a SessionStart hook with PATH shims that stop your assistant from running bare python, pip and pipx. The skill folder alone has the instructions and references only.
Will it break my existing project?
Only if you ask for a migration. The skill says to respect legacy tooling when you want to keep it, and it lists non-Python and pre-3.11 projects as cases not to use it.
What Python version does it need?
The skill targets Python 3.11 or newer and says not to use it when an older version is required.
Does it need an API key?
The skill names no key. The tools it sets up download packages from PyPI and other sources.
What license is it under?
CC BY-SA 4.0, stated in the repo LICENSE and README. The plugin manifest names William Tan as author and the repo README says it is made by Trail of Bits.
Is it safe?
It edits project config and runs uv and other tools. A migration deletes old files, and the plugin hook changes how python and pip behave in your assistant's shell. Commit first and read the permissions section.
Information
updated Nov 2, 2026
- Repository
- trailofbits/skills
- Folder
plugins/modern-python/skills/modern-python
Sources
Docs, issue trackers and discussions this page is built from.
Show all 10Hide
- trailofbits/skills README · github.com
- plugin README · github.com
- modern-python SKILL.md · github.com
- security-setup.md · github.com
- setup-shims.sh · github.com
- hooks.json · github.com
- python shim · github.com
- pip shim · github.com
- uv shim · github.com
- prek.md · github.com