python

Generate PEP8-compliant, type-hinted Python modules with matching pytest tests.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/led8/.codex --skill python-led8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python
Source: https://github.com/led8/.codex/tree/main/skills/python
Command: npx skills add https://github.com/led8/.codex --skill python-led8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provide clear, repeatable guidance and enforcement for writing production-quality Python code, reducing defects and manual tool configuration while ensuring consistent formatting, typing, testing, logging, and security practices.

Core Features & Use Cases

  • Tooling orchestration and commands for formatting, linting, and type checking (black, ruff, mypy/pyright) to enforce consistent code quality.
  • Testing and CI patterns with pytest and coverage targets, secure secrets handling with Pydantic, async HTTP best practices with httpx and tenacity, and Docker integration for reproducible builds.
  • Code review and security guidance including bandit, pip-audit, semgrep recommendations, and concrete examples for FastAPI, Click, dataclasses, and dependency injection.

Quick Start

Generate a new typed Python module src/myproject/utils.py with Google-style docstrings, full type hints, a matching pytest test file, and run uvx black and uvx ruff check to validate style.

Frequently Asked Questions about python

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

FAQPage Schema
How do I set up a Python project with black, ruff, and mypy for production code?

Set up Python projects by orchestrating black formatting, ruff linting, and mypy or pyright type checking to enforce consistent PEP8-compliant code quality. This ensures modules are type-hinted and formatted with a 120-character line length.

What is the best way to add pytest tests and coverage targets to a FastAPI application?

Add pytest tests and coverage targets to FastAPI applications by generating matching test files alongside typed Python modules. This approach ensures robust backend services with secure secret handling via pydantic SecretStr.

How do I handle async HTTP requests in Python with httpx and tenacity retries?

Handle async HTTP requests in Python by utilizing httpx combined with tenacity retries for resilient network calls. This pattern provides best practices for robust backend services and modern Python modules.

Does this Python tooling workflow support Docker and uv for reproducible builds?

This Python tooling workflow supports Docker integration and uv tooling to create reproducible builds. It orchestrates formatting, linting, type checking, and testing workflows for CLI tools and reusable libraries.

How do I enforce secure secret handling in Python using pydantic SecretStr?

Enforce secure secret handling in Python by utilizing pydantic SecretStr for sensitive credentials. This practice is integrated alongside code review and security guidance using bandit, pip-audit, and semgrep recommendations.

What are the limitations of using ruff and black together for Python linting and formatting?

Limitations of using ruff and black together are minimal, as ruff handles linting while black enforces formatting like 120 char line length. They are orchestrated together to reduce defects and manual configuration.