Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

modern-python

БесплатноЗапускает вложенные скриптыНе проверен

Modern Python tooling best practices using uv, ruff, ty, and pytest. Mandates the Trail of Bits Python coding standards for project setup, dependency…

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

Modern Python Skill

Modern Python tooling skill adapted from Trail of Bits coding standards. Mandates the use of uv (package management), ruff (linting and formatting), ty (type checking), and pytest (testing) as the standard Python toolchain. Based on patterns from trailofbits/cookiecutter-python for consistent, high-quality Python projects. - Project initialization with modern Python toolchain (uv + ruff + ty + pytest) - Migration from legacy tools (pip/Poetry/pipenv to uv, black/flake8/isort to ruff, mypy to ty) - pyproject.toml configuration for all tools (single source of truth) - Dependency management with uv (lock files, dependency groups, virtual environments) - Linting and formatting with ruff (replaces flake8, isort, black, pyflakes, pycodestyle) - Type checking with ty (Rust-based, faster than mypy) - Testing with pytest, pytest-cov, and hypothesis - CI/CD configuration with GitHub Actions - Dependabot setup for automated dependency updates - Pre-commit hook configuration

Overview

This skill implements Trail of Bits' modern Python coding standards for the agent-studio framework. The core philosophy is: use Rust-based tools for faster feedback loops, especially when working with AI agents. Every tool in this stack (uv, ruff, ty) is written in Rust and provides sub-second execution times, enabling tight iteration cycles.

Source repository: https://github.com/trailofbits/skills Template: https://github.com/trailofbits/cookiecutter-python License: CC-BY-SA-4.0

When to Use

  • When creating new Python projects from scratch
  • When migrating Python projects from legacy tooling
  • When setting up CI/CD pipelines for Python projects
  • When standardizing Python tooling across a team
  • When writing standalone Python scripts that need proper structure
  • When an AI agent needs fast feedback from Python tooling

Iron Laws

  1. ALWAYS configure all Python tooling in pyproject.toml -- no separate config files (setup.cfg, .flake8, mypy.ini, black.toml) are permitted.
  2. ALWAYS use uv add/uv remove for dependency management -- never use bare pip install in projects managed by uv.
  3. NEVER commit venv/, .venv/, or pip-generated requirements.txt -- commit uv.lock for reproducible builds.
  4. ALWAYS use uv run to execute tools and scripts -- this ensures the correct virtual environment and dependency resolution.
  5. NEVER use legacy linting/formatting tools (flake8, black, isort, mypy) when ruff and ty are available -- consolidate to the Rust-based stack for speed and consistency.

Anti-Patterns

Anti-Pattern Why It Fails Correct Approach
Using pip install directly in a uv-managed project Bypasses lockfile and dependency resolution; creates reproducibility drift Use uv add <pkg> to add dependencies and uv sync to install
Maintaining .flake8, mypy.ini, or black.toml config files Fragments configuration across multiple files; hard to maintain and audit Consolidate all tool config into pyproject.toml under [tool.ruff] and [tool.ty]
Running python script.py instead of uv run python script.py Uses system Python instead of project venv; dependency mismatches Always use uv run to execute within the managed environment
Globally installing CLI tools with pip install --user Pollutes global environment; version conflicts across projects Use uv tool run <tool> or uvx <tool> for one-off tool execution
Ignoring ruff security rules (S select) Misses bandit-equivalent security checks like hardcoded passwords and SQL injection Enable select = ["S"] in [tool.ruff.lint] for security linting

The Modern Python Stack

Tool Replaces Purpose Speed
uv pip, Poetry, pipenv, pip-tools Package & project
Полный SKILL.md на GitHub

Установить modern-python в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Bash
Glob
Grep

Вложенные файлы

commands/modern-python.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/research-requirements.mdrules/modern-python.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

FAQ

Что делает скилл modern-python?

Modern Python tooling best practices using uv, ruff, ty, and pytest. Mandates the Trail of Bits Python coding standards for project setup, dependency management, linting, type checking, and testing. Based on patterns from trailofbits/cookiecutter-python.

Как установить скилл modern-python?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл modern-python запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить modern-python с