python-conventions

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

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

Made for: Claude Code, Codex.

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. 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.00057 $0.03229
Opus 5 $0.00028 $0.01614
Sonnet 5 $0.00011 $0.00646
Haiku 4.5 $0.00006 $0.00323

Measured yesterday against content hash 1f084cee5852, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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. yesterday 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 7d ago), licensed MIT. It adds 57 tokens to every session and 3,229 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

autopilot-batch

Fan out a batch of autopilot-queued issues to parallel background worktree subagents — each runs /autopilot at the build model from its 'model:' label — with a gating review at Opus 5 or above and never below the build (Opus reviews Sonnet and Opus builds, Fable reviews Fable builds).

joshukraine/dotfiles · 75 tokens

todoist-cli

Manage Todoist tasks, projects, labels, filters, sections, comments, reminders, and workspaces via the td CLI. Use when the user wants to view, create, update, complete, or organize Todoist items, or mentions tasks, inbox, today, upcoming, projects, labels, or filters.

joshukraine/dotfiles · 68 tokens

autopilot

Carry a well-scoped GitHub issue through the full dev loop autonomously, stopping at a per-run tier boundary (PR-ready, or merge+deploy for small reversible changes).

joshukraine/dotfiles · 40 tokens

qa-handoff

Generate a hands-on QA testing guide as a self-contained HTML page — for Rails apps or static (Hugo) sites. --publish uploads the HTML to the project's configured QA host.

joshukraine/dotfiles · 41 tokens

walkthrough

Generate a hands-on browser walkthrough of a PR's user-facing changes to exercise before review; --publish posts the final version to the PR for QA.

joshukraine/dotfiles · 33 tokens

dustoff

Assess a project that's been dormant for months and produce a prioritized re-entry plan — lifecycle stage, what's stale or broken, and how far the project's tooling has drifted from current conventions — delegating every fix to the skill that owns it, and optionally capturing the plan as a tracking issue that survives…

joshukraine/dotfiles · 64 tokens