Python Conventions

Enforces Python coding standards including PEP 8, type hints, and pytest testing.

8|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/zb-ss/opencode-workflows --skill python-conventions-zb-ss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Python Conventions
Source: https://github.com/zb-ss/opencode-workflows/tree/main/skill/python-conventions
Command: npx skills add https://github.com/zb-ss/opencode-workflows --skill python-conventions-zb-ss

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive guide to writing clean, maintainable, and robust Python code, ensuring adherence to industry best practices and modern standards.

Core Features & Use Cases

  • Code Style Enforcement: Guidelines for formatting, naming, and structure using tools like black, isort, and ruff.
  • Type Hinting: Comprehensive examples for static type checking with Python 3.9+ syntax.
  • Project Structure: Recommended layout for scalable Python projects.
  • Data Handling: Demonstrations of dataclasses and Pydantic for data modeling and validation.
  • Error Management: Strategies for custom exceptions and context managers.
  • Asynchronous Programming: Patterns for efficient async operations.
  • Testing: Best practices for unit and integration testing with pytest.
  • Dependency Injection: Principles for modular and testable code.
  • Logging & i18n: Guidance on effective logging and internationalization.
  • Security: A checklist for secure Python development.

Quick Start

Follow the Python Conventions skill to set up a new Python project with type hints and pytest.

Frequently Asked Questions about Python Conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce Python coding standards and PEP 8 in my project?

Enforce Python coding standards by applying PEP 8 formatting and naming guidelines, and use black, isort, and ruff to structure your code. This ensures your Python project remains clean and maintainable.

What is the best way to structure a scalable Python project?

The best way to structure a scalable Python project is to follow a recommended layout that separates modules, tests, and configurations. This approach ensures maintainability and robustness as your modern Python application grows.

Should I use dataclasses or Pydantic for data validation in Python?

You should use dataclasses and Pydantic for data modeling and validation in Python. Both are recommended for robust data handling, with Pydantic especially useful for enforcing strict validation rules in your applications.

How do I set up pytest for unit and integration testing?

Set up pytest for unit and integration testing by following established Python testing best practices. This involves configuring your project structure to support modular tests and using dependency injection for more testable code.

What are the best practices for async patterns and error handling in Python?

Best practices for async patterns and error handling in Python include using custom exceptions and context managers for error management. These strategies guide developers in writing robust, efficient, and modern asynchronous applications.

Does this Python conventions guide cover security and logging?

Yes, the Python conventions guide covers security and logging. It provides a security checklist for secure Python development and guidance on effective logging and internationalization to ensure robust applications.