---
title: "Python Code Style & Documentation"
type: skill
id: "wshobson-agents/python-development/python-code-style"
category: "Engineering"
publisher: "Seth Hobson"
license: "MIT"
source: "https://github.com/wshobson/agents/tree/7e2fb55"
canonical: "https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-code-style"
open_in_pho: "https://pho.chat/customize?item=wshobson-agents%2Fpython-development%2Fpython-code-style&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library"
---

# Python Code Style & Documentation

Python code style, linting, formatting, naming conventions, and documentation standards. Use when writing new code, reviewing style, configuring linters, writing docstrings, or establishing project standards.

Source: Seth Hobson (MIT), copied at a pinned commit. Free to use. Part of the Phở Skills library (https://labs.pho.chat/en/skills).
Skill set: Python development (https://labs.pho.chat/en/skills/wshobson-agents/python-development.md).

## What it covers
- When to Use This Skill
- Core Concepts
  - 1. Automated Formatting
  - 2. Consistent Naming
  - 3. Documentation as Code
  - 4. Type Annotations
- Quick Start
- Fundamental Patterns
  - Pattern 1: Modern Python Tooling
  - Pattern 2: Type Checking Configuration
  - Pattern 3: Naming Conventions
  - Pattern 4: Import Organization
- Advanced Patterns
  - Pattern 5: Google-Style Docstrings
  - Pattern 6: Line Length and Formatting
  - Pattern 7: Project Documentation
- Best Practices Summary

## Other skills in this set
- [Async Python Patterns](https://labs.pho.chat/en/skills/wshobson-agents/python-development/async-python-patterns.md): 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…
- [Python Anti-Patterns Checklist](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-anti-patterns.md): Use this skill when reviewing Python code for common anti-patterns to avoid. Use as a checklist when reviewing code, before finalizing implementations, or when debugging issues that might stem from…
- [Python Background Jobs & Task Queues](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-background-jobs.md): Python background job patterns including task queues, workers, and event-driven architecture. Use when implementing async task processing, job queues, long-running operations, or decoupling work…
- [Python Configuration Management](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-configuration.md): Python configuration management via environment variables and typed settings. Use when externalizing config, setting up pydantic-settings, managing secrets, or implementing environment-specific…
- [Python Design Patterns](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-design-patterns.md): Python design patterns including KISS, Separation of Concerns, Single Responsibility, and composition over inheritance. Use this skill when designing a new service or component from scratch and…
- [Python Error Handling](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-error-handling.md): Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch…
- [Python Observability](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-observability.md): Python observability patterns including structured logging, metrics, and distributed tracing. Use when adding logging, implementing metrics collection, setting up tracing, or debugging production…
- [Python Packaging](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-packaging.md): 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…
- [Python Performance Optimization](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-performance-optimization.md): 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.
- [Python Project Structure & Module Architecture](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-project-structure.md): Python project organization, module architecture, and public API design. Use when setting up new projects, organizing modules, defining public interfaces with __all__, or planning directory layouts.
- [Python Resilience Patterns](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-resilience.md): Python resilience patterns including automatic retries, exponential backoff, timeouts, and fault-tolerant decorators. Use when adding retry logic, implementing timeouts, building fault-tolerant…
- [Python Resource Management](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-resource-management.md): Python resource management with context managers, cleanup patterns, and streaming. Use when managing connections, file handles, implementing cleanup logic, or building streaming responses with…
- [Python Testing Patterns](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-testing-patterns.md): 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.
- [Python Type Safety](https://labs.pho.chat/en/skills/wshobson-agents/python-development/python-type-safety.md): Python type safety with type hints, generics, protocols, and strict type checking. Use when adding type annotations, implementing generic classes, defining structural interfaces, or configuring…
- [UV Package Manager](https://labs.pho.chat/en/skills/wshobson-agents/python-development/uv-package-manager.md): 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…

## Use it
- In Phở: open https://pho.chat/customize?item=wshobson-agents%2Fpython-development%2Fpython-code-style&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library and press Try, or add it so Phở loads it whenever a request matches. Phở works with your own API key (OpenAI, Anthropic, Google and others).
- Full instructions (original SKILL.md, unchanged): https://labs.pho.chat/skills/raw/wshobson-agents/python-development/skills/python-code-style/SKILL.md
- Original files: https://github.com/wshobson/agents/tree/7e2fb55 (MIT).
- Full machine-readable index: https://labs.pho.chat/skills.json
