python-idioms

python-idioms is a skill for Claude Code, Codex from irahardianto/awesome-agv. It costs 56 tokens per session (4,236 once invoked), scanned A, original, MIT.

A guide to Python coding practices using type hints, protocols, Pydantic, asynchronous code, pytest, Ruff, and mypy.

In plain words
What is it for?
Use it when building or reviewing Python projects, especially code involving input validation, asynchronous work, or file and network operations.
Why use it?
It helps make Python code clearer and catches style, typing, and test problems earlier.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when building or reviewing Python projects, especially code involving input validation, asynchronous work, or file and network operations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/irahardianto/awesome-agv/python-idioms
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 irahardianto/awesome-agv --skill python-idioms
Clone the repo
git clone --depth 1 https://github.com/irahardianto/awesome-agv

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-idioms

README.md
[![agentmods](https://agentmods.dev/badge/skills/irahardianto/awesome-agv/python-idioms/github.svg)](https://agentmods.dev/skills/irahardianto/awesome-agv/python-idioms)
Your own site
<a href="https://agentmods.dev/skills/irahardianto/awesome-agv/python-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/awesome-agv/python-idioms/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-idioms

Your own site · 80×15
<a href="https://agentmods.dev/skills/irahardianto/awesome-agv/python-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/awesome-agv/python-idioms.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,236 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 248
    Subtle instructions detected that may alter agent decision-making or introduce hidden biases.
    Fix: Review content for implicit steering or bias. Ensure instructions are explicit and align with the skill's stated purpose.
  • medium Agent Snooping · line 434
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
  • medium Agent Snooping · line 435
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
  • medium Agent Snooping · line 436
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
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.00056 $0.04236
Opus 5.5 $0.00022 $0.01694
Sonnet 5.5 $0.00011 $0.00847
Haiku 4.5 $0.00006 $0.00424

Measured 22d ago against content hash f1aa06f95542, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-idioms 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 22d ago.

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.

.agents/skills/python-idioms/SKILL.md · 441 lines

How it starts

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

Python Idioms and Patterns

Core Philosophy

Python rewards explicitness and readability over cleverness. Follow the Zen of Python. If it reads like plain English, it's probably idiomatic.

Scope: This skill covers Python-specific coding idioms. For file layout see references/project-structure.md. For safety/SAST/performance patterns see references/python-patterns-and-anti-patterns.md. For logging see logging-implementation skill. For quality commands see code-idioms-and-conventions rule.

Loading Guards

  • If no pyproject.toml or *.py files, this skill does not apply
  • If Django project (django in dependencies), co-load django-idioms skill alongside this one

When to Load References

Situation Reference to Load
Starting a new project or setting up file layout references/project-structure.md
Choosing packages, pyproject.toml setup, or ruff config references/recommended-dependencies.md
Writing code that handles user input, async operations, or I/O references/python-patterns-and-anti-patterns.md

Toolchain and Python Version

  • Default to latest stable Python. As of August 2026, Python 3.14. Minimum target: 3.13+.
  • Key version milestones:
    • 3.14+ — Deferred evaluation of annotations (PEP 649, no more from __future__ import annotations), template strings (PEP 750)
    • 3.13+ — Improved error messages, experimental free-threaded build, experimental JIT
    • 3.12+ — Type parameter syntax type X = ... (PEP 695), @override decorator, improved f-strings, itertools.batched
    • 3.11+ — StrEnum, ExceptionGroup + except*, asyncio.TaskGroup, tomllib, fine-grained error locations
    • 3.10+ — Pattern matching (match/case), X | Y union syntax, TypeAlias

Type Hints — Non-Negotiable

Type hints are required for all public APIs, class attributes, and function signatures.

  • Use standard collections (list, dict, set) for typing, not typing.List etc.
  • Use X | Y instead of Union[X, Y] or Optional[X].
  • Use PEP 695 type parameter syntax (3.12+) for generic types: type Vector[T] = list[T]
  • Use @override (3.12+) to ensure methods actually override a base class method.
  • Use TypeVar with constraints and bounds when necessary.
  • Use Never for functions that always raise an exception or never return.

Read the full file on GitHub · 441 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 22d ago Changed · -3 lines · +27 tokens per session f1aa06f95542
  2. 1mo ago First seen · 444 lines · 29 tokens per session scan A 94455f90e0b3

Subscribe to this mod's changes

python-idioms is a skill published in the GitHub repository irahardianto/awesome-agv (156 stars, last pushed 5d ago), licensed MIT. It adds 56 tokens to every session and 4,236 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-03.

Related

Other skills, from other repositories