prod-python

A set of rules for writing, reviewing, and refactoring Python code in a clear, standard style, using modern Python 3.13 or newer type annotations. It favors simple code and avoids unnecessary layers and repetitive explanations.

In plain words
What is it for?
Use it when building or reviewing Python scripts, APIs, libraries, and command-line tools, or when simplifying an over-engineered Python codebase.
Why use it?
It helps reduce bloated or hard-to-read Python, including common patterns that make generated code look artificial or harder to maintain.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/ankit-aglawe/python-coding-agent-skill/prod-python
Any agent
npx skills add ankit-aglawe/python-coding-agent-skill --skill prod-python
Clone the repo
git clone --depth 1 https://github.com/ankit-aglawe/python-coding-agent-skill

Made for: Claude Code, Codex.

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,831 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00045 $0.03831
Opus 5 $0.00023 $0.01916
Sonnet 5 $0.00009 $0.00766
Haiku 4.5 $0.00005 $0.00383

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

Security

Grade A, and why

prod-python 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.

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.

prod-python/skills/prod-python/SKILL.md · 603 lines

How it starts

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

Production Python

Write Python like a senior developer — simple, readable, PEP-compliant. No AI slop. No over-engineering. No unnecessary abstractions.

Core principle: The best code is the simplest code that solves the problem correctly.

When to Use

  • Writing any Python code (scripts, APIs, libraries, CLIs)
  • Refactoring existing Python code
  • Code reviews — flag AI patterns
  • Code feels bloated, over-abstracted, or "AI-generated"

AI Slop — Eliminate on Sight

Module-Level Docstrings on Every File

# SLOP
"""User authentication module for handling login and registration."""

from flask import request

# CLEAN — filename says it all
from flask import request

Only add module docstrings for genuinely complex algorithms or non-obvious design decisions. Never add # src/path/file.py path comments.

Over-Documented Obvious Code

# SLOP — 20 lines to say "sum prices"
def calculate_total(items: List[Dict[str, Any]]) -> float:
    """
    Calculate the total price of items.

    Args:
        items: List of item dictionaries containing prices

    Returns:
        float: The total sum of all item prices

    Raises:
        ValueError: If items is empty
        KeyError: If price key missing
    """
    total = 0.0
    for item in items:
        total += item['price']
    return total

# CLEAN
def calculate_total(items: list[dict]) -> float:
    return sum(item['price'] for item in items)

Docstrings: one line max for obvious functions. Skip entirely if the signature tells the story.

Narrating Code with Comments

# SLOP
# Initialize the user list
users = []
# Loop through each record
for record in records:
    # Create user object
    user = User(record)
    # Append to list
    users.append(user)

# CLEAN
users = [User(r) for r in records]

Comments explain WHY, never WHAT. If you need to explain what code does, rewrite the code.

Legacy typing Imports

# SLOP — pre-3.9 style
from typing import List, Dict, Optional, Union, Tuple, Any

def process(data: List[Dict[str, Any]]) -> Optional[Dict[str, Union[str, int]]]:
    ...

# CLEAN — modern builtins + PEP 604
def process(data: list[dict]) -> dict | None:
    ...

Read the full file on GitHub · 603 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 · 603 lines · 45 tokens per session scan A 5017e8cf1d44

Subscribe to this mod's changes

prod-python is a skill published in the GitHub repository ankit-aglawe/python-coding-agent-skill (2 stars, last pushed 6mo ago), licensed MIT. It adds 45 tokens to every session and 3,831 once invoked, about $0.0002 per session on Opus 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-08-31.