python-conventions

python-conventions is a skill for Claude Code, Codex from DJRHails/dotfiles. It costs 57 tokens per session (3,229 once invoked), scanned A, original, MIT.

Coding rules and project setup guidance for Python, including dependency management, formatting, linting, type checking, testing, and package building. It covers tools such as `uv`, `ruff`, `ty`, and `pytest`.

In plain words
What is it for?
Use it when writing or reviewing Python code, creating scripts or packages, configuring tests and checks, or replacing older Python tooling.
Why use it?
It gives consistent choices for starting, reviewing, or modernizing Python projects instead of leaving tool and style decisions to each task.

Skill for Claude CodeCodex

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is uv run python src/myproject/main.py.

Good fit Use it when writing or reviewing Python code, creating scripts or packages, configuring tests and checks, or replacing older Python tooling.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/DJRHails/dotfiles
agentmods
npx agentmods add skills/djrhails/dotfiles/python-conventions

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/djrhails/dotfiles/python-conventions/github.svg)](https://agentmods.dev/skills/djrhails/dotfiles/python-conventions)
Your own site
<a href="https://agentmods.dev/skills/djrhails/dotfiles/python-conventions"><img src="https://agentmods.dev/badge/skills/djrhails/dotfiles/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/djrhails/dotfiles/python-conventions"><img src="https://agentmods.dev/badge/skills/djrhails/dotfiles/python-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,229 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.00057 $0.03229
Opus 5.5 $0.00023 $0.01292
Sonnet 5.5 $0.00011 $0.00646
Haiku 4.5 $0.00006 $0.00323

Measured 1mo ago against content hash 1f084cee5852, 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.

modules/agents/skills/python-conventions/SKILL.md · 246 lines

How it starts

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

Python Conventions

Coding conventions and modern tooling for Python projects. Apply when writing or reviewing Python code, setting up new projects, or migrating from legacy tools. This file is the summary; worked examples and full configs live in references/.

Decision Tree

What are you doing?
|
+- Single-file script with dependencies?
|   -> Use PEP 723 inline metadata (./references/pep723-scripts.md)
|
+- New multi-file project (not distributed)?
|   -> Minimal uv setup (see Project Setup below)
|
+- New reusable package/library?
|   -> Full project setup (see Project Setup below)
|
+- Migrating existing project?
|   -> See Migration Guide below
|
+- Writing or reviewing code?
    -> See conventions below

Toolchain

Tool Purpose Replaces
uv Package/dependency management pip, virtualenv, pip-tools, pipx, pyenv
ruff Linting and formatting flake8, black, isort, pyupgrade, pydocstyle
ty Type checking mypy, pyright
pytest Testing with coverage unittest
prek Pre-commit hooks pre-commit (faster, Rust-native)
uv_build Build backend hatchling, setuptools
Loguru Logging stdlib logging

Security Tools

shellcheck, detect-secrets, actionlint, zizmor (pre-commit); pip-audit and Dependabot for dependencies. Configuration: security-setup.md and dependabot.md.

Legacy Tool Migration

Avoid Use Instead
pip install / pip freeze uv add / uv export
python -m venv / source .venv/bin/activate uv sync / uv run <cmd>
pipx install uv tool install
requirements.txt pyproject.toml (projects) or PEP 723 (scripts)
[project.optional-dependencies] for dev tools [dependency-groups] (PEP 735)
[tool.ty] python-version [tool.ty.environment] python-version
uv pip install uv add and uv sync
Poetry uv
black / isort / flake8 / pylint ruff
mypy / pyright ty
pre-commit prek
hatchling uv_build

Read the full file on GitHub · 246 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. 1mo ago First seen · 246 lines · 57 tokens per session scan A 1f084cee5852

Subscribe to this mod's changes

python-conventions is a skill published in the GitHub repository DJRHails/dotfiles (2 stars, last pushed yesterday), licensed MIT. It adds 57 tokens to every session and 3,229 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-31.

Related

Other skills, from other repositories

ruby-gc

Audit asdf-installed Ruby versions against project pins and remove unreferenced ones. Dry-run by default.

joshukraine/dotfiles · 25 tokens

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

magic3007/dotfiles · 56 tokens

scaffold-python

Scaffold a complete Python project with CI/CD, release pipeline, justfile, sr.yaml, pyproject.toml, .envrc, and standard files. Uses uv, ruff, and justfile (Python lacks a native task runner like pnpm scripts, so just fills that gap). Loads on top of scaffold-project (run that first for cross-language standard files).…

urmzd/dotfiles · 135 tokens

google-adk-python

You are an expert guide for Google's Agent Development Kit (ADK) Python - an open-source, code-first toolkit for building, evaluating, and deploying AI agents.

einverne/dotfiles · 0 tokens

polars

Fast in-memory DataFrame library for datasets that fit in RAM. Use when pandas is too slow but data still fits in memory. Lazy evaluation, parallel execution, Apache Arrow backend. Best for 1-100GB datasets, ETL pipelines, faster pandas replacement. For larger-than-RAM data use dask or vaex.

magic3007/dotfiles · 69 tokens

fluidsim

Framework for computational fluid dynamics simulations using Python. Use when running fluid dynamics simulations including Navier-Stokes equations (2D/3D), shallow water equations, stratified flows, or when analyzing turbulence, vortex dynamics, or geophysical flows. Provides pseudospectral methods with FFT, HPC…

magic3007/dotfiles · 69 tokens