python-coding-standards

Enforce PEP 8, type hints, and pytest standards in Python projects.

17|1|Updated Jun 8, 2025
One-click install
npx skills add https://github.com/williamzujkowski/standards --skill python-coding-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-coding-standards
Source: https://github.com/williamzujkowski/standards/tree/main/skills/coding-standards/python
Command: npx skills add https://github.com/williamzujkowski/standards --skill python-coding-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pydantic, pydantic-settings, pytest, pytest-cov, pytest-asyncio, pytest-mock, black, isort, mypy, ruff, pre-commit, bandit, pylint, and includes scripts (resource) components.

What problem does it solve?

This skill provides a definitive guide to Python coding standards, ensuring your projects are clean, maintainable, and production-ready. It automates the enforcement of PEP 8, type hints, and robust pytest testing, reducing bugs and improving developer efficiency.

Core Features & Use Cases

  • PEP 8 Compliance: Integrates Black and isort to automatically apply PEP 8 formatting and import organization.
  • Type Safety with mypy: Guides on using type hints for all public interfaces and complex functions to catch errors early.
  • Pytest Best Practices: Offers patterns for writing comprehensive tests with fixtures, parametrization, and coverage.
  • Use Case: Initialize a new Python project by applying these standards, automatically configuring Black, isort, mypy, and pytest to ensure all code adheres to consistent, high-quality standards from the start.

Quick Start

Generate a pytest test file for a Python function, including fixtures and parametrized test cases.

Frequently Asked Questions about python-coding-standards

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

FAQPage Schema
How do I enforce PEP 8 standards automatically across a Python project?

PEP 8 enforcement uses tools like Black for code formatting and isort for import organization, applied automatically via pre-commit hooks or CI pipelines. This ensures consistent style without manual review, reducing formatting discussions in code reviews.

What's the best way to add type hints to Python code for production quality?

Type hints on public interfaces and complex functions catch errors early when checked with mypy. Combine type annotations with pytest testing and documentation to satisfy modern Python 3.10+ practices and improve maintainability.

How do I set up pytest with fixtures and parametrized tests?

Pytest fixtures provide reusable test setup, while parametrization runs the same test against multiple inputs. Combined with coverage tracking via pytest-cov, this pattern enables comprehensive test suites that verify code behavior across scenarios.

Can I integrate coding standards enforcement into a CI pipeline?

Yes. Pre-commit hooks and CI tools like Ruff, mypy, and Bandit run automatically on every commit or pipeline stage, catching quality issues before merge. This integration ensures standards are enforced consistently without blocking developer workflow.

What does static analysis catch that testing alone doesn't?

Static analysis tools like Pylint, Ruff, and Bandit identify code style violations, type mismatches, security issues, and dead code without running tests. Combined with pytest, they provide multi-layer quality gates for production-ready Python applications.

Do I need all these tools, or can I start with a subset?

Start with Black and pytest as foundations, then layer in mypy for type safety and pre-commit to automate checks. Add Ruff, Bandit, and Pylint incrementally as your project scales; each tool addresses specific quality dimensions.