python-conventions

python-conventions is a skill for Claude Code, Codex from Goldziher/ai-rulez. It costs 45 tokens per session (382 once invoked), scanned A, original, MIT.

A set of rules for writing, testing, packaging, and securing Python 3.10 or newer code.

In plain words
What is it for?
Use it when creating or reviewing Python applications and packages, including type checking, async input/output, tests, documentation, packaging, and security scans.
Why use it?
It reduces errors from missing type information, weak input handling, blocking asynchronous code, poor logging, and vulnerable dependencies.

Skill for Claude CodeCodex

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

Good fit Use it when creating or reviewing Python applications and packages, including type checking, async input/output, tests, documentation, packaging, and security scans.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/goldziher/ai-rulez/python-conventions
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 Goldziher/ai-rulez --skill python-conventions
Clone the repo
git clone --depth 1 https://github.com/Goldziher/ai-rulez

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/goldziher/ai-rulez/python-conventions"><img src="https://agentmods.dev/badge/skills/goldziher/ai-rulez/python-conventions.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 382 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 pass 7 Sept 2026
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.00045 $0.00382
Opus 5.5 $0.00018 $0.00153
Sonnet 5.5 $0.00009 $0.00076
Haiku 4.5 $0.00005 $0.00038

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

Security

Grade A, and why

python-conventions 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 1mo 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.

internal/builtins/languages/python/skills/python-conventions/SKILL.md · 18 lines

What it actually says

  • Python 3.10+, type hints on all public APIs, avoid Any — use precise types, generics, or typing.Protocol.
  • Formatting/linting: a fast linter/formatter (e.g., Ruff), zero warnings; strict static type checking (e.g., mypy or pyright). Security: a SAST tool (e.g., Bandit).
  • Testing: pytest with function-based tests, pytest-cov (80%+), hypothesis for property-based.
  • Error handling: specific exceptions only, never bare except:, contextlib.suppress for intentional ignoring.
  • Dataclasses or Pydantic for structured data — avoid raw dicts for known schemas.
  • pathlib.Path over os.path for filesystem operations. Google-style docstrings on public APIs.
  • Async: async/await for I/O, never mix blocking and async, asyncio.gather() for concurrency.
  • Package management: a fast, lockfile-based package manager (e.g., uv) with the lockfile committed, build with a PEP 517 backend (e.g., maturin or hatchling).
  • Security: pip-audit for dependency CVE scanning. Zero tolerance for critical/high vulnerabilities.
  • Logging: structured logging (key=value / JSON) — never f-strings in log calls.
  • Pattern matching (match/case) for multi-branch type dispatch (3.10+).
  • Anti-patterns: mutable default args, import *, global state, time.sleep in async.
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. 1mo ago First seen · 18 lines · 45 tokens per session scan A c5869959dbe9

Subscribe to this mod's changes

python-conventions is a skill published in the GitHub repository Goldziher/ai-rulez (163 stars, last pushed 2d ago), licensed MIT. It adds 45 tokens to every session and 382 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-08-30.

Related

Other skills, from other repositories

code-guidelines-go

Go 1.24–1.27 coding guidelines for the dimetron/pi-go AI agent runtime. Use this skill whenever writing, reviewing, or refactoring ANY Go code in pi-go. This covers idiomatic style, error handling, concurrency, project layout, testing (table-driven, fuzz, benchmarks, synctest), new stdlib usage, golangci-lint v2…

dimetron/pi-go · 124 tokens

go-127

What changed in Go 1.27 (released August 2026) and how it changes the way Go is written in pi-go. Use this skill when writing or reviewing Go that could use a 1.27 feature, when bumping the go directive in go.mod, when a build or test behaves differently after a toolchain upgrade, or when code-guidelines-go points…

dimetron/pi-go · 177 tokens

bubbletea-testing

Use this skill whenever writing tests for Bubble Tea (charmbracelet/bubbletea) TUI applications in Go. Triggers include any mention of testing Bubble Tea models, teatest, golden file testing for TUIs, testing tea.Cmd or tea.Msg, snapshot testing terminal output, or writing tests for any Go CLI/TUI that uses the Elm…

dimetron/pi-go · 139 tokens

vhs-e2e-gif

Record a test run, a TUI session, or any terminal command as a GIF with VHS and attach it to a GitHub PR as a release-hosted asset, never a repo commit. Use when asked to record an e2e run, demo a fix on a PR, attach a GIF or screen recording to a pull request, show a test passing visually, or produce a terminal…

dimetron/pi-go · 106 tokens

check-linters-before-commit

Before any commit, run linters, vet, tests, and build verification; do not commit until checks pass.

dimetron/pi-go · 30 tokens

code-review-pi

Review code for quality, run linters, check test coverage, fix issues, and enforce gates. Save the final report to ./specs/issues/003-code-review-pi/PROMPT.md. Use before committing changes.

dimetron/pi-go · 50 tokens