python-code-style

Configure Python linting, formatting, naming conventions, and docstring standards for projects.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill python-code-style-sanketadlak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-code-style
Source: https://github.com/SanketAdlak/PDMProjectDesign/tree/main/.agents/skills/python-code-style
Command: npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill python-code-style-sanketadlak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Python projects often suffer from inconsistent formatting, unclear naming, missing docstrings, and untyped code, making codebases hard to review and maintain. This Skill provides concrete standards and tool configurations to enforce consistency automatically. ## Core Features & Use Cases - Tooling Configuration: Ready-to-use pyproject.toml settings for ruff (linting and formatting), mypy, and pyright with strict type checking. - Style Standards: PEP 8 naming conventions, import organization rules, 120-character line length, and absolute import patterns. - Documentation Patterns: Google-style docstring templates for functions, classes, READMEs, and changelogs. - Use Case: When starting a new Python project, apply this Skill to generate a complete pyproject.toml with ruff and mypy configured, then review existing modules against the naming and docstring conventions. ## Quick Start Set up ruff and mypy configuration in my pyproject.toml and review my Python module for style and docstring compliance.

Frequently Asked Questions about python-code-style

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

FAQPage Schema
How do I configure ruff for linting and formatting in Python?

Add a [tool.ruff] section to pyproject.toml with line-length, target-version, and lint rule selections like E, F, I, B, and UP. Run ruff check --fix to lint and auto-fix, and ruff format to format code.

What is the difference between mypy and pyright for type checking?

Both perform static type checking on Python code. Mypy is configured with strict = true in pyproject.toml, while pyright uses typeCheckingMode = "strict" and typically runs faster. Either can enforce disallow_untyped_defs for production code.

How do I write Google-style docstrings for Python functions?

Start with a one-line summary, then add Args, Returns, and Raises sections describing each parameter and outcome. Include an Example section with doctest-style usage for complex public functions and classes.

Should I use relative or absolute imports in Python projects?

Use absolute imports exclusively, such as from myproject.utils import retry_decorator. Absolute imports are more maintainable, clearer about module origins, and avoid breakage when files are moved within the package.

What line length should Python projects use?

This standard recommends 120 characters for modern displays, configured via line-length in ruff. Break long function signatures, method chains, and f-strings across lines using parentheses for readability.