python-pro
Что он делает
Этот скилл ведёт ИИ-агента в написании чистого, типизированного и готового к продакшену Python. Он нужен Python-разработчикам, которым важен код, который легко поддерживать и тестировать.
Когда использовать
- ✓Когда создаёте приложение на Python, которому нужны полные аннотации типов.
- ✓Когда нужен код async/await для операций ввода-вывода в Python.
- ✓Когда хотите написать набор тестов pytest и проверить код через mypy и ruff.
Ссылка на скилл
https://github.com/Jeffallan/claude-skills/blob/main/skills/python-pro/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Напиши типизированный модуль Python, который параллельно загружает данные из трёх API, с тестами pytest.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Агент проектирует протоколы и dataclass, пишет код с аннотациями типов и создаёт набор тестов pytest. Затем он запускает mypy в строгом режиме, black и ruff и исправляет то, что они находят.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Python Pro
Modern Python 3.11+ specialist focused on type-safe, async-first, production-ready code.
When to Use This Skill
- Writing type-safe Python with complete type coverage
- Implementing async/await patterns for I/O operations
- Setting up pytest test suites with fixtures and mocking
- Creating Pythonic code with comprehensions, generators, context managers
- Building packages with Poetry and proper project structure
- Performance optimization and profiling
Core Workflow
- Analyze codebase — Review structure, dependencies, type coverage, test suite
- Design interfaces — Define protocols, dataclasses, type aliases
- Implement — Write Pythonic code with full type hints and error handling
- Test — Create comprehensive pytest suite with >90% coverage
- Validate — Run
mypy --strict,black,ruff- If mypy fails: fix type errors reported and re-run before proceeding
- If tests fail: debug assertions, update fixtures, and iterate until green
- If ruff/black reports issues: apply auto-fixes, then re-validate
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Type System | references/type-system.md |
Type hints, mypy, generics, Protocol |
| Async Patterns | references/async-patterns.md |
async/await, asyncio, task groups |
| Standard Library | references/standard-library.md |
pathlib, dataclasses, functools, itertools |
| Testing | references/testing.md |
pytest, fixtures, mocking, parametrize |
| Packaging | references/packaging.md |
poetry, pip, pyproject.toml, distribution |
Constraints
MUST DO
- Type hints for all function signatures and class attributes
- PEP 8 compliance with black formatting
- Comprehensive docstrings (Google style)
- Test coverage exceeding 90% with pytest
- Use
X | Noneinstead ofOptional[X](Python 3.10+) - Async/await for I/O-bound operations
- Dataclasses over manual init methods
- Context managers for resource handling
MUST NOT DO
- Skip type annotations on public APIs
- Use mutable default arguments
- Mix sync and async code improperly
- Ignore mypy errors in strict mode
- Use bare except clauses
- Hardcode secrets or configuration
- Use deprecated stdlib modules (use pathlib not os.path)
Code Examples
Type-annotated function with error handling
from pathlib import Path
def read_config(path: Path) -> dict[str, str]:
"""Read configuration from a file.
Args:
path: Path to the configuration file.
Returns:
Parsed key-value configuration entries.
Raises:
FileNotFoundError: If the config file does not exist.
ValueError: If a line cannot be parsed.
"""
config: dict[str, str] = {}
with path.open() as f:
for line in f:
key, _, value = line.partition("=")
if not key.strip():
raise ValueError(f"Invalid config line: {line!r}")
config[key.strip()] = value.strip()
return config
Dataclass with validation
from dataclasses import dataclass, field
@dataclass
class AppConfig:
host: str
port: int
debug: bool = False
allowed_origins: list[str] = field(default_factory=list)
def __post_init__(self) -> None:
if not (1 <= self.port <= 65535):
raise ValueError(f"Invalid port: {self.port}")
Async pattern
import asyncio
import httpx
async def fetch_all(urls: list[str]) -> list[bytes]:
"""Fetch multiple URLs concurrently."""
async with httpx.AsyncClient() as client:
tasks = [client.get(url) for url in urls]
responses = await asyncio.gather(*tasks)
return [r.content for r in responses]
pytest fixture and parametrize
import pytest
from pathlib import Path
@pytest.fixture
def config_file(tmp_path: Path) -> Path:
cfg = tmp_path / "config.txt"
cfg.write_text("host=localhost\nport=8080\n")
return cfg
@pytest.mark.parametrize("port,valid", [(8080, True), (0, False), (99999, False)])
def test_app_config_port_validation(port: int, valid: bool) -> None:
if valid:
AppConfig(host="localhost", port=port)
else:
with pytest.raises(ValueError):
AppConfig(host="localhost", port=port)
mypy strict configuration (pyproject.toml)
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
disallo
Частые вопросы
Какие инструменты он запускает?
Он запускает mypy в строгом режиме, black и ruff.
К какому покрытию тестами он стремится?
К покрытию выше 90 процентов с pytest.
Охватывает ли он асинхронный код?
Да. Он охватывает async/await, asyncio и группы задач.
Подробности
Оригинальное описание автора
Use when building Python 3.11+ applications requiring type safety, async programming, or robust error handling. Generates type-annotated Python code, configures mypy in strict mode, writes pytest test suites with fixtures and mocking, and validates code with black and ruff. Invoke for type hints, async/await patterns, dataclasses, dependency injection, logging configuration, and structured error handling.
repo: Jeffallan/claude-skills
Популярность
- Звёзды на GitHub
- 12k
- Место в рейтинге
- #11447
- Лицензия
- MIT
- Обновлён
- 30.10.2026
Комментарии
- …
Другие скиллы из этого репозитория
angular-architect
12kПомогает агенту создавать приложения на Angular 17+: автономные компоненты, ленивая маршрутизация, состояние NgRx, RxJS и настройка производительности.
api-designer
12kПомогает агенту проектировать REST или GraphQL API и писать спецификации OpenAPI 3.1 с правилами для ресурсов, пагинации, форматов ошибок и версий.
architecture-designer
12kПомогает агенту проектировать архитектуру системы, сравнивать шаблоны и технологии и писать Architecture Decision Records, которые объясняют каждый выбор.
atlassian-mcp
12kПомогает агенту искать и обновлять задачи Jira и страницы Confluence через MCP, включая запросы JQL и CQL, спринты и синхронизацию документации.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.