python-development

Modern Python development with Python 3.12+, Django, FastAPI, async patterns, and production best practices

View on GitHub
Author Seth Hobson
Namespace @HermeticOrmus/claude-code-workflows
Category languages
Version 1.2.1
Stars 5
Downloads 3
self.md verified
Table of content

Modern Python development with Python 3.12+, Django, FastAPI, async patterns, and production best practices

Installation

npx claude-plugins install @HermeticOrmus/claude-code-workflows/python-development

Contents

Folders: agents, commands, skills

Files: README.md

Documentation

Modern Python development patterns, testing, packaging, and the blazing-fast uv package manager.

Python Development provides:

Result: Production-ready Python code with modern tooling.


Quick Start

Invoke the Agent

@python-pro scaffold a FastAPI project with uv
@python-pro review this async code for best practices
@python-pro optimize this data processing function

Access Skills

# Skills are auto-loaded when relevant
"Set up uv for this project" -> uv-package-manager skill activates
"Write pytest tests" -> python-testing-patterns skill activates

The 5 Skills

1. UV Package Manager

10-100x faster than pip, modern Python project management

Example:

# Create project
uv init myproject
cd myproject

# Add dependencies
uv add fastapi uvicorn sqlalchemy

# Sync environment
uv sync

2. Python Testing Patterns

Comprehensive testing with pytest and modern fixtures

Example:

@pytest.fixture
def db_session():
    """Provide clean database session per test."""
    engine = create_engine("sqlite:///:memory:")
    with Session(engine) as session:
        yield session
        session.rollback()

3. Async Python Patterns

Concurrency with asyncio, avoiding common pitfalls

Example:

async def fetch_all(urls: list[str]) -> list[Response]:
    async with aiohttp.ClientSession() as session:
        async with asyncio.TaskGroup() as tg:
            tasks = [tg.create_task(fetch(session, url)) for url in urls]
        return [t.result() for t in tasks]

4. Python Packaging

Modern packaging with pyproject.toml and setuptools

Example:

[project]
name = "mypackage"
version = "1.0.0"
dependencies = ["requests>=2.28"]

[project.scripts]
mycommand = "mypackage.cli:main"

5. Python Performance Optimization

Making Python fast where it matters

Example:

# Before: 100x slower
result = [x**2 for x in large_list]

# After: Vectorized
result = np.array(large_list) ** 2

Plugin Structure

python-development/
├── README.md                              # This file
├── skills/                                # Knowledge base
│   ├── uv-package-manager/
│   │   └── SKILL.md                       # uv patterns
│   ├── python-testing-patterns/
│   │   └── SKILL.md                       # pytest patterns
│   ├── async-python-patterns/
│   │   └── SKILL.md                       # asyncio patterns
│   ├── python-packaging/
│   │   └── SKILL.md                       # packaging patterns
│   └── python-performance-optimization/
│       └── SKILL.md                       # performance patterns
├── commands/                              # Slash commands
│   └── python-scaffold.md                 # Project scaffolding
└── agents/                                # Specialist agents
    └── python-pro.md                      # Python expert agent

Usage Examples

Example 1: New Project Setup

User: Set up a new FastAPI project with uv, pytest, and async support

@python-pro responds:
- Creates project with uv init
- Adds dependencies (fastapi, uvicorn, pytest, pytest-asyncio)
- Sets up project structure
- Creates sample async endpoint
- Creates sample async test

Example 2: Code Review

User: Review this Python code for async best practices

@python-pro analyzes:
- Identifies blocking calls in async context
- Suggests asyncio.to_thread for CPU-bound work
- Recommends structured concurrency with TaskGroup
- Points out error handling improvements

Example 3: Performance Issue

User: This data processing is too slow, help me optimize

@python-pro:
1. Profiles the code to find bottlenecks
2. Suggests vectorization with NumPy
3. Recommends caching with functools.lru_cache
4. Proposes multiprocessing for CPU-bound work

When to Use This Plugin

Perfect For:

…(truncated)

Included Skills

This plugin includes 5 skill definitions:

async-python-patterns

Master Python asyncio, concurrent programming, and async/await patterns for high-performance applications. Use when building async APIs, concurrent systems, or I/O-bound applications requiring non-blocking operations.

View skill definition

Async Python Patterns

Comprehensive guidance for implementing asynchronous Python applications using asyncio, concurrent programming patterns, and async/await for building high-performance, non-blocking systems.

When to Use This Skill

Core Concepts

1. Event Loop

The event loop is the heart of asyncio, managing and scheduling asynchronous tasks.

Key characteristics:

2. Coroutines

Functions defined with async def that can be paused and resumed.

Syntax:

async def my_coroutine():
    result = await some_async_operation()
    return result

3. Tasks

Scheduled coroutines that run concurrently on the event loop.

4. Futures

Low-level objects representing eventual results of async operations.

5. Async Context Managers

Resources that support async with for proper cleanup.

6. Async Iterators

Objects that support async for for iterating over async da

…(truncated)

python-packaging

Create distributable Python packages with proper project structure, setup.py/pyproject.toml, and publishing to PyPI. Use when packaging Python libraries, creating CLI tools, or distributing Python code.

View skill definition

Python Packaging

Comprehensive guide to creating, structuring, and distributing Python packages using modern packaging tools, pyproject.toml, and publishing to PyPI.

When to Use This Skill

Core Concepts

1. Package Structure

2. Modern Packaging Standards

3. Build Backends

4. Distribution

Quick Start

Minimal Package Stru

…(truncated)

python-performance-optimization

Profile and optimize Python code using cProfile, memory profilers, and performance best practices. Use when debugging slow Python code, optimizing bottlenecks, or improving application performance.

View skill definition

Python Performance Optimization

Comprehensive guide to profiling, analyzing, and optimizing Python code for better performance, including CPU profiling, memory optimization, and implementation best practices.

When to Use This Skill

Core Concepts

1. Profiling Types

2. Performance Metrics

3. Optimization Strategies

Quick Start

Basic Timing

import time

def measure_time():
    """Simple timing me

...(truncated)

</details>

### python-testing-patterns

> Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

<details>
<summary>View skill definition</summary>

# Python Testing Patterns

Comprehensive guide to implementing robust testing strategies in Python using pytest, fixtures, mocking, parameterization, and test-driven development practices.

## When to Use This Skill

- Writing unit tests for Python code
- Setting up test suites and test infrastructure
- Implementing test-driven development (TDD)
- Creating integration tests for APIs and services
- Mocking external dependencies and services
- Testing async code and concurrent operations
- Setting up continuous testing in CI/CD
- Implementing property-based testing
- Testing database operations
- Debugging failing tests

## Core Concepts

### 1. Test Types
- **Unit Tests**: Test individual functions/classes in isolation
- **Integration Tests**: Test interaction between components
- **Functional Tests**: Test complete features end-to-end
- **Performance Tests**: Measure speed and resource usage

### 2. Test Structure (AAA Pattern)
- **Arrange**: Set up test data and preconditions
- **Act**: Execute the code under test
- **Assert**: Verify the results

### 3. Test Coverage
- Measure what code is exercised by tests
- Identify untested code paths
- Aim for meaningful coverage, not just high percentages

### 4. Test Isolation
- Tests should be independent
- No shared state between tests
- Each test should clean up after itself

## Quick Start

```python
# test_example.py
def add(a, b):
    return a + b

def test_add():
    """Basic test example."""
    result = add(2, 3)
    assert 

...(truncated)

</details>

### uv-package-manager

> Master the uv package manager for fast Python dependency management, virtual environments, and modern Python project workflows. Use when setting up Python projects, managing dependencies, or optimizing Python development workflows with uv.

<details>
<summary>View skill definition</summary>

# UV Package Manager

Comprehensive guide to using uv, an extremely fast Python package installer and resolver written in Rust, for modern Python project management and dependency workflows.

## When to Use This Skill

- Setting up new Python projects quickly
- Managing Python dependencies faster than pip
- Creating and managing virtual environments
- Installing Python interpreters
- Resolving dependency conflicts efficiently
- Migrating from pip/pip-tools/poetry
- Speeding up CI/CD pipelines
- Managing monorepo Python projects
- Working with lockfiles for reproducible builds
- Optimizing Docker builds with Python dependencies

## Core Concepts

### 1. What is uv?
- **Ultra-fast package installer**: 10-100x faster than pip
- **Written in Rust**: Leverages Rust's performance
- **Drop-in pip replacement**: Compatible with pip workflows
- **Virtual environment manager**: Create and manage venvs
- **Python installer**: Download and manage Python versions
- **Resolver**: Advanced dependency resolution
- **Lockfile support**: Reproducible installations

### 2. Key Features
- Blazing fast installation speeds
- Disk space efficient with global cache
- Compatible with pip, pip-tools, poetry
- Comprehensive dependency resolution
- Cross-platform support (Linux, macOS, Windows)
- No Python required for installation
- Built-in virtual environment support

### 3. UV vs Traditional Tools
- **vs pip**: 10-100x faster, better resolver
- **vs pip-tools**: Faster, simpler, better UX
- **vs poe

...(truncated)

</details>

## Source

[View on GitHub](https://github.com/HermeticOrmus/LibreUIUX-Claude-Code)