python-coding-standards

Enforces PEP 8, type hints, and pytest practices for Python projects.

4|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/minexo79/coser-card-maker --skill python-coding-standards-minexo79
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-coding-standards
Source: https://github.com/minexo79/coser-card-maker/tree/main/.kilo/skills/coding-standards/python
Command: npx skills add https://github.com/minexo79/coser-card-maker --skill python-coding-standards-minexo79

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Python codebases often drift into inconsistent formatting, missing type annotations, weak test coverage, and ad-hoc error handling, making them hard to maintain and review. This Skill provides a complete, opinionated set of coding standards so teams write uniform, typed, tested, production-ready Python code. ## Core Features & Use Cases - Style and Type Standards: PEP 8 formatting with Black and isort, type hint patterns including Protocols, Generics, TypedDict, and Literal, plus mypy and Ruff configuration. - Testing and Quality Tooling: pytest best practices with fixtures, parametrization, mocking, and async tests, plus ready-to-use scripts for project scaffolding and running the full quality gate (Black, isort, Ruff, mypy, Bandit, coverage). - Production Patterns: FastAPI service examples, SQLAlchemy models, exception hierarchies, Pydantic validation, secrets management, and async patterns. - Use Case: When starting a new FastAPI backend, run the setup script to scaffold a src-layout project with pyproject.toml, pre-commit hooks, and tests, then apply the standards while writing endpoints so every commit passes lint, type check, and 80% coverage. ## Quick Start Ask the AI to review your Python module against these coding standards and fix any PEP 8, typing, or testing violations it finds.

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 and type hints in a Python project?

Configure Black and isort for formatting, Ruff for linting, and mypy with disallow_untyped_defs enabled in pyproject.toml. Add pre-commit hooks so every commit is automatically formatted, linted, and type-checked before it lands.

What is the recommended Python project structure for production apps?

Use a src layout with the package under src/, separate api, models, services, and utils modules, and a tests directory split into unit, integration, and e2e. Declare dependencies and tool configuration in pyproject.toml.

How do I write pytest tests with fixtures and parametrization?

Define reusable fixtures in conftest.py for database sessions, clients, and factories, then use pytest.mark.parametrize to run one test against many input cases. Use unittest.mock or pytest-mock to isolate external services.

Does mypy strict mode work with Pydantic models?

Yes, enable the pydantic.mypy plugin in your mypy configuration to get accurate type checking for Pydantic v2 models. The provided configuration also relaxes untyped-def rules for tests via per-module overrides.

Why does my test coverage check fail in CI?

Coverage fails when the measured percentage drops below the fail_under threshold, set to 80 in the configuration. Add tests for uncovered branches shown in the term-missing report, or legitimately exclude defensive lines with pragma: no cover.