К основному содержанию
скилл Claude Code CX Codex Cursor GitHub Copilot

python-pro — скилл для Claude Code: типизация и async Python

Скилл для написания типобезопасного Python 3.11+ с полной аннотацией, async-кодом и тестами. Генерирует код с type hints, настраивает mypy в строгом режиме, пишет pytest-тесты с фиксчурами и мокингом.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add Jeffallan/claude-skills --skill python-pro -a claude-code
Открыть на GitHub

Что делает python-pro

python-pro помогает писать production-ready код на Python 3.11+. Скилл генерирует функции и классы с полной типизацией, использует dataclasses вместо ручного __init__, правильно организует async/await для I/O-операций и оборачивает работу с ресурсами в context managers.

Внутри скилла — валидация типов через mypy --strict, форматирование черeз black, проверка стиля через ruff и автоматическое тестирование. Если mypy выдаст ошибку, скилл исправляет аннотации и повторно запускает проверку. Тесты пишутся с pytest: фиксчуры, параметризация, мокинг — всё по правилам. Требует Python 3.11 или новее.

Пригодится, если строишь систему, которая должна работать без ошибок типов, много асинхронных операций или нужна высокая покрытие тестами.

Какие задачи решает

  • написать типизированный Python с полной аннотацией типов
  • настроить async/await код и асинхронные паттерны
  • создать тесты pytest с фиксчурами, параметризацией и мокингом
  • валидировать код mypy в строгом режиме без ошибок
  • структурировать обработку ошибок и логирование

Примеры запросов агенту

  • Напиши функцию для чтения конфига с полными type hints и обработкой ошибок
  • Создай dataclass с валидацией портов и сгенерируй тесты pytest
  • Реализуй async-функцию для параллельной загрузки URLs через httpx

Как установить python-pro

1Через Skills CLI (Vercel)

npx skills add Jeffallan/claude-skills --skill python-pro -a claude-code

2Вручную: положить файлы

~/.claude/skills/python-pro/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/python-pro/

Из того же набора61

Весь набор →
laravel-specialist https://github.com/Jeffallan Настраивает агента на разработку бэкенда на Laravel 10+ и PHP 8.2+. Помогает писать модели Eloquent, очереди Horizon, API resources и тесты Pest. Claude Code CX Codex Cursor +1 23 300установок golang-pro https://github.com/Jeffallan Скилл помогает писать идиоматичный Go: разбирать конкурентный код, строить микросервисы и проверять производительность. Пригодится для goroutines, gRPC и тестов. Claude Code CX Codex Cursor +1 18 900установок php-pro https://github.com/Jeffallan Задаёт правила разработки на PHP 8.3+ для Laravel и Symfony: включает strict_types, анализ в PHPStan на уровне 9 и тесты PHPUnit или Pest. Claude Code CX Codex Cursor +1 15 500установок flutter-expert https://github.com/Jeffallan Скилл для разработки кросс-платформных приложений на Flutter 3+ и Dart. Помогает с виджетами, управлением состоянием через Riverpod или Bloc, маршрутизацией GoRouter и оптимизацией производительности. Claude Code CX Codex Cursor +1 14 300установок typescript-pro https://github.com/Jeffallan Настраивает строгую типизацию TypeScript, генерирует брендированные типы и связывает tRPC. Пригодится при проектировании надёжных API и сложных generic-структур. Claude Code CX Codex Cursor +1 14 200установок kubernetes-specialist https://github.com/Jeffallan Скилл помогает создавать и проверять Kubernetes-манифесты, настраивать безопасность и разбирать сбои подов. Пригодится для деплоя и сопровождения кластерных workloads. Claude Code CX Codex Cursor +1 14 100установок devops-engineer https://github.com/Jeffallan Скилл создаёт Dockerfile, CI/CD-конфигурации и манифесты Kubernetes. Нужен для инфраструктуры, деплоя и разбора инцидентов. Claude Code CX Codex Cursor +1 11 200установок wordpress-pro https://github.com/Jeffallan Скилл помогает разрабатывать темы и плагины WordPress, блоки Gutenberg и магазины WooCommerce. Нужен для задач с REST API, хуками, безопасностью и производительностью. Claude Code CX Codex Cursor +1 9 700установок

Похожие

defi-protocol-templates Seth Hobson Скилл даёт Solidity-шаблоны для стейкинга и AMM, а также систем управления и flash loan. Пригодится при создании DeFi-протокола. Claude Code CX Codex Cursor 10 400установок bazel-build-optimization Seth Hobson Скилл помогает настраивать Bazel для монорепозиториев, удалённого выполнения и кэширования. Подойдёт для разбора проблем сборки и ускорения пайплайна. Claude Code CX Codex Cursor 10 300установок ast-grep ast-grep Скилл помогает составлять правила ast-grep для поиска по структуре кода. Пригодится, когда текстового поиска недостаточно, чтобы найти нужные вызовы или конструкции. Claude Code CX Codex Cursor +1 17 900установок cli-anything HKUDS Строит Python-харнесс с Click-командами для любого GUI-приложения или репозитория. Генерирует REPL, тесты и документацию по методологии CLI-Anything. Claude Code CX Codex Cursor +1 2 100установок dart-use-primary-constructors flutter Скилл учит агента переводить классы Dart на первичные конструкторы и синтаксис Dart 3.13+. Он пригодится при рефакторинге моделей данных и сокращении шаблонного кода. Claude Code CX Codex Cursor +1 14 000установок dart-use-ffigen flutter Скилл учит агента генерировать FFI-биндинги через package:ffigen вместо ручного написания. Используй, когда нужно создать или расширить привязки к C/Objective-C/Swift библиотекам. Claude Code CX Codex Cursor +1 13 900установок migrate-to-shoehorn Matt Pocock Переводит type assertions с as в тестах на функции из @total-typescript/shoehorn. Нужен для частичных объектов и намеренно неверных данных в проверках. Claude Code 475 388установок write-swift emilkowalski Скилл помогает писать, проверять и переносить код на Swift с учётом модели языка. Подойдёт, когда нужно разобраться с конкурентностью, ошибкой или циклом удержания объектов. Claude Code CX Codex Cursor +1 117 500установок

Вопросы о python-pro

Как установить python-pro в Claude Code?

Выполни npx skills add Jeffallan/claude-skills --skill python-pro -a claude-code, затем скилл появится в ~/.claude/skills/python-pro/SKILL.md.

Что делает python-pro?

Генерирует типизированный код Python 3.11+ с async-паттернами, пишет pytest-тесты с >90% покрытием, валидирует типы через mypy в строгом режиме и проверяет стиль кодом black и ruff.

Нужен ли для работы скилла Python 3.11?

Да, скилл создан для Python 3.11+. В коде используются современные синтаксис вроде X | None вместо Optional[X], поэтому старые версии не поддерживаются.

Исходный текст

SKILL.md · MIT
---
name: python-pro
description: 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.
license: MIT
metadata:
  author: https://github.com/Jeffallan
  company: https://synergetic.solutions
  version: "1.1.0"
  domain: language
  triggers: Python development, type hints, async Python, pytest, mypy, dataclasses, Python best practices, Pythonic code
  role: specialist
  scope: implementation
  output-format: code
  related-skills: fastapi-expert, devops-engineer
---

# 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

1. **Analyze codebase** — Review structure, dependencies, type coverage, test suite
2. **Design interfaces** — Define protocols, dataclasses, type aliases
3. **Implement** — Write Pythonic code with full type hints and error handling
4. **Test** — Create comprehensive pytest suite with >90% coverage
5. **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 | None` instead of `Optional[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
```python
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
```python
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
```python
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
```python
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)
```toml
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
```

Clean `mypy --strict` output looks like:
```
Success: no issues found in 12 source files
```
Any reported error (e.g., `error: Function is missing a return type annotation`) must be resolved before the implementation is considered complete.

## Output Templates

When implementing Python features, provide:
1. Module file with complete type hints
2. Test file with pytest fixtures
3. Type checking confirmation (mypy --strict passes)
4. Brief explanation of Pythonic patterns used

## Knowledge Reference

Python 3.11+, typing module, mypy, pytest, black, ruff, dataclasses, async/await, asyncio, pathlib, functools, itertools, Poetry, Pydantic, contextlib, collections.abc, Protocol

Maintained by [@jeffallan](https://github.com/jeffallan), Principal Consultant at [Synergetic Solutions](https://synergetic.solutions)

[Documentation](https://jeffallan.github.io/claude-skills/skills/language/python-pro/)

© https://github.com/Jeffallan · MIT · Jeffallan/claude-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой