python-coding-standards

python-coding-standards is a skill for Claude Code, Codex from williamzujkowski/standards. It costs 45 tokens per session (3,106 once invoked), scanned A, original, MIT.

A guide to Python coding practices based on PEP 8, the main style guide for Python. It covers type hints, documentation, project structure, dependency management, error handling, and tests, including TDD, where tests are written before the code.

In plain words
What is it for?
Use it when starting or reviewing Python projects, defining public interfaces, writing automated tests, or setting up formatting and dependency rules.
Why use it?
It helps make Python projects easier to read, check, test, and maintain while reducing inconsistent styles and avoidable errors.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when starting or reviewing Python projects, defining public interfaces, writing automated tests, or setting up formatting and dependency rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/williamzujkowski/standards/python
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add williamzujkowski/standards --skill python
Clone the repo
git clone --depth 1 https://github.com/williamzujkowski/standards

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-coding-standards

README.md
[![agentmods](https://agentmods.dev/badge/skills/williamzujkowski/standards/python/github.svg)](https://agentmods.dev/skills/williamzujkowski/standards/python)
Your own site
<a href="https://agentmods.dev/skills/williamzujkowski/standards/python"><img src="https://agentmods.dev/badge/skills/williamzujkowski/standards/python/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-coding-standards

Your own site · 80×15
<a href="https://agentmods.dev/skills/williamzujkowski/standards/python"><img src="https://agentmods.dev/badge/skills/williamzujkowski/standards/python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,106 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.03106
Opus 5.5 $0.00018 $0.01242
Sonnet 5.5 $0.00009 $0.00621
Haiku 4.5 $0.00005 $0.00311

Measured yesterday against content hash c71eaa9fa4d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-30, from the pricing page.

Security

Grade A, and why

python-coding-standards scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/check-code-quality.sh, scripts/setup-project.sh, templates/test-template.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/coding-standards/python/SKILL.md · 528 lines

How it starts

The opening of the file, as written. The whole thing — 528 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Coding Standards

Quick Navigation: Level 1: Quick Start (5 min) | Level 2: Implementation (30 min) | Level 3: Mastery (Extended)


Level 1: Quick Start

Core Principles

  1. Pythonic Code: Write idiomatic Python following "The Zen of Python"
  2. Type Safety: Use type hints for all public interfaces
  3. Test-First: Write tests before implementation (TDD)
  4. Documentation: Docstrings for all public functions
  5. Modern Python: Use Python 3.10+ features

Essential Checklist

  • PEP 8 compliant (Black + isort formatted)
  • Type hints on all function signatures
  • pytest tests with >80% coverage
  • Google-style docstrings
  • Specific exception handling (no bare except:)
  • No hardcoded secrets
  • src layout project structure
  • Pinned dependencies in requirements.txt

Quick Example

"""User authentication module."""

from dataclasses import dataclass
from typing import Optional
import bcrypt


@dataclass
class User:
    """User account data."""
    username: str
    email: str
    password_hash: str


def authenticate_user(username: str, password: str) -> Optional[User]:
    """Authenticate user with username and password.

    Args:
        username: User's username
        password: Plain text password to verify

    Returns:
        User object if authentication succeeds, None otherwise

    Raises:
        ValueError: If username or password is empty
    """
    if not username or not password:
        raise ValueError("Username and password required")

    user = _fetch_user_from_db(username)
    if user and _verify_password(password, user.password_hash):
        return user
    return None

Level 2: Implementation

Code Style & Formatting

PEP 8 + Black Formatting:

# Good: Black-formatted, clear naming
def calculate_user_discount(
    user: User,
    purchase_amount: Decimal,
    promo_code: Optional[str] = None
) -> Decimal:
    """Calculate discount for user purchase."""
    base_discount = _get_loyalty_discount(user)
    promo_discount = _validate_promo_code(promo_code) if promo_code else Decimal("0")
    return min(base_discount + promo_discount, Decimal("0.5"))

Read the full file on GitHub · 528 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 528 lines · 45 tokens per session scan A c71eaa9fa4d4

Subscribe to this mod's changes

python-coding-standards is a skill published in the GitHub repository williamzujkowski/standards (18 stars, last pushed 1mo ago), licensed MIT. It adds 45 tokens to every session and 3,106 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-29.