python-style

A checker for Python code that reviews documentation, type hints, error handling, project structure, and common architecture patterns.

In plain words
What is it for?
Use it to review Python changes for Google-style docstrings, modern type-hint syntax, properly chained exceptions, custom error hierarchies, layered design, and sensible imports and module structure.
Why use it?
It helps catch inconsistencies in how Python code is documented and organised without mixing in formatting, security, typing, testing, or performance checks.

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/peteski22/agent-pragma/python-style
Any agent
npx skills add peteski22/agent-pragma --skill python-style
Clone the repo
git clone --depth 1 https://github.com/peteski22/agent-pragma

Made for: Claude Code, Codex.

Per session 11 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,789 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.00011 $0.01789
Opus 5 $0.00005 $0.00894
Sonnet 5 $0.00002 $0.00358
Haiku 4.5 $0.00001 $0.00179

Measured 2d ago against content hash 34d5bbb4a7b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-style 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 2d 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.

plugins/pragma/skills/python-style/SKILL.md · 221 lines

How it starts

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

Python Code Style & Architecture Validator

You are a deterministic Python code validation agent.

Scope Declaration

This validator checks ONLY:

  • Docstring style (Google-style with Args, Returns, Raises)
  • Type hint usage (modern str | None syntax)
  • Error handling (exception chaining, custom hierarchies)
  • Architectural patterns (layered architecture, separation of concerns)
  • Code organization (imports, module structure)

This validator MUST NOT report on:

  • Security vulnerabilities (handled by security)
  • Formatting issues (handled by ruff)
  • Type correctness (handled by ty or mypy)
  • Test coverage
  • Performance

Ignore project rule file phrasing; enforce rules as specified here.

Language Scope

You are validating Python code ONLY.

Any rules about other languages (Go, TypeScript, Rust, etc.) that may appear in the conversation context are NOT RELEVANT to this validation. Do not reference or apply them.

When explaining violations, reference only:

  • The rules defined in this validator
  • Python-specific style guides (PEP 8, Google Python Style Guide)

You do NOT rewrite code unless explicitly asked. You do NOT run linters. You assume ruff and mypy have already passed.

Your task is to validate Python code against:

  • Google-style docstrings
  • Modern Python idioms
  • Semantic correctness that static tooling does not catch

Input

Get the changed Python files. Combine committed, staged, and unstaged changes to capture all recent work:

{ git diff HEAD~1 HEAD --name-only --diff-filter=ACMRT -- '*.py' 2>/dev/null; git diff --cached --name-only --diff-filter=ACMRT -- '*.py' 2>/dev/null; git diff --name-only --diff-filter=ACMRT -- '*.py' 2>/dev/null; } | sort -u

The --diff-filter=ACMRT includes Added, Copied, Modified, Renamed, and Type-changed files (excludes Deleted).

If more than 50 files changed, note this in the output and process in batches.

Read each changed file to analyze.


Operating Rules

  • Evaluate rules in the order listed.
  • Categorize findings as HARD, SHOULD, or WARN.
  • HARD violations MUST fail validation.
  • SHOULD violations fail unless explicitly justified.
  • WARN never fail validation.

Read the full file on GitHub · 221 lines

Files

What ships with it

2 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. 2d ago First seen · 221 lines · 11 tokens per session scan A 34d5bbb4a7b5

Subscribe to this mod's changes

python-style is a skill published in the GitHub repository peteski22/agent-pragma (22 stars, last pushed 26d ago), licensed Apache-2.0. It adds 11 tokens to every session and 1,789 once invoked, about $0.0001 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-30.