modern-python — Claude Code skill: uv, ruff, ty
Configures Python projects with a modern tooling stack: uv for dependency management, ruff for linting and formatting, ty for type checking. Use when starting new projects, writing scripts, or migrating from legacy tools.
npx skills add trailofbits/skills --skill modern-python -a claude-codeWhat modern-python does
The skill applies best practices based on the Trail of Bits cookiecutter template. It includes ready-made pyproject.toml configurations, project structure recommendations, and a reference table for switching from pip, Poetry, mypy, and black. Teaches you to use uv add for dependency management instead of manual edits, uv run for command execution without activating a virtual environment, and [dependency-groups] (PEP 735) to separate dev tools from production dependencies.
Includes security recommendations: shellcheck for shell scripts, detect-secrets for credential detection, pip-audit for dependency vulnerabilities. Provides migration examples: converting requirements.txt to pyproject.toml, replacing flake8+black+isort with ruff, mypy with ty. Handles both single-file scripts (PEP 723) and full packages.
What it helps with
- bootstrap a new Python project with a modern tooling stack
- migrate from pip and requirements.txt to uv
- replace flake8, black, isort with ruff
- switch from mypy to faster type checking with ty
- set up pre-commit hooks using prek instead of slow pre-commit
Example prompts for the agent
- Install the modern-python skill and create a new project with uv, ruff, and ty
- Help me migrate this project from legacy tools to uv
- Show me how to set up pyproject.toml correctly for Python 3.11+ with dev-dependency groups
How to install modern-python
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill modern-python -a claude-code2Manually: put the files in place
~/.claude/skills/modern-python/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/modern-python/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill modern-python -a codex2Manually: put the files in place
.agents/skills/modern-python/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill modern-python -a cursor2Manually: put the files in place
.cursor/skills/modern-python/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills modern-python2Manually: put the files in place
.github/skills/modern-python/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill modern-python -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/modern-python/skills/modern-pythonManually: put the files in place
.devin/skills/modern-python/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill modern-python -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set35
The whole set →Similar
Questions about modern-python
How do I install modern-python in Claude Code?
Run npx skills add trailofbits/skills --skill modern-python -a claude-code, then open ~/.claude/skills/modern-python/SKILL.md for reference.
What does modern-python do?
Provides configurations and practices for a modern Python stack: dependency management via uv, linting and formatting via ruff, type checking via ty. Includes migration examples from pip, Poetry, mypy, and other legacy tools.
Does it require a specific Python version?
The skill targets Python 3.11 and newer. Tools can work with older versions, but configuration will need adjustment.